Another Engine Control and Regulator project - DC Alternator

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

Previous topic - Next topic

thomasonw

Quote from: BruceM on March 18, 2013, 02:51:08 PM
Autopilots  have dampening terms based on velocity, acceleration and jerk.   The error in lets say altitude demands a positive elevator change, but this is dampened by subtracting the velocity in that direction times some scaling factor, as well as subtracting acceleration times a factor, etc.  This prevents the aircraft from overshooting and wildly oscillating around the desired altitude.  Consider the desired elevator change as the aircraft is "nose up" and almost at the desired altitude. There is still a small positive error, but the elevator must go down to slow the rate of climb or an overshoot will soon result. The dampening term in this case is larger than the error term, so the elevator will go negative.  Same approach for real time control of anything with a lag in response.

The correction MUST take into consideration the current rate of change of voltage (1st derivative) and likely the acceleration ( second derivative).  In your case the rate of change (voltage velocity) is calculated by the difference between the present voltage and the last voltage.  The second derivative is the difference between the newly calculated velocity and the last calculated voltage velocity.  


Well, that is exactly the what  I was talking about needing to do:  to move to a PID algorithm. " proportional, integral and derivative".

I did change the sampling rate to 300mS, and that allowed sufficient time for the alternator to settle out before making more changes and mitigated the hunting.  But I still have overshoot and undershoot conditions when loads are applied and removed.  (due to no I and D component).  Because I cap the rate of change going UP, the overshoot is very minimal, but undershoot can be a bit more.  Some more info here:  http://smartdcgenerator.blogspot.com/2013/03/300ms-helped-lot.html


The current point-in-time (P) approach begin used will work fine, given the selection of the timing variables and rate change caps.   I will split off a new thread of code and start moving towards a proper PID algorithm and begin testing it in parallel.  Once I am happy with it, will move over to that code thread.

Thanks for confirmed to me the use of Rate of Change as well as Magnitude of Change.  From your prior posting I had the impression that you had found a way to accomplish Autopilot control w/o those factors . . . .

-al-

thomasonw

The custom panel from Frontpanelexpress.com arrived.  Buy I tell you, they sure do nice work.




Tonight I added the parts, mounted it, and took it for a test run:




My Wife even gave it an admiring look!  (At least, that is my story).   Am a bit disappointed with the #4 machine screws I purchased from Ace Hardware, clearly their heads are undersized (Notice the silver ring around the 4 countersunk LCD screws).  But I am not sure I want to spend the $ to get proper sized screws from McMaster!



-al-





thomasonw

Getting to the short strokes, lots of 'packages' will be arrived this week and next before we head out for the summer.  Today it was the rev 0.2.3 PCBs




Main features:

  • Improved assemblability - moved from SMD Diodes to Through Hole.
  • And added in DIP option for the INA-220's.  The FAB includes 10, count them 10!, daughter cards that one can try out until getting it right!
  • Support for HIGH or LOW Drive alternators
  • And integrated remote that uses another Amtel CPU for I2C to LCD support.  Allows use of generic LCD displays (as opposed to single source), and the physical packaging is much neater.  Also has  room for an option RTC in case one wants to implement time / date based auto-start modes.

That funny looking board to the top right is not really related to this project.  It is a small alarm board I made to monitor high water and main engine overheating and will mount to the right of the Generator controller on the remotes front panel.



thomasonw

If anyone is thinking about using the company I used for the  custom panel, Front Panel Express sent me this eCoupon.  You can get 20% your 1st order.  Valid till June 30th.



They do nice work, and there are a TON of options for materials / finish, etc.

http://www.frontpanelexpress.com/


-al-


thomasonw

Today I coded in a PID-lite algorithm,  PID:

   Proportional   -  Error measured at the moment       (Originally component being used)
   Integral         -  Cumulative sum of errors over time.
   Derivative      -  Rate of change of error                 (Velocity in Bruce's explanation)

What I find interesting is almost without exception all the Best Practices papers and guidance calls to use P+I for a 'PID Lite' and add in D  "If it is needed".   However, Bruce clearly pointed me to go with P+D out the door, and add in a "DD" (Acceleration) if needed - totally bypassing the I.

Well, in the sense of not bypassing Experience over Learning I did the smart thing and went with Bruce's guidance -  just use P+D .    Here is what I got after a few runs today:

Stability during Acceptance Phase:  +/- 30mV around goal battery voltage.  Absolutely no indication of 'hunting'.   And that was even after restoring the timing to a 100mS sampling / adjustment rate!

And a side benefit of not using "I":  There are about 6-7 special cases that need to be programmed for when using the Integral.  Bypassing it sure makes for simpler coding.



It goes without saying, Bruce is the Man!





I then went on and did some transition testing, by applying and removing a 500W and then a 2250W load to the battery.   


Results:
   Worst case load:  (2250W load switched quickly, around 3-4 second intervals, trying to build up momentum):
   Max transition DOWN noted:   -1.38v    dip @  -194V/s rate.   (Application of 2250w load)
   Max transition UP noted:       +460mV raise @  +284V/s rate.  (Removal of 2250w load)



System:
   6x - D85-29 industrial cells.
  Magnum ME3112 inverter
  Rated (not measured) 1500W hot water heating element
  Rated (not measured) 750w block heater heating element.
  373mcm DC cabling, under  10' total.


System Response: +445mV overshoot (above goal battery voltage), declining to +28mV in 261mS. (Two cycles)


All were 'measured' using the self reporting capability of the controller.  The INA-220 give a 1mV resolution (sampled every 50mS or less), while the system reporting / response is at a mean rate of 131mS.   I am sure that affected the rise and fall time numbers.  In the next set of runs I will connect up the DSO.  But given what I read is allowed for auto 'Load Dump' spikes; it seems to me the above is acceptable.  Does anyone see anything alarming?

BruceM

I think a two cycle (200ms) rise of 0.46 volts when dumping the 2250 watt load is totally acceptable. Thanks for the complement, glad it was helpful. There are lots of ways to get good control response for specific situations, but I think using 1st and 2nd derivative damping works reliably and predictably for almost anything so I use it to save time and avoid thinking.

Adding the 2nd derivative (acceleration) term will typically shorten the response to a step change, but it does take more computation and more experimental "tuning" time.  You could try it just for entertainment.

It's academic, though, as I think your current response is very good. Congratulations on your great project. State of the art, very professional.

Best Wishes,
Bruce




thomasonw

Thank you Bruce,   

This has been a fun project - and I really am grateful for the input I have received here.  The Smart Regulator is working just as I wanted in terms of managing WATTs (not just volts) and hence managing the load on the engine.  Through a combination of recapturing underutilized capacity during the Bulk phase (the Triangle), and much tighter regulation and capping of the Amps (so as not to stall the engine) I am expecting to be able to reduce my total run times by 15-20% over when I was using a big-name external regulator.

Plus I got a cool remote start/stop button!

Going forward I will be posting the KiCAD files to the blog.  Need to finish up the firmware for an Amtel based remote vs. the current back-pack solution (Will result in tidier physical packaging and eliminate the single-source LCD).

The EGT probe should be here Monday.  I want to use it to help select the max watt set point for the system (currently I look for Black-exhaust combined with how the engine responds to throttle moments to judge overloaded conditions).   And then with that as a base point I want to experiment using different alternators to see if I can increase the alternator efficiency portion of this generator.  It is my understanding that Alternators loose efficiency as they are spun faster.  Because I am closely monitoring and regulating Amps I can install one of my spare 200A LN4800 series units, spin it slower, and then start adjusting the Amps until I get to the same baseline EGT as with the current 135A alternator.  I am hoping to pick up 5%, maybe even 10% more efficiency using this approach.

But that as they say is another story.  This story gives me the tool with which to investigate!

-al-

Lloyd

Quote from: thomasonw on March 24, 2013, 11:37:30 AM
Thank you Bruce,  

This has been a fun project - and I really am grateful for the input I have received here.  The Smart Regulator is working just as I wanted in terms of managing WATTs (not just volts) and hence managing the load on the engine.  Through a combination of recapturing underutilized capacity during the Bulk phase (the Triangle), and much tighter regulation and capping of the Amps (so as not to stall the engine) I am expecting to be able to reduce my total run times by 15-20% over when I was using a big-name external regulator.

Plus I got a cool remote start/stop button!

Going forward I will be posting the KiCAD files to the blog.  Need to finish up the firmware for an Amtel based remote vs. the current back-pack solution (Will result in tidier physical packaging and eliminate the single-source LCD).

The EGT probe should be here Monday.  I want to use it to help select the max watt set point for the system (currently I look for Black-exhaust combined with how the engine responds to throttle moments to judge overloaded conditions).   And then with that as a base point I want to experiment using different alternators to see if I can increase the alternator efficiency portion of this generator.  It is my understanding that Alternators loose efficiency as they are spun faster.  Because I am closely monitoring and regulating Amps I can install one of my spare 200A LN4800 series units, spin it slower, and then start adjusting the Amps until I get to the same baseline EGT as with the current 135A alternator.  I am hoping to pick up 5%, maybe even 10% more efficiency using this approach.

But that as they say is another story.  This story gives me the tool with which to investigate!

-al-


Al,

Have a look at the Nippo-Denso 200 amp 3 phase hair pin alternator. It is the most efficient wound field alternator produced, besides the new hairpin from Remy International.

The Remy uses a patented Hairpin Stator with square wire, which equals a 100% slot fill. The hairpin designs cuts the wire lose in the stator because of the tight turns you don't have any excess wire outside of the flux zone. Along with the higher slot fill you end up with an 80% effy. Also of note the remy is a true 6 phase alternator

Lloyd


http://blog.dcpowerinc.com/category/alternators/spx-i/

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.

thomasonw

Quote from: Lloyd on March 24, 2013, 11:52:50 AM
Al,

Have a look at the Nippo-Denso 200 amp 3 phase hair pin alternator. It is the most efficient wound field alternator produced, besides the new hairpin from Remy International.

The Remy uses a patented Hairpin Stator with square wire, which equals a 100% slot fill. The hairpin designs cuts the wire lose in the stator because of the tight turns you don't have any excess wire outside of the flux zone. Along with the higher slot fill you end up with an 80% effy. Also of note the remy is a true 6 phase alternator

Lloyd


I have recently been reading about these hair-pin alternators, did not know there was two manufactures!   I do wonder how these units survive under long time running at high amps?   I know Balmar has started sourcing them for their line, so perhaps that answers the question...    And do you know if they also show the decrees in efficiency at higher RPMs that 'traditional' alternators seem to?

And this is great timing, as today I installed the EGT probe!   (See next post).



thomasonw

We received our Mail Drop today, and in it was an EGT probe for the Kubota!   A little drilling, reaming, and a 1/8" MPT tap was all it took to get the probe installed:

EGT in its place.   (I positioned it about 6" from the exhaust port, and in such a way that it does not interfere with the exhaust insulation sleeve.)



And the controller board all installed and wired up. (Less box cover)




Using a watt cap of 1700w, and while turning 2500rpms (2650 under no load), the EGT stabilized at 890f.  And at this level of work the engine is preforming well, no indication of overload (black exhaust), and the engine responded well to small changes in the governor level position.  Alternator output was for example 133A at 12.9v  (batteries placed under heavy load for the test)

I then made a run with the system configured for 2100w.   This time the alternator produced 155A (at 13.42v) and the EGT raised to 1020f.  But there was obvious signs of overloading in the exhaust stream (Black exhaust).   And there was no engine response to governor changes.   Plus the RPMs had dropped to 2400 rpms under load.

Clearly 2100w is too much to draw out at 2400 RPMs.  At 2400 RPMs the engine is rated at 5.2hp continuous   (5.4hp for 2500 rpms). 


IF we assume 1700w at 2500 is a good max continuous load, then that turns into 42% efficiency (1700/(5.4*746))

A key question for me is:  At what EGT should I run?  It seems 900f is a good target, and clearly 1000+ is too much.  Could it be I have already hit the correct target value, and there is no room to grow (without increasing RPMs)?  What is the chance of that.....

This has also given me an idea for yet another fault check:  The max RPMs demonstrated under no load is measured during the RAMP phase.  If the RPMs fall under a definable % of that max (while in Full Throttle mode), then it would be safe to assume the engine is lugging.  For example, in the 1700w case the engine dropped 175RPMs from no load to full load, while in the overload condition the drop was 240RPMs.  Maybe a trap at -200 RPMs (7-8%) would be appropriate in this case.


And here is a question:  The above leads me to believe that 900f is a rather good target to shoot for on EGT.  But I can find NO basis for these small engines (lots of EGT talk around diesel Pickups..) to confirm that.   Does anyone have any insight into what to expect for EGT on these small Diesels?

thomasonw

Well,

It has been a quiet past two months on this thread, though I have been quite busy.  We left Friday Harbor in late March and have been "Out There" ever since.  (Currently anchored in False Creek - downtown Vancouver, BC).   I have been refining the generator controller code and now have over 100hrs of operation on it.  This is a bit over the top for us as the Solar Panel are starting to come into their own, but I kept wanting to do Trial Runs. . .    Things have been working rather well for us, the Alternator regulator is spot on, and aside from correcting some small bugs, almost all the work I have had to do centered around active throttle control - specifically handling the late stages of charging when the engine is throttled down and a large load comes online.


   A Monk / Mcqueen   at  Monk's / McQueen!  (or was, before it closed last Winter)




Tonight I posted source code release v0.1.0 which I consider a stable release for operation.  http://smartdcgenerator.blogspot.com/2013/05/major-milestone-posted-v010-of.html  I even turned off DEBUG mode when loading the firmware into our controller!

I have to tell you, it has been SOOOO nice to simply press a start button when it is raining like stink outside, as opposed to going outside - opening the hatch and climbing down in the lazarett.   Only to repeat the same when stopping the generator.   So very very nice.  And one feature that has surprised me is Auto-stop.  We have found that we tend to start the generator when leaving the boat, and I find it comforting that the generator will stop itself when the batteries are properly charged.   I do not have to worry about overcharging, nor about the generator just droning on in Float mode.  Very nice and a benefit I had not anticipated when starting this project.

We also have noticed that with the active throttle control we are more inclined to just leave the generator run in later stages of charging - even when on the boat.   Before I would shut things down when the amps being delivered dropped under 80A, just did not want to listen to the generator.  But now we just let it idle away fully topping off the batteries.  With the active throttle control it really is not intrusive at these low amp final charging stages;  I do not need to baby sit it (it auto-stops when batteries are fully charged), and I am sure the batteries will be SO much happier getting a true full charge (one that is judged on the AMPs being delivered into the battery, not a pre-defined amount of time - which will almost always be wrong).

Again, thank you for all who have helped with this - it goes without saying the value of the assistance.  Over the summer I will continue to resolve bugs as they come up, and once we need to start using the Watermaker I will be looking at that portion of the code (which is untested outside of the Bench Testing done last Winter).  And now that I have an Amtel based LCD remote I may also play with some HUI hosted on the remote to allow for configuration changes, ala start up in quiet mode, or even configuration of battery parameters.  But that will be a Winter project. 

This summer I am working on a stand-alone Alternator regulator (without the integrated Engine Control).  Based on this controllers code and design, its primary feature will be using the Amps to assess the appropriate time to change charge states.  Years ago I tossed out the smart 3-stage regulator we had on the mains engine house alternator; it kept going into Float Mode prematurely - even when configured to MAX times.  I got tired of stopping the boat and main motor just to restart the regulator trying to get a full charge into the batteries.  Now just use a fixed voltage truck regulator.  Works well except on long trips where I need to manually disable it.   Of course the stand-alone regulator will still have the active management of Watts to limit the max amount of power being drawn from the engine.  Maybe not as important on a large mains engine, but if someone wants to use the regulator on a small generator project - still a handy feature.  And I located a self-powered boost FET driver (LT1910), will be trying out a single design that can support P or N type alternators with no component changes!    I am also looking at communication between two regulators for use in twin engine situations (mostly marine need I am sure :-)  )  Will release it in Open Source (non commercial use) as well - just as this controller project.


When it gets closer, will post some details on it here.  Till then, if folks are interested they can check the Blog.

-al-

thomasonw

As mentioned, I have been taking the core of this integrated controller design and working up a stand-alone regulator-only version.  The primary reason for this is I could never get the commercial 'smart' regulators to properly charge our large house battery, they would always drop out of Acceptance phase well before charging was completed.  (I attribute this to the fact that they use a predefined fixed amount of time to decide when to exit Acceptance phase, and even when I configured them for Max Time, they would enter Float way to soon.  For a while I would stop the boat, turn off the main engine and restart to 'reset' the regulator.  I soon grew tired of this, and changed out to a simple fixed-voltage truck regulator.  This has worked well given our usage patterns, and it is only during very long trips (ala 8hrs underway) that I have to manually adjust the charge voltage once the battery is fully charged.  The second reason is:  I just want to have some more fun!

BUT:  by monitoring Amps being delivered into the battery, I can make a better decision of when to change charging states - one based on the actual needs of the battery, as opposed to an assumed pattern.  This morning I placed orders for the remaining parts and the PCB for the standalone version of the Arduino based Alternator Regulator.  Here is a 'projected' picture of what the PCB will look like:




And the schematic can be found in the Schematic Link on the Blog (http://smartdcgenerator.blogspot.com/.   BOM/shipping cost came in at $83 for the regulator and just under $100 for everything:  Regulator, Temp probes, Current Shunts, etc.  All but connection wire and fuses.

The basic concept for this regulator is the same as the integrated Engine Controller and Regulator, with a few differences:


  • Found a simplified FET boost-driver (LT1910) that has a built in Booth PS.  It should allow N-Channel FETs to be used from 12v to 48v on P or N type alternators w/o any hardware changes.  Will be interested to see how it works!
  • Have eliminated the hardware remote LCD panel, the unit will just start when power is applied and optionally communicate status via Bluetooth. (Or the built in Serial port)
  • Have on board DIP switch and LED for stand-alone configuration and operation.  Just select the battery type, size, and some other special features and connect it up.  Nothing else is needed to get it to work in its basic function.
  • Sync port to coordinate functions between two regulators charging the same battery, ala in a twin engine boat.  Mostly this is to share Amps produced, but as the firmware progresses, might find other needs for this coordination.

It still retains the ability to monitor and manage Amps (Watts) as well as Volts.  This can be used to better decide when to change charging states (terminating the Acceptance phase based on battery need vs. pre-determined fixed amount of time), as well as doing functions to protect the Alternator, or limit the load on the engine.  I plan to have a few 'pre defined' scenarios built in and selectable via the DIP switches, and hope to have a simple user interface available via the Bluetooth (and/or Serial port) to monitor status as well as allow for additional  custom configuration of different scenarios to be saved in the Atmel EEPROM.  Of course, one could always modify the firmware and get any scenario they wanted!

I should be picking up the parts late June, early July.  Then will be building them up.  Till then, I continue to use my Fixed voltage truck regulator on the main house battery alternator, and the integrated Arduino controller on the Generator.



Ronmar

That is way cool! Looks like you are going to save me from having to figure out a standalone controller:)  With the bluetooth I/F you should be able to write an APP to look in on this thing with an Ipad/Ipod...   
Ron
"It ain't broke till I Can't make parts for it"

thomasonw

Quote from: Ronmar on May 29, 2013, 09:11:09 AM
That is way cool! Looks like you are going to save me from having to figure out a standalone controller:)  With the bluetooth I/F you should be able to write an APP to look in on this thing with an Ipad/Ipod...   

Yes, someone is helping me out that says he can 'deal with all the Ipad stuff'.   Am hoping for a simple GUI connected either by Bluetooth, or the Serial Service Port, that will allow for monitoring of status, and basic configuration changes to be saved in FLASH. And hoping to get something for PC's, iPad and Android... . .  (Anyone else out there experts in this area??  I like to bang-bits, that HUI stuff is just a bother  ;) )   And am leaning towards using ASCII for the communications protocol, to allow other 'programs' to harvest the data in real-time w/o the issues of different binary formats.  One chap I am Emailing with is building up a whole-boat datalogger.  Will be simple for him to scrap off this stream of data and add all sorts of battery / alternator info to his 'glass screen'.

Of course, all can also be done w/o any of the Hi Tech stuff - just set the DIP switches to one of the 6 default charging profiles, and if need be use a PC to re-flash the controller with anything you want....


BruceM

Another great project with state of the art components. Nice work, Thomasonw!
For the easily technically confused, you might want to change your typo of "booth" to "boost".  I understood. :)  

For the guys scratching their heads at talk of buck, boost, high side and low side drive:
"Buck" switching supplies can only reduce the input voltage to any set voltage or current blow the input.  "Boost" switching supplies raise the output voltage above the input.

A regulator that switches the positive voltage supply is called a "high side" switch. If N-channel mosfets are uses to do this, the gate voltage must be 9-15V above the positive voltage. Very little current is needed, and there are lots of techniques for boosting the voltage to drive the high side gate.
P-channel mosfets don't need the boosted voltage, as the gate is pulled lower than the high side voltage to turn them on.  P-channel mosfets are a bit more expensive and have lower efficiency than N-channel.  

"Low side" regulators switch the ground, and this is cheaper and more efficient as N-channel mosfets can be driven with 9-15V to the gate.

Thomasonw is doing a universal high OR low side regulator design that could be used with ANY alternator, thus he's going for the fancy boost capable mosfet driver.  

Very nice, very sophisticated.