Power control of the EMS system

From DIY contraptions to sophisticated FreeEMS-specific designs! Plus general hardware development!
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Power control of the EMS system

Post by Fred »

ababkin wrote:a) MCU controlled: the intentional delay for various reasons before power is shut to the MCU and/or other devices
This is the one we are looking to achieve.
b) MCU uncontrolled: a protective circuit that will ensure there is power available for the MCU to react and prepare itself for the inevitable 'coming power-down'.
IMO this is a vehicle maintenance issue. If this is happening to you and you are getting a reset on each starting event then GET A NEW BATTERY!! :-) Seriously though, any battery that isn't well past its best and IS appropriately speced for the engine, compression ratio, and starter combo won't have a problem maintaining around 6 - 7V for the ECU to work from. This is a reasonable requirement to impose upon vehicle owners. If you have 5v available, injectors will be dozy and slow to respond, coils will take years to charge and fuel pumps will not be flowing well or at all.
The latter is basically a brownout detection circuit with a largish cap that allows MCU to run for several milliseconds longer to save stuff and shut everything down properly.
These circuits are tricky to implement properly.
I've seen some discussions on these circuits on forums discussing flash file systems on embedded devices (like EFSL).
Links please?
- Not sure what power supply freeems is using (pardon ignorance, linear?), but i've discovered that a buck supplies like ones based on lm2678 (5A) or lesser current ones don't require much components, and give over 90% efficiency (free sample chips).
It needs 8V to operate. That's too high for cranking on many vehicles unfortunately. A good LDO reg can work down to about 6V and with some inline protection an external input of 7V.
- I would use one or two of those cute through-hole solder-in mini-fuses (look like 1/2W resistors) to protect the board. Easy to unsolder/resolder a new one and doesn't take up much space.
Good thought :-) Fusible links. beats the board frying, but then again, the board idea is free AND the wiring SHOULD be fused at the source anyway!

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
ababkin
LQFP112 - Up with the play
Posts: 215
Joined: Tue Jan 15, 2008 5:14 pm

Re: Power control of the EMS system

Post by ababkin »

Fred wrote: Links please?
no schematics, but general idea is discussed here. Didn't strike me as being tricky, in theory, but then again, i never implemented it.
http://sourceforge.net/forum/forum.php? ... 4&abmode=1
Legal disclaimer for all my posts: I'm not responsible for anything, you are responsible for everything. This is an open and free world with no strings attached.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Power control of the EMS system

Post by Fred »

That's because there was nothing in your link about properly handling of filling the capacitor at on time after an outage and then hard connecting it etc. A lot of complexity that isn't required. Worst case is you lose some logged data of some sort such as AFR differences from target or off duration etc. No big deal for those that are too stally to use a good battery. And a non-issue for the rest of us.

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
ababkin
LQFP112 - Up with the play
Posts: 215
Joined: Tue Jan 15, 2008 5:14 pm

Re: Power control of the EMS system

Post by ababkin »

Fred wrote:That's because there was nothing in your link about properly handling of filling the capacitor at on time after an outage and then hard connecting it etc. A lot of complexity that isn't required. Worst case is you lose some logged data of some sort such as AFR differences from target or off duration etc. No big deal for those that are too stally to use a good battery. And a non-issue for the rest of us.

Fred.
Worst case is you corrupt the filesystem (relevant to the EFSL of course). Of course you can datalog in raw flash, but then you won't be able to just stick flashcard into a PC and copy a file with regular OS. (not needed of course but convenient)
All this is of course useless if there is a constant power available, just discussing options here.

Don't have details now, but read posts by people who claimed to implement this with few components (like resistor and diode) in addition to biggish cap in the production devices with great results.

Alex
Legal disclaimer for all my posts: I'm not responsible for anything, you are responsible for everything. This is an open and free world with no strings attached.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Power control of the EMS system

Post by Fred »

Who's datalogging, this thread is specifically about power control of the EMS, not accessories that attach to it which will implement their own schemes. Furthermore, we established that people with worn out half arse batteries are out of luck and that the rest of us will do just fine on the constant feed that we are planning.

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
davebmw
LQFP144 - On Top Of The Game
Posts: 331
Joined: Sun Jul 13, 2008 2:58 pm
Location: South Wales, UK

Re: Power control of the EMS system

Post by davebmw »

Although i suggested a battery backup in my prospective PCB layout to store adaptive data, the constant feed to retain settings is a much more convenient idea.
Today for me was just a case.
Last week a filled up at an esso station out of desperation more than anything and they only had premium shite unleaded petrol, this has cause my standard ECU to retard the ignition tables to compensate for knock caused by the lower octane levels.
After filling with shell super at 98+ RON i pulled the ECU fuse and reset the settings to factory.
This took 6 actions: open bonnet, open fusebox cover, pull fuse, re-insert fuse, close cover, close bonnet.
It required no tools and did the job, battery backup would have been much more of a pain in the butt!
Plus batteries die with age, with the extremes that you expect of automotive components to withstand, big caps more so.
Lets stick with the constant 12V supply idea its much easier.
If we get to the point sometime in the future where we seriously need to wait ten minutes for the software to shut down because its storing the last known trajectory of Haleys comet or figuring out the meaning of life the universe and everything then we should take that into account.
At the moment this is delaying getting a working PCB into circulation for all of us to be feeding back some serious debug and operational data to the software guys to factor in or out.

