Mantis Bug Tracker

View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000180FirmwareInit & Configpublic2011-06-18 16:372013-04-30 23:40
Assigned ToFred 
PlatformOSOS Version
Product Version0.2.0-SNAPSHOT 
Target Version0.2.0Fixed in Version0.2.0 
Summary0000180: Move ALL inline config to flash config
DescriptionWithout this, it's a recompile to change things. I've been lazy at times and put things in the code or with hash defines inline with the code. All that needs to be ripped out and moved to proper config so it can be tracked appropriately.

The biggest hardest part of this is the injector/ignition schedule stuff. See 0000122 for more info.
TagsNo tags attached.
Issue TypeTask
Risk of Breakagelow
Attached Fileszip file icon [^] (148,861 bytes) 2012-08-11 00:47

- Relationships
parent of 0000122closedFred Move injector/coil config to flash config 
parent of 0000526closedToxicGumbo Move most hardware setup configuration from init.c to fixedconfig* .h/.c 
parent of 0000539closedsim Add Sensor OverRide And Algorithm Options To Config 

-  Notes
User avatar (0000348)
Fred (administrator)
2011-09-28 22:45

Moved time tolerance for RPM input events to flash config.
User avatar (0001069)
Fred (administrator)
2011-12-22 10:13
edited on: 2011-12-22 10:13

I searched for instances of #define in code and found very little, except the fuelAndIgn stuff from 0000122.

The biggest offender other than 0000122 is probably init.c which should pull its config from flash and not use literals.

I've not searched for magic numbers, yet, but I'm sure there are some.

I might tackle init.c later today, as that should be fairly straight forward and offer some value by externalising various settings. Care will need to be taken to override some of the values from the config to ensure correct operation of such things as serial channels and injectors/coils/rpm inputs, etc.

User avatar (0001499)
spudmn (reporter)
2012-04-24 04:26

The tolerance is too tight when trying to crank on a flat battery and a 8-1 trigger.

unsigned long tolerance = (smaller * TOLERANCE_LEVEL) / 4096; // TODO un hard code this. currently 25% tolerance
// div by 4k = fairly high minimum RPM for low teeth wheels
User avatar (0001500)
Fred (administrator)
2012-04-24 10:25

Thanks, key point there, unhardcode that value, not so much about what the figure is :-)
User avatar (0001795)
Fred (administrator)
2012-08-01 01:06

Fixed in 749037f with addition of missing tooth tolerance to config. Please apply to your truck, edit the hex values up and down a bit and observe starting performance. This should take effect in real time and not require a reboot.
User avatar (0001835)
pjohns30 (reporter)
2012-08-10 03:04

I loaded the firmware off the dev branch onto my truck, and it didn't want to start and wouldn't idle. Then I remembered that I have it setup for TCTL4 = 0x01;, because it starts and runs better that way. So I changed it to 0x01, reloaded it, and then it wouldn't start. When I went back to the old firmware it started right up.

Also I'm not sure where the hex values are that I need to change. I looked around in emstudio for a bit, but I don't have any idea what I'm looking for.
User avatar (0001836)
Fred (administrator)
2012-08-10 16:58

Can you please provide an emstudio log of it not starting right up on the newest dev code? Which hash did you try? Did you remember the custom build? What value of tolerance did you previously use for your truck? And which hash? Emstudio log of that starting too maybe?

#define decoderSettingsLocationID 0xC026

It's 6 bytes long, the last 2 are the tolerance, default is 2048/4096 = 50%, edit up and down to suit.
User avatar (0001843)
pjohns30 (reporter)
2012-08-11 00:52

The current dev d9a4aa5073.

Did you remember the custom build? :-/ I'm not sure what you mean.

What value of tolerance did you previously use for your truck? The default missing tooth tolerance.

And which hash? I don't know.
User avatar (0001850)
Fred (administrator)
2012-08-11 11:15

Re custom build, i mean CLIFLAGS=... build, not just make s19. I didn't mean to patronise you, just checking.

I'm going to hack OLV next to a swimming pool in a garden and analyse your logs. Will post again in an hour or two.
User avatar (0001851)
Fred (administrator)
2012-08-11 13:21

5 bucks says you forgot to remove the if statements with your init change.

Recommended solution, IF I'm right: use git and rebase your hacks so you can't forget important and/or subtle bits.

If I'm wrong (super unlikely) we'll have a chat on skype later and work it out :-)
User avatar (0001868)
pjohns30 (reporter)
2012-08-12 03:16

It's working fine now. I adjusted the values from 08 00 to 06 00, and it seemed to do better, but the engine wasn't warmed up so starting for a second time might have also helped. The red light on my TA card is staying on all the time still/also.
User avatar (0001869)
Fred (administrator)
2012-08-12 09:31

Anywhere in the 0x400 to 0x800 range can/should work OK. You and others reported that 0x400 was crappy and engines started much better on 0x800.

1024 0x400 25%
2048 0x800 50%

Less than 25% and more than 50% mean that legit events can get caught as noise and noise events can get caught as legit.

I guess if your issues are only when cold it'll be hard to find a limit. In truth, as long as you're over the limit with your value, it's fine (so don't bother). Hopefully that makes some sense.
User avatar (0002629)
administrator (administrator)
2013-04-12 01:14

Missed one in realtimeISRs.c for the fuel pump prime period. Hard coded to 4 seconds right now.
User avatar (0002636)
Fred (administrator)
2013-04-30 23:40

Fix for fuel pump prime time in d64c3bc

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker