Another Engine Control and Regulator project - DC Alternator

Started by thomasonw, October 29, 2012, 01:10:35 PM

Previous topic - Next topic

thomasonw

Hello, thank you for the thoughts and input.  In reading the past three email I might offer:

In terms or reliability, failures often can be categorized in two broad groups:  Component failure (often to stressed design points, or miss-use in application and/or instillation) and design / coding failures.  On Viking Star I look for failure modes and how to work around them.  Often a spare is needed for a function, and when practical I carry a different design in case the issue is systemic in nature (e.g., our two inverters are purposely different designs).  In the case of failure for this DC generator controller the fall back would be the manual start/stop switches already in place, with the reintroduction of a simple regulator.  (Or, use the backup Honda generator we carry).  And when looking at automation, there is a valid reason for dividing and concerning, however being too granular also introduces their own issues ala integration - as I am sure you live through in your project Lloyd.  Plus, with additional components the probability of hardware failures increase, and by not having a tightly coupled system (specifically the Regulator and throttle control) a level of system wide efficiency can not be achieved.

But your point is well taken, with any automation system one needs to consider the failure modes and their plans:  Use a different system?  Fall back to manual / limp mode?  Have a spare of the same design on hand?  Each approach has its advantage and deterrent.  And I again, on our boat we carry a wide array of approaches for each and every major system failure. (ala two different inverters, but two of the same starters for the main motor  ;) )

On expandability, that is already covered.  There is an Expansion Header in place that brings out the I2C and One-Wire bus, +5v and Ground, and the unused Amtel pins - about 4 of them.   Plus the stand offs are positioned to support a daughter card. (And anyone is welcome to the KiCad files to get the locations exactly right-on)  I have in mind being able to add on a daughter card if needed for other functions.  (and am already working with someone around a potential WaterMaker automation add-on, not just clutch control, but pressure regulation as well).  Also the Cat-5 cable that runs between the controller and the LCD uses a buffered I2C that can be tapped into for more distance functions.  As well as carruing a limited +battery voltage for power.    One could expand either directly controlled by  the controller or enabling some master/slave mode to a separate controller  (CAN buss would have been fun to implement. . ) .

And this is how I would likely approach doing a load dump function.  Use the I2C bus to drive an expander (perhaps a PWM expander would be even better).  Given the potential for surges, I think it might be best to locate that on the buffered I2C bus (CAT-5 line) and maybe even opto-isolate it in the resistive load-dump ckt.  I think it would not be difficult to modify the source to accommodate this - as the watts delivered via the alternator are reduced, increase the load dump PWM to match the overall load to the engine capability.  Of course, in that case the adaptive throttle control would keep the RPMs high (while currently in lower load situations, the throttle control will slow down the engine). 

thomasonw

Yahoo!

Yesterday I placed the needed senders around the generator and boat, and today I hooked up the controller to give her a try.   Here is a raw video:

   http://youtu.be/fdajf2C2fuw

I did not talk much during the middle as I figure no one would be able to hear anything anyway, but this is basicly what you are watching:


  • Pre-start 'bump'.  This is unique to my setup as I found some times the water pump sticks, bumping it frees it up.
  • Throttle moves to 'idle' position
  • Engine is started.
  • Engine ramps up speed
  • Alternator load is applied (Video does not show this well, sorry).
  • Stop is requested, load is removed and throttle starts to slow-down.
  • About 1/2 way through the cool-down I request a Stop-Now, and engine is immediately stopped.

Most things worked well, I need to look at the RPM sensing a but more - see if the ckt can be improved, plus I need some software enchantments.  For example I kept faulting out while at idle before the alternator was started - the ckt was triggering on noise and measuring 7,000+ RPMs.  Just need to add a trap to not measure RPMs unless the field drive is active.

Also found another Phantom Power path, back in via the low-drive for the starter relay.

Over the next few days I am going to tighten up the RPM ckt / program, work on smoothing out the throttle bumps (they seem a but course right now), and other timing variables / configurations. 

But it mostly worked!

(Note, I could not get the embedded You-tube to work - keeps saying Invalid Link)

BruceM

Congratulations on your first live run William!  You're on the home stretch now. 

Your board expansion design is great, and should cover any feature creep that someone else might want.

Good luck on your continued check out and refinement.

Best Wishes,
Bruce



thomasonw

Day two brought another overcast day and no rain.  Just right for setting up 'Shop' out back and being able to read the laptops screen!

