Main Menu

My life, My coding

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

Rx7man

Quote from: me78569 on March 31, 2017, 10:21:06 PM
I think I am only updating like 6 positions on my screen now.  I set titles in the setup section of the code. 

Been a very long time since I have looked but I do remember taking my screen update time from ~80 ms to 24ms after that update.
Is yours a 2 or 4 line screen?  I'm displaying 7 parameters right now..
I'm still waiting on my mini CAN controllers, I'm thinking I'm going to have the current Mega/Lilbb just do IO duty and transfer it over CAN, and perhaps use my DUE that ought to be here soon too do the processing... It may have some barebones backup code to keep you driving should CAN comms get lost (redundancy is good)
'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

4 line updating turbo speed /100 boost drive and position in cm^2
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've got MAP, EGP,  TPS, RPM, turbo speed, command position, actual position, temp..
I might at some point have a couple different display modes so I can view other things.. perhaps some switch positions.. When i get it hooked up, 4 channel pyro, perhaps vehicle speed..
'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

I found my big problem, I2C data rate was too slow, It didn't want to work at 1mhz, but at 800khz it works, and the update time went from 78ms to 22ms
Just add..

Wire.setClock(800000);

big improvement, highly recommended.
'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

Also, EVERYONE concerned with speed should be using Bill Perry's library.. MUCH MUCH faster than any other with some cool features, though it's a little confusing to get started with.. it autodetects a lot of things.

https://github.com/duinoWitchery/hd44780

So after setting the baud rate to 800khz, and using that library, it's now at a steady 13.12ms for a full refresh.. I can live with that...
'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

Interesting, why no 1meg ?
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

Quote from: hakcenter on April 15, 2017, 07:42:32 AM
Interesting, why no 1meg ?
wouldn't work at 1mhz.. 800K worked, 801 and higher didn't, so I guess it's staying there
'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

Now I'm working on accelerometer, compass, gyro, clock, and barometer.... trying to get all the libraries to play nice with each other and not have too much overlap between them
'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

bperrybap

Quote from: Rx7man on April 15, 2017, 08:40:25 AM
Quote from: hakcenter on April 15, 2017, 07:42:32 AM
Interesting, why no 1meg ?
wouldn't work at 1mhz.. 800K worked, 801 and higher didn't, so I guess it's staying there
Technically according to the datasheets I've seen, the part is only spec'd to run up to 100khz.
However they do seem to run much faster.
In order to run fast, the pullups will need to be quite strong and the wires will need to be kept fairly short. If attempting to run this fast you should make sure your pullups are fairly small but don't go below 1k. (1k is the lowest allowed by the i2c spec)
Also keep in mind that at high clock speeds like this since it is beyond the parts maximum ratings, it may be more subject to electrical noise especially in high noise environment such as a vehicle. And the issues you may run into will likely vary according to temperature.

I'd be curious if when you got the failures at 1meg if hd44780 was reporting an error on the API function or whether the system locked up.
I've experienced some issues where the system will lockup if a slave improperly handles the ending status right at the end of the i2c transfer. My conclusion was that this is a h/w issue in the AVR two wire implementation around multi-master suport. It appears that that it could be worked around in the Wire library. My concern would be that running at these high speeds that you might end up in the same situation if there were a signal glitch that occurred at just the right time.

--- bill

Rx7man

Quote from: bperrybap on April 26, 2017, 10:04:55 AM
Quote from: Rx7man on April 15, 2017, 08:40:25 AM
Quote from: hakcenter on April 15, 2017, 07:42:32 AM
Interesting, why no 1meg ?
wouldn't work at 1mhz.. 800K worked, 801 and higher didn't, so I guess it's staying there
Technically according to the datasheets I've seen, the part is only spec'd to run up to 100khz.
However they do seem to run much faster.
In order to run fast, the pullups will need to be quite strong and the wires will need to be kept fairly short. If attempting to run this fast you should make sure your pullups are fairly small but don't go below 1k. (1k is the lowest allowed by the i2c spec)
Also keep in mind that at high clock speeds like this since it is beyond the parts maximum ratings, it may be more subject to electrical noise especially in high noise environment such as a vehicle. And the issues you may run into will likely vary according to temperature.

I'd be curious if when you got the failures at 1meg if hd44780 was reporting an error on the API function or whether the system locked up.
I've experienced some issues where the system will lockup if a slave improperly handles the ending status right at the end of the i2c transfer. My conclusion was that this is a h/w issue in the AVR two wire implementation around multi-master suport. It appears that that it could be worked around in the Wire library. My concern would be that running at these high speeds that you might end up in the same situation if there were a signal glitch that occurred at just the right time.

--- bill
I"m running it at 400 now just to give me a bit of room, the better library helped a lot!  Most other devices seem happy around 400 as well and by the end of this I'm going to have a number of devices on I2C, though I think I will experiment with using a separate processor for interfacing a lot of these non critical sensors and transferring the data over CAN

Welcome to this little playground :)
'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

I suppose I should update this once again.. I'm working on a little fuel injection controller for farm engines that I'm trying to make as versatile as I can.. and ONE of the requirements I'm looking from it is the ability to control the H1000 pump, which I might be getting and installing on my truck... dang, 1100hp of fuel, 325bar injection pressure, better ramp rates, adjustable timing, and essentially no limit to RPM.. sounds like fun.

Anyhow, I gotta go bale hay.
'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

I love the Idea of the h pump,  hard to find, but VERY cool. 

you could make a very nicely running engine with one of those bad boys.   What I have learned in the vp44 tuning world shows signicant improvement in MPG, smoke, and power without having to limit to a given speed rpm or power.
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

If I manage to cough up the money for the pump and get it installed, I'll let you know how it goes!... takes a considerable amount of power to run them (battery and crank power).. 12A for the rack solenoid and 6A for the timing.
Currently working on the controller for the fellow who has the pumps, his is in a Ford where a lot of info is on the CAN bus (It has MAF, MAP, etc all on the CAN bus), so it'll be a simpler unit than one found on a standard application.. there will be some trickery to get it to all work together though.. I'll still have to interface to a 60-2 crank trigger and put a piezo sensor on the #1 injection line so I can get a feedback on actual timing position.. Rack position has a 0-5V feedback reference so that's easy.

The programming side of it is certainly going to be a learning curve for me.. and a bit of a steep one, though a lot of the stuff will be applicable to my next pet project of a small injection controller
'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

Well if you need help with a starting point for where the vp44 trucks like to run I am more than willing to share what I know. 

Some of it will be apples to oranges, but it may help you some lol..... I've made a lot of mistakes... I mean I have learned lots.
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

haha, yeah,.. I have as well.  The fellow who has it on his truck seems to have a pretty good idea of what he wants.. pin time it to 10* which will make for a very tame engine at low revs, and bring in some timing as revs come up.. This pump has a MUCH faster injection cycle than a P7100, so you don't need as much total timing.. With the much higher injection pressure you can use a smaller nozzle and get a cleaner burn as well
You on facebook?
'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