Rant, diminishing..............ahhh! ;)
93'BMW 325is M50B25TU, Rebuilt 06/06, JE10.5:1, polish&port. Scorpion BB, K&N CAI, TEJ21 WBO2, '07 M3 Evo 18" 225F, 255R, EBC Kevlar, Bilstien Sprint, Polyflex. Head rebuild Oct'08, OEM+FSE FPR, MS2v3.0_DJB Custom, Extra 2.0.1
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Power control of the EMS system

Post by Fred »

Why do you care if it takes an hour to burn that info? You get out, walk away and it powers down when it's done.

A full 512k of flash is only a minute or two anyway...

Knock control almost certainly wont persist for that long. It'll use the "keep pushing the timing up" algorithm so as soon as you put good fuel back in you'll be ok again.

I agree though, lets make some decisions in a KISS but functional way and get this show on the road. No, wait, take your time, me and Sean have some work to do! :-)

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
ababkin
LQFP112 - Up with the play
Posts: 215
Joined: Tue Jan 15, 2008 5:14 pm

Re: Power control of the EMS system

Post by ababkin »

Fred wrote:Who's datalogging, this thread is specifically about power control of the EMS, not accessories that attach to it which will implement their own schemes. Furthermore, we established that people with worn out half arse batteries are out of luck and that the rest of us will do just fine on the constant feed that we are planning.

Fred.
apologies for taking the thread astray then

Alex
Legal disclaimer for all my posts: I'm not responsible for anything, you are responsible for everything. This is an open and free world with no strings attached.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: PCB layout

Post by Fred »

OK, there are 6 power consumers on the TA board :
  1. SIPEX SP232AEN - always on, uses 10mA typical, 15mA max, no disable/sleep pin/state.
  2. LED @ 2v with 1k and 5v gives 3 = 1000 * I, I = 0.003 A = 3mA
  3. CPU = unknown draw during sleep/low power state, will research later/tomorrow
  4. 1 x A82C250 CAN chip that we can permanently tie to sleep = 0.1 - 0.17 mA typ - max
  5. 1 x A82C250 CAN chip that draws up to around 20mA just sitting there, but has a pin available to put it into standby that we could wire up fairly easily.
  6. RS485 chip= < 1mA
We can get rid of the LED
We can put the spare CAN chip into stand by mode
The RS485 draw doesn't matter

We are looking at a worst case of 35mA + CPU draw.

If we drew an Amp our battery would last about 2 days. If we drew 100mA it would last about 20 days, so we are probably looking at worst case of 40 days ball park figure, probably better.

How does that sound to everyone? Typically if you leave a lead acid battery alone for a month+ it has started to deteriorate anyway, so I don't think such draw is unreasonable really. That's assuming a 48AH battery.

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
jharvey
1N4001 - Signed up
Posts: 1607
Joined: Tue Jun 10, 2008 5:17 pm

Re: Power control of the EMS system

Post by jharvey »

Sounds like the CPU constant on current draw is minimal and generally not a problem.

With our winters up here, I might think about putting the constant 12 on it's own separate little battery. Perhaps a small gell cell. So lets say we vacation for a week, and burn 10 days with out starting it. We then have a half dead battery, so starting goes a bit slower then normal, winter cold makes it worse, ect. This should be an easy to implement feature, because we have constant 12 on it's own line. I mention it because that setup would use a smaller battery then if connected to the main battery, and shorten the constant on time. So if we can keep the power requirements to a min, that helps keep this potential separate battery smaller. Just a thought.

Hmmm, perhaps a feature that would be handy (maybe better for 2.0) would be some hysteresis in the regulator circuits. I'm picturing someone kills the battery completely, and starts charging it. As the battery charges there is a time when the power is less then stable. There might be a chance the CPU comes up slowly, starting with corrupted code. Then of course we don't shutdown or reboot. So perhaps you could have corrupted code after charged.

I should check but perhaps this is taken care of already. I know many chips have brown out protection, I'm not sure if this one does or not.

So I'd say the constant on CPU is a good to go. I also suspect you're slightly wrong in your math about how long it will last. I think it would last longer. Don't forget the A/hr rating of a battery is for 1 hour, but typically tested on a 10 hr cycle then scaled to 1 hr. If you draw on it for 2 days, a 150 A/hr battery will be more like 200 A/hr.

http://en.wikipedia.org/wiki/Peukert's_law
Post Reply