Sunday, October 6, 2013

v0.1.3 of source code posted

Today I posted V0.1.3 of the source code.   Over the summer I have been fine tuning the controller, looking at the PID for managing of watts and more specifically how it handles temperature limits, added a couple of new operating modes and a true load-dump trap.  Changes include:

  • Corrected bugs in LOCKOUT mode.
  • PID tuning for Amps and Temperature PID engines.
  • Two new modes:  Quiet Generating, and Prime Oil Pressure
  • Load Dump trap (based on rate of change of Voltage vs. time)
  • Self-learning wattage caps when over temperature situations are detected
  • new #define TESTING that allows for limited bench-testing w/o generator
You can see the new source code via the SOURCE link above. I also posted v0.0.2 of the integrated remote source code which is needed in order to select Quiet Generation mode from the remote.  You can still use v0.0.1 of the remote code (or even the original non-Arduino based LCD remote design), you just will not be able to place the generator into Quiet Mode.

Perhaps the  biggest change is on how over temperature limits are handled.   In addition to doing some tuning of the PID engine (mostly around EGT limits), I also added in code that will learn from over temperature conditions and reduce the maximum load placed on the engine.  This is to prevent the over temperature situations from happening again.  It also removes an interaction between the Watts PID and the Temperature PID.   (I 1st noticed this happening when EGT limits were exceeded.  The EGT PID would pull things back till the engine cooled at which time the Watts PID would say - OK, lets Go Hard Again!!).   Watts Pullback is enabled for all three of the temperature limits (EGT, Engine, and Alt), but the EGT is the temperate most likely to walk the the line,.  This is to be expected as a key goal of this project was to minimize total run time by maximizing the load on the engine at all times. So, I added code to pull-back the target watts whenever a temperature limit is reached.   And this pullback is self learning, resetting itself each time the generator is restarted.

Quiet Mode is a new mode that simply limits the engine RPMs to a defined maximum (with the appropriate reduction in watts to match the lower engine power output).  Allowing 'quieter / gentler' running - suitable for those times when running Full Out is not appropriate.   With the new remote LCD code, Quiet mode is selected by pressing AND HOLDING the Run-Gen switch for 3 or more seconds.  And you can toggle in / out of Quiet Mode by simply pressing the Run-Gen switch to get back to Full Power;  pressing and holding it to get back into Quiet mode.


Prime Oil Pressure will enable the starter but NOT the fuel.   It will turn the starter while monitoring the Oil Pressure gauge waiting for the Oil pressure to come up.  (Starter is spun in the same pattern as during regular starting - currently defined as a max of 5 seconds, the a 4 seconds rest period.  repeated a up to 4 times - See source code to change these values).   It can be used to 'prime up' the engine oil system after changing oil.   Currently the only way to select this mode is via an attached debug terminal.

I added in code to specifically look for a load-dump condition.  While debugging the stand-alone voltage regulator I found the PID engine alone was not sufficiently quick to rein in large alternators (ala the 270A monster I have on our mains vs. the 135A one of the generator) where there was a massive reduction in load on the overall system.  For example, when the heating element on the dryer cycled off and the battery was almost fully charged (and hence the battery voltage was at its target) I could see a voltage overshoot approaching 450mV (almost 1/2 a volt).  I added in code to not only more aggressively reduce the PWM if a voltage overshoot condition occurs, but more importantly try to prevent it in the 1st place by looking at the rate of change of voltage over time (dV/dT).  Using both these approaches I am able to contain load-dump overvoltages to 35mV above target.  


And finally I placed in a #define TESTING switch.  Enabling this will dummy-up key sensing (ala battery voltage,  alt amps, EGT, etc..) to allow for a level of bench-testing of the code on a stand-alone Arduino development board.   It is some of the early mock-up code I had in there before I had real hardware, and I find it useful when doing things like adding new modes of operation (ala Quiet mode) to be able to 'test' things out before trying it out on real hardware.   But DANGER:  MAKE SURE #TESTING IS NEVER DOWNLOADED TO A REAL GENERATOR, as all the sensors are dummied up, and hence you run the massive risk of really doing bad things!!


OK, so, some small improvements.   We now have 100's hours on the system now, in generate mode as well as watermaker/generate mode.   And I am still very happy with how it is working!



No comments:

Post a Comment