Main Menu

My life, My coding

Started by Rx7man, May 27, 2015, 09:09:36 AM

Rx7man

OK, I'm getting close to ready to start working with the Raspberry Pi... I just got it today, but haven't got the display for it yet... I'm going to have to tinker with it a little I'm sure.. especially don't know how it's going to be do the GUI... time will tell... I think I will 'integrate' it into my truck and essentially it will replace my stereo head unit... Wonder what sort of GPS apps are available for it... I'll have to try all the different OS options.. I think Android might be an option, and is one I would seriously consider since I could develop an Android app that does the same thing and communicates over Bluetooth, with the added benefit that some people wouldn't need to get any additional hardware...

I'm excited about this, but I don't know how much time i'll have in the coming months to work on it.. things are warming up here and it's going to get busy
'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles

Bdubb'z


It will be interesting to see what you come up with.  I've looked into the Pi before and was a bit hesitant about choosing/creating an OS.  Seems like its right up your alley!!

Rx7man

umm.. it's WAY up my alley.. as in it's going to be ANOTHER steep learning curve...  It's been about 15 years since I've fiddled with and linux machines, and I have NO idea how the programming interface is going to be, especially for graphical stuff.. At least with arduino I've gotten my feet wet, so to speak.

I should also have a replacement exhaust pressure sensor coming in by next week.. I bought 3 of them this time from a guy on ebay.. $18 each, and they're just about identical to the Honeywells.. I also bought a 0inHg - 30 PSI one in case I ever do a gasser, that was $33..
'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles

hakcenter

I've got a pi here running Gentoo.. man that literally took a week to compile haha.
TS2009 Deḇarim 8:2
"And you shall remember that יהוה your Elohim led you all the way these forty years in the wilderness, to humble you, prove you, to know what is in your heart, whether you guard His commands or not.

Rx7man

I haven't played with *nix in so long... I did run an Open BSD server for a while.. I think I got up to 600 days uptime, and a power outage killed that.  I think that at least for now I'll just run Raspbian... But I'll have to figure out how to do GUI programming.

'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles

Rx7man

Well, the X300 expansion board for the Pi has a dead short in it, prevents the pi from powering up and heats the fuse... Talked to the seller, they're sending a replacement, and not asking for the old one back.. Thumbs up to Maplectronic :)
'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles

Rx7man

OK. Here's the current version of my program.. it'll be WILDLY different than Curtis's version, and I did want it that way, I deliberately didn't look at his code while I built mine (no offense) because I wanted to learn it all myself and come to my own conclusions about everything.  I have it somewhat commented.

Biggest things I did differently is I have some classes of commonly used objects... I'll go through them briefly

Map2d:  a 2 dimensional map, good for TPS/RPM.. I have more work to do on it.  Currently implemented as an array of bytes, with the indexes as arrays of long Ints.. Map1d is the same idea, useful for things like mapping temp sender outputs to temperatures..  BOTH of these are subject to change!!, I want to streamline them into one, and add some features, remove redundancy, and make it easy to use other types of numbers, as well as make it easy to load and save to EEPROM.

MyVar.. still haven't figured out a better name for it.  takes care of applying smoothing when "updateValue" is called.. also calculates the slope in units/second.  Both the value and the slope are smoothed by a factor.. The possible values are 0-1 inclusive, 1 being an unchanging value, 0 being unsmoothed.



'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles

Rx7man

Well, doing some more work on program flow.. I'm changing it so it doesn't read all the inputs at once (since it takes a while to read 10 analog inputs and do the smoothing math).  Instead of calling "read inputs" before the "calculate position" function, it continually reads 1 input at a time, then checks the timers to see if they've elapsed.  I plan on doing something similar for the serial writes as well so it pretty much means the serial port will update at 'live' speed, yet not interfere with program flow and timing since I don't have to send a ton of information through it at once.
'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles

Rx7man

Got the touchscreen in.. really good color and resolution on it, touch input works well (multitouch capable if OS supports it).. what they call a case for it pretty sad though.. I might call it a frame at best.

Trying to figure out what programming language to use to do the UI... I'm debating between Java and Python
'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles

hakcenter

Quote from: Rx7man on March 10, 2016, 12:50:48 AM
Well, doing some more work on program flow.. I'm changing it so it doesn't read all the inputs at once (since it takes a while to read 10 analog inputs and do the smoothing math).  Instead of calling "read inputs" before the "calculate position" function, it continually reads 1 input at a time, then checks the timers to see if they've elapsed.  I plan on doing something similar for the serial writes as well so it pretty much means the serial port will update at 'live' speed, yet not interfere with program flow and timing since I don't have to send a ton of information through it at once.

sounds familiar... where did I see this before :)
TS2009 Deḇarim 8:2
"And you shall remember that יהוה your Elohim led you all the way these forty years in the wilderness, to humble you, prove you, to know what is in your heart, whether you guard His commands or not.

Rx7man

#145
I think you saw it in your programming thread :P

I just figure if I do the time consuming things incrementally I can maximize CPU usage without bogging down any time sensitive stuff.  The serial display portion of it is going to be harder to do since I'm going to have to store a whack of global variables or something and keeping track of them will be tedious.. Probably going to use an array and a #define for each function return value.

I did find a peculiar thing about switch statements.. seems as though you can't define a variable within a Case branch.. Before, I was reading the raw ADC value into an integer, then doing the math on it, which made for readable code.. Now I have to put the analogRead in the middle of my math, sometimes more than once to work around it.. just a PITA
'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles

Rx7man

Well, I've been playing with this a little more.. I got Arduino programming environment working on the Pi.. I have a lot more setup to do on it.
My new X300 expansion board came in to replace the one that was fried, seller fed-ex'd it to me and didn't require the old one back, very pleased with them and will deal with them again for sure.  I did a bit of troubleshooting on the old board.. first by plugging it's 8-20V source into a powerful 4A 12V supply, which promptly blew up the dc-dc convertor chip.. I desoldered it, and things *kinda* work again.. it boots up, but creates a lot of heat from a small inducer on the bottom side of the board..  Once I get the software properly set up for the new board (so that ALL components work), I'll plug the old one back in and see if any component is messing up, which might give me some clues on where a problem lies. 

On the Pi, I'm getting the hang of working in linux again.. after 15 years away from it, it takes a little bit to get used to, and a lot has changed since then.. Thankfully some has stayed the same.. I managed to get windows file sharing going (samba), as well as vnc (essentially Remote desktop).  I have yet to start playing with any programming..
'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles

Rx7man

Added a drive pressure compensation on the program now.. It's set so that it will start to open up if drive pressure exceeds boost pressure by a given amount.. I have it set at 15psi now.. still need to do tuning on it as it affects other parameters, but should help with spoolup.. preventing "engine braking" while trying to accelerate.
'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles

me78569

Do you currently have DP issues or are you just writing that Boost + 15psi as a safeguard?
2000 Dodge 2500 quad-cab 5.9 Cummins slt, homebuilt 47re revmax 3.5 messed with vb, Quad adr iquad, 4" tbe , pureflow 150 gph. he351ve in the works 100hp DFI inj

Rx7man

I'm hoping to make tuning easier in the long run if I can set an abnormally small nozzle size and let that compensator limit drive pressure.. It'll remain to be seen how well that works.  At cruise, etc you should be reasonably close to a 1:1 pressure anyhow so it shouldn't be active except for when you tromp on it
'94 dually,  67/67 HE351VE, NV5600, ~600hp
'93 ECLB 47RH, new toy truck, H pump project, 1000hp goal, 300K miles
93 XCLB auto, bone stock, 350K miles
93 XCLB 5spd, bone stock, 100K miles