Instability with RPMs measurements has been resolved, simplified input to 1K resister and a 0.1uF cap to ground forming a RC low-pass filter (along with the current clipping diodes).  This eliminated the 'noise' induced wild RPMs that were measured at one time as things ramp up, and by eliminating the voltage divider RPMs could be sampled at a much lower field drive point.

In these last runs I noticed a level of hunting in the PWM adjustment, and more so in the throttle control.  Need to look more to see if this was impacted by the verbose amount of data being spit out to the debug screen and thereby impacting the main loop throughput, or if I need to add additional criteria into the offset algorithms (ala look back and rate of change parameters) to go beyond the current point-in-time offset calculation.

Rain is forecasted for the next few days, so will likely not be able to make any more trial runs for a while...  Maybe will just go ahead an enhance the offset algorithms while I am sitting waiting for the skys to clear...



thomasonw

Last night I found a bug in the code that sometimes would  prevent updating of measured watts. Given that the throttle control is based off of measured watts it is easy to see how things went downhill yesterday. 

And even better:  This morning I was able to sneak in 3 runs before the rain hit.   And it works well!  No more hunting of the throttle.  Also refined my warm-up and cool-down stepping timing /  configuration values (this will need to be futzed with for each motor/throttle control setup..)

So, it looks like the major problems are resolved!   Well, at lease on these three very short runs.  But each run did go through:

  • Start engine, and slowly ramp up speed w/o load (warmup cycle)
  • Ramping up of Alternator load
  • Movement into Bulk / Acceptance Phase
  • Active management of throttle to match engine load
  • Stopping with slow-down during cool-down cycle, then engine stop.


These were very short runs as the batteries are fully charged, but was able to step through several engine / alternator phases and see the systems work well.

Later today I will look over the debug data and see if anything new pops out.  Then I will post an update to the source code on the blog.

Rain is predicted for a few days.  Once that clears up I will be able to make some longer runs and go from there.   

-al-

thomasonw

#80
Today I completed a 30 minute run of the DC generator with the controller in fully automated mode.  Before starting I pulled the house batteries down about 150Ah, to give the generator something to do.  Here is the resulting debug data graph:



Two things to notice:

  • Notice how flat the Watts line is during Bulk phase?
  • Likewise, notice how the Amps line drops during the Bulk Phase?

This is the result of the key goal for the project - maintaining a constant load on the driving engine.  As the battery voltage increases we need to lower the Amps delivered in order to maintain a constant Watts load delivered (and pulled from the Kubota engine)

One can also see the engine RPMs being managed - as the battery approached full charge, the amps dropped off quickly and the resulting load on the engine was reduce.  So we slowed the engine down.

Of concern to me is the large amount of hunting in the Field Drive during the Acceptance Phase.  I will be working on the algorithms to smooth this out.  Until then I posted version 0.0.6 of the source to the blog.

BruceM

Sweet project, William.  I'm sure you'll get the field drive algorithm sorted soon. 

What debug package gives you those great plots?


thomasonw

Quote from: BruceM on February 13, 2013, 11:16:23 PM
Sweet project, William.  I'm sure you'll get the field drive algorithm sorted soon. 

What debug package gives you those great plots?



I have a DEBUG switch  in the source (#define DEBUG)  When DEBUG is defined (enabled) the firmware will send a wide range of information to an attached serial terminal (same port used to upload firmware, via the USB port).  To get this graph I copied the 2,000 or so lines of status that was sent to the counsel, placed them into excel.  Then made a graph from the Volts, Amps, etc. data.  Adding words and notes via Paintbrush completed the job.


Here is an example of the raw data - 1st boot up is shown:

8   28   Verion   0.0.6   -   Free   RAM   =   1311                                                                                                
Start/stop:   G/g   Gen;   W/w   WaterM;   A/a   AutoGen   mode                                                                                                   
n   -   Next   Screen;   s   -   Stop   All,   S   -   Stop   NOW                                                                                       
                                                                                                                        
   READY!!!                                                                                                                     
                                                                                                                        
15191   A/E/W-Stat=   1   4   1,   PWM=   0   V=   12.06   A=   0   W=   0   RPM=   0   EGT=   -73   OneWire-E/A/S/Ex/B   0   0   0   0   0   FETs=   1023   Booleans:Oil/Water/AG-flags   1   1   0   :Ve   -160   Ae   240   We   140   Te   0   Ta   0   =   -160
15322   A/E/W-Stat=   1   4   1,   PWM=   0   V=   12.07   A=   0   W=   0   RPM=   0   EGT=   -74   OneWire-E/A/S/Ex/B   0   0   0   0   0   FETs=   1020   Booleans:Oil/Water/AG-flags   1   1   0   :Ve   -160   Ae   240   We   140   Te   0   Ta   0   =   -160
15437   A/E/W-Stat=   1   4   1,   PWM=   0   V=   12.06   A=   0   W=   0   RPM=   0   EGT=   -74   OneWire-E/A/S/Ex/B   0   0   0   0   0   FETs=   1022   Booleans:Oil/Water/AG-flags   1   1   0   :Ve   -160   Ae   240   We   140   Te   0   Ta   0   =   -160
15551   A/E/W-Stat=   1   4   1,   PWM=   0   V=   12.04   A=   0   W=   0   RPM=   0   EGT=   -74   OneWire-E/A/S/Ex/B   0   0   0   0   0   FETs=   1023   Booleans:Oil/Water/AG-flags   1   1   0   :Ve   -160   Ae   240   We   140   Te   0   Ta   0   =   -160
15664   A/E/W-Stat=   1   4   1,   PWM=   0   V=   12.06   A=   0   W=   0   RPM=   0   EGT=   -74   OneWire-E/A/S/Ex/B   0   0   0   0   0   FETs=   1022   Booleans:Oil/Water/AG-flags   1   1   0   :Ve   -160   Ae   240   We   140   Te   0   Ta   0   =   -160
15778   A/E/W-Stat=   1   4   1,   PWM=   0   V=   12.05   A=   0   W=   0   RPM=   0   EGT=   -74   OneWire-E/A/S/Ex/B   0   0   0   0   0   FETs=   1020   Booleans:Oil/Water/AG-flags   1   1   0   :Ve   -160   Ae   240   We   140   Te   0   Ta   0   =   -160
15892   A/E/W-Stat=   1   4   1,   PWM=   0   V=   12.05   A=   0   W=   0   RPM=   0   EGT=   -74   OneWire-E/A/S/Ex/B   0   0   0   0   0   FETs=   1023   Booleans:Oil/Water/AG-flags   1   1   0   :Ve   -160   Ae   240   We   140   Te   0   Ta   0   =   -160
16006   A/E/W-Stat=   1   4   1,   PWM=   0   V=   12.07   A=   0   W=   0   RPM=   0   EGT=   -74   OneWire-E/A/S/Ex/B   0   0   0   0   0   FETs=   1020   Booleans:Oil/Water/AG-flags   1   1   0   :Ve   -160   Ae   240   We   140   Te   0   Ta   0   =   -160


And when running:
1352524   A/E/W-Stat=   12   7   1,   PWM=   102   V=   14.66   A=   69   W=   1011   RPM=   2221   EGT=   -75   OneWire-E/A/S/Ex/B   -99   -99   -99   -99   -99   FETs=   1023   Booleans:Oil/Water/AG-flags   0   0   0      :Ve   0   Ae   102   We   38   Te   0   Ta   0   =   2               
1353661   A/E/W-Stat=   12   7   1,   PWM=   107   V=   14.72   A=   76   W=   1119   RPM=   2206   EGT=   -75   OneWire-E/A/S/Ex/B   -99   -99   -99   -99   -99   FETs=   1023   Booleans:Oil/Water/AG-flags   0   0   0      :Ve   -1   Ae   88   We   28   Te   0   Ta   0   =   -1               
1354758   A/E/W-Stat=   12   7   1,   PWM=   97   V=   14.7   A=   67   W=   984   RPM=   2212   EGT=   -75   OneWire-E/A/S/Ex/B   -99   -99   -99   -99   -99   FETs=   1023   Booleans:Oil/Water/AG-flags   0   0   0      :Ve   -1   Ae   106   We   41   Te   0   Ta   0   =   -1               
1355902   A/E/W-Stat=   12   7   1,   PWM=   108   V=   14.71   A=   76   W=   1117   RPM=   2198   EGT=   -75   OneWire-E/A/S/Ex/B   -99   -99   -99   -99   -99   FETs=   1023   Booleans:Oil/Water/AG-flags   0   0   0      :Ve   -1   Ae   88   We   28   Te   0   Ta   0   =   -1               
1356999   A/E/W-Stat=   12   7   1,   PWM=   98   V=   14.7   A=   70   W=   1029   RPM=   2213   EGT=   -75   OneWire-E/A/S/Ex/B   -99   -99   -99   -99   -99   FETs=   1022   Booleans:Oil/Water/AG-flags   0   0   0      :Ve   -1   Ae   100   We   37   Te   0   Ta   0   =   -1               
1358096   A/E/W-Stat=   12   7   1,   PWM=   106   V=   14.7   A=   74   W=   1088   RPM=   2191   EGT=   -75   OneWire-E/A/S/Ex/B   -99   -99   -99   -99   -99   FETs=   1022   Booleans:Oil/Water/AG-flags   0   0   0      :Ve   -1   Ae   92   We   31   Te   0   Ta   0   =   -1   >>i=   1   ,   2100   <<
1359206   A/E/W-Stat=   12   7   1,   PWM=   96   V=   14.63   A=   67   W=   980   RPM=   2198   EGT=   -74   OneWire-E/A/S/Ex/B   -99   -99   -99   -99   -99   FETs=   1023   Booleans:Oil/Water/AG-flags   0   0   0      :Ve   0   Ae   106   We   42   Te   0   Ta   0   =   2   >>i=   -1   ,   2300   <<
1360308   A/E/W-Stat=   12   7   1,   PWM=   101   V=   14.7   A=   72   W=   1058   RPM=   2184   EGT=   -74   OneWire-E/A/S/Ex/B   -99   -99   -99   -99   -99   FETs=   1022   Booleans:Oil/Water/AG-flags   0   0   0      :Ve   -1   Ae   96   We   34   Te   0   Ta   0   =   -1               
1361402   A/E/W-Stat=   12   7   1,   PWM=   103   V=   14.68   A=   72   W=   1057   RPM=   2198   EGT=   -75   OneWire-E/A/S/Ex/B   -99   -99   -99   -99   -99   FETs=   1023   Booleans:Oil/Water/AG-flags   0   0   0      :Ve   -1   Ae   96   We   34   Te   0   Ta   0   =   -1               
1362516   A/E/W-Stat=   12   7   1,   PWM=   99   V=   14.65   A=   67   W=   981   RPM=   2206   EGT=   -75   OneWire-E/A/S/Ex/B   -99   -99   -99   -99   -99   FETs=   1023   Booleans:Oil/Water/AG-flags   0   0   0      :Ve   0   Ae   106   We   41   Te   0   Ta   0   =   2               
1363612   A/E/W-Stat=   12   7   1,   PWM=   101   V=   14.7   A=   71   W=   1043   RPM=   2176   EGT=   -75   OneWire-E/A/S/Ex/B   -99   -99   -99   -99   -99   FETs=   1023   Booleans:Oil/Water/AG-flags   0   0   0      :Ve   -1   Ae   98   We   35   Te   0   Ta   0   =   -1               
1364704   A/E/W-Stat=   12   7   1,   PWM=   100   V=   14.64   A=   69   W=   1010   RPM=   2198   EGT=   -75   OneWire-E/A/S/Ex/B   -99   -99   -99   -99   -99   FETs=   1023   Booleans:Oil/Water/AG-flags   0   0   0      :Ve   0   Ae   102   We   39   Te   0   Ta   0   =   2               


-al-

thomasonw

#83
OK, with the rain today I have been doing a bit of CAD work - updating the schematics with the changes noted over the controller bringup.

This High Drive vs. Low drive thing still bothered me, seeing as almost the whole world uses High drive (though we still do not know why), but we have a very very compelling reason for using Low Drive (namely to drive 48v fields).  So I have been thinking on how to make a configuraable drive.  One that could be selected either by stuffing options, or perhaps by floating the FETs.  And today I think I came up with something - using Stuffing options:




What makes this workable is that the P and N FETs keep the same 'pins' for D, G,  and S.  And it so happens that  D always connects to the Field, and S always connect to the voltage that the non-driven end of the Field  (the end back on the alternator) is not.

And here is an example of it 'configured' for Low Drive (I did a little moving around in the CAD to make it read easier, but it is the same as the above - I think   ;)  ) 



And here it is configed for High Drive:




Note that the FET driver is not shown, and that it too is configed as a non-inverting driver to an inverting driver depending on a Low or High Drive.  OK, does this look like I got it right?

-al-


BruceM

Hi William,
That seems like a nice high/low side drive solution, and your schematic looks OK to me though I didn't check the N vs P-chMosfet pinouts for compatibility.

The 100 ohm gate drive is  probably OK for your modest load and selected Mosfets.  I'd give the mosfets a finger temperature test to be sure.  If they're a bit warm then I'd reduce to 50 ohms or less. 

Classy job on the plots via excell!

Best Wishes,
Bruce














Lloyd

#85
Quote from: thomasonw on February 14, 2013, 06:27:33 PM
OK, with the rain today I have been doing a bit of CAD work - updating the schematics with the changes noted over the controller bringup.

This High Drive vs. Low drive thing still bothered me, seeing as almost the whole world uses High drive (though we still do not know why), but we have a very very compelling reason for using Low Drive (namely to drive 48v fields).  So I have been thinking on how to make a configuraable drive.  One that could be selected either by stuffing options, or perhaps by floating the FETs.  And today I think I came up with something - using Stuffing options:

-al-


Hi Al,

I'm not an EE, nor software designer.

But most digital control designs I see using low side, use V-/com isolated.

V- bat might lead to noise, caused by other system loads.

Lloyd
JUST REMEMBER..it doesn't matter what came first, as long as you got chickens & eggs.
Semantics is for sitting around the fire drinking stumpblaster, as long as noone is belligerent.
The Devil is in the details, ignore the details, and you create the Devil's playground.

Lloyd

Quote from: Lloyd on February 15, 2013, 12:12:41 AM
Quote from: thomasonw on February 14, 2013, 06:27:33 PM
OK, with the rain today I have been doing a bit of CAD work - updating the schematics with the changes noted over the controller bringup.

This High Drive vs. Low drive thing still bothered me, seeing as almost the whole world uses High drive (though we still do not know why), but we have a very very compelling reason for using Low Drive (namely to drive 48v fields).  So I have been thinking on how to make a configuraable drive.  One that could be selected either by stuffing options, or perhaps by floating the FETs.  And today I think I came up with something - using Stuffing options:

-al-


Hi Al,

I'm not an EE, nor software designer.

But most digital control designs I see using low side, use V-/com isolated.

V- bat might lead to noise, caused by other system loads.

Lloyd

Maybe, you're just leading, not lagging.

Look her at IR http://www.irf.com/product-info/cic/fsgatedriverics.html

Lloyd
JUST REMEMBER..it doesn't matter what came first, as long as you got chickens & eggs.
Semantics is for sitting around the fire drinking stumpblaster, as long as noone is belligerent.
The Devil is in the details, ignore the details, and you create the Devil's playground.

SPSInc

HI. I've enjoyed reading your posts. Very interesting project. How would you do the gate drive on the high side drive? Would you use zener diodes to clamp the gate voltage to an acceptable value? A low side drive is much easier to do as you can reference the gate drive to gnd. When you do a high side you have to reference the gate drive to +Batt voltage. When you drive the gate you have to keep it offset from ground to be within the limits of the devices gate-source voltage. +/-25V for the device you have chosen. If you have a 35V battery rail you can't just drive the gate to gnd. The high side would be fine for 12V system but anything over that will require more components in the gate drive. The low side drive can drive any voltage within the limits of the FET as the gate drive is referenced to gnd.

BruceM

Thanks spsinc, I screwed up, you're absolutely right.   The schematic is only ok for 12V high side drive. 
For the 24 and 48V high side you'd have to add an npn transistor and zener to limit gate to say 15V below the high rail.





thomasonw

Quote from: SPSInc on February 15, 2013, 04:05:11 PM
HI. I've enjoyed reading your posts. Very interesting project. How would you do the gate drive on the high side drive? Would you use zener diodes to clamp the gate voltage to an acceptable value? A low side drive is much easier to do as you can reference the gate drive to gnd. When you do a high side you have to reference the gate drive to +Batt voltage. When you drive the gate you have to keep it offset from ground to be within the limits of the devices gate-source voltage. +/-25V for the device you have chosen. If you have a 35V battery rail you can't just drive the gate to gnd. The high side would be fine for 12V system but anything over that will require more components in the gate drive. The low side drive can drive any voltage within the limits of the FET as the gate drive is referenced to gnd.

Ah, yes - that is a problem. Am using the IXP-602 series of gate drivers, but their high side version does not clip the voltage.

OK, so:  Is still a 'universal' driver, just that the High Side can only be used in a 12v system, not a 24v or greater system.  Was already limited from 36v or greater systems due  to Vcc max on the driver chip. 

And maybe that is OK?  Leave the Hi Drive stuff to us simple 12 guys, and once one gets into the higher voltages go Low!   

I do wonder just how many 24v systems there are - in shore based systems i would think most folks would lean towards 48v once they departed 12v land - not stop at 24v..  So question back:  In trying to make this a bit more universal, how important will it be to keep the High Side drive for 24v and greater systems?  if so, can look into other level shifting drivers - but noted a lot of them depend on a PWM duty cycle to drive their internal charge pumps, and would not work at low field drive levels, nor high field drive levels.

And/or back to the drawing board - see what I can dig up for a true high/low drive driver solution - independent of voltage.

Thank you all again for the help!

And fyi:  yesterday I tried a modified source code run -got rid of the Fuzzies in the Field drive during acceptance phase!

-al-