Another Engine Control and Regulator project - DC Alternator

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

Previous topic - Next topic

thomasonw

As winter is approaching I have more time to Play with things and have picked back up on a project to provide more control of our Kubota / Leece Neville / DC Generator / watermaker.  (referanced here: http://www.microcogen.info/index.php?topic=2257.msg27611#msg27611)

This all started out from me wishing to have finer control of the regulator, managing not only the charging voltage, but also the total load placed on the 5Hp Kubota with the overall goal to lower the run time.  In order to do this, I needed to monitor the total Watts being produced by the alternator and adjust the Field to keep the motor fully loaded at all points of the BULK charge state.

Over time I this project, as many do, grew to include not only the alternator regulation function but also basic Kubota start / stop capabilities.

As it stands, key goals include:
- Traditional 'Smart' multi-stage alternator regulator
- Adding Amps sampling to manage total load on Kubota  (The Alternator is able to stall the motor at Full On, so it always running at some reduce state.)
- Basic Start / Stop function of Kubota
- Throttle Management
- Fault monitoring and management
- Remote Display and switch panel


I selected the Amtel / Arduino development environment and have completed the initial hardware design.  My next step is to build a prototype and begin the software, as well as hardware refinements / corrections.

All are posted at: http://smartdcgenerator.blogspot.com/

I would welcome any and all thoughts on this before I spend more $ on it (specifically sending off for the PCB - as that is a bit harder to change once it arrives).  There are .pdf's of the schematic and PCB as well as Gerber files for the pcb.

Thank you,
-al-



BruceM

Looks like a great job so far, William.  I'm busy the next couple days but have printed out your schematic for further review, and will try to get back to you soon with any comments.  While I'm missing a system diagram and such to easily follow all of what you're doing, what I have seen looks quite nice.  Though I got re-started in imbedded controllers with PICs and/or Picaxe chips and I use ExpressPCB and their free software for their bargain priced "experimenter size" boards, I also like the Atmel processors and your choice of an open source PCB layout software is a good one too.  (I'm not thrilled with being locked into ExpressPCB but so far I can't complain at all about their quality and competitive pricing.) We all tend to stick with what we know to avoid the long hours of learning curve for something new.

If it were me, I'd think about doing some sort of preliminary real time analysis, to see if the single processor can handle all of the real time tasks you have in mind or if you might want to dedicate some additional smaller controllers or additional analog control circuitry to some.  Processors are cheap, and this isn't going to be a high volume commercial product anyway so it's more about making your development process easier.  You may very well be such a skilled old hand at real time controllers that this suggestion is unwarranted at best and perhaps insulting, and if so my apology. 

Congratulations again on the very nice work, and some good design and tool choices.

Best Wishes,
Bruce

Lloyd

Quote from: thomasonw on November 18, 2011, 11:17:20 PM
Hello.

I have just posted my home-built EB300 (also ex-mil unit) / DC generator with parts lists and all.

It is a bit different in that it is a marine usage and also includes a water maker.  But perhaps you can find some good info.

http://mvvikingstar.blogspot.com/search/label/Kubota%20DC%20Generator

-al-


hey Fellow Monk Owner, and also DC generator GUY.

I'm looking forward to reading up. Here's my story of my Monk and DC Generator. http://www.microcogen.info/index.php?topic=709.0


Lloyd
Quote from: thomasonw on October 29, 2012, 01:10:35 PM
As winter is approaching I have more time to Play with things and have picked back up on a project to provide more control of our Kubota / Leece Neville / DC Generator / watermaker.  (referanced here: http://www.microcogen.info/index.php?topic=2257.msg27611#msg27611)

This all started out from me wishing to have finer control of the regulator, managing not only the charging voltage, but also the total load placed on the 5Hp Kubota with the overall goal to lower the run time.  In order to do this, I needed to monitor the total Watts being produced by the alternator and adjust the Field to keep the motor fully loaded at all points of the BULK charge state.

Over time I this project, as many do, grew to include not only the alternator regulation function but also basic Kubota start / stop capabilities.

As it stands, key goals include:
- Traditional 'Smart' multi-stage alternator regulator
- Adding Amps sampling to manage total load on Kubota  (The Alternator is able to stall the motor at Full On, so it always running at some reduce state.)
- Basic Start / Stop function of Kubota
- Throttle Management
- Fault monitoring and management
- Remote Display and switch panel


I selected the Amtel / Arduino development environment and have completed the initial hardware design.  My next step is to build a prototype and begin the software, as well as hardware refinements / corrections.

All are posted at: http://smartdcgenerator.blogspot.com/

I would welcome any and all thoughts on this before I spend more $ on it (specifically sending off for the PCB - as that is a bit harder to change once it arrives).  There are .pdf's of the schematic and PCB as well as Gerber files for the pcb.

Thank you,
-al-



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.

BruceM

Had a few minutes before a visiting engineering prof.  shows up. 

I looked up the ina220 current shunt monitor/2 wire bus chip you're using.  Wow, that sure gets rid of a lot of fussy analog drift and offset drift problems if you're going all digital control.   

Nice design, William.  I think I'll be learning a lot from your project, I'm a fossil!


Thob

I looked over your schematic and have to say it looks pretty well thought out and robust.  Lots of protection there against things going wrong!

I do have a question about the pullup resistors on the SCL-buffered and SDA-buffered lines on the remote panel.  470 ohm resistors R4 and R5 are tied to a 12v supply which is feed by a 470 ohm resistor R3.  If both SCL and SDA are low, then it appears you would only have about 4 volts on the 12v zener.  A similar situation appears on the controller board with R11 and R12 pulling down the voltage supplied by R47.  You may need to run the line driver with a LDO regulator at 8 or 9 volts instead of a resistor/zener setup.  Or use much larger pullup resistors.
Witte 98RC Gas burner - Kubota D600 w/ST7.5KW head.
I'm not afraid to take anything apart.
I am sometimes afraid I'm not going to get it back together.

thomasonw

All,

Thank you all so much for your comments.

Bruce:  Being I was starting from fresh, I have a choice of CAD tools.  Eagle seems like a great product, gets LOTS of support, and the free 'one pager' is great.  but I just felt I might get trapped down the road, so went with KiCad.  Seems to be working OK, but have noticed one needs to be careful of the libs - some have errors (like the LEDs that did not include the bottom solder mask), and less common parts one needs to make up.  (Chip guys - if they have libs tend to be Eagle.  Oh Well).  But it has been fun working with it - did need to get a different gerber file viewer (am using gerbv) as the built in one does not render drill files. . .

And ya, the IN220's are great little parts!  I had started with op Amps, but by the time I got into the quality needed for these low Amp-shunt voltages (mostly low off-set voltage), the price was very very close to an IN220!  Plus, that part will do all sorts of averaging - offloading the CPU!   I figure with that should be OK with the CPU cycles as I do not plan on using the RS-232 lib, which looks to be a real pace resource hog - it must to all the I/O bit-banging combined with delays.  I am a little worried about using the other two serial libs (I2C and ONE-WIRE), but perhaps it will be ok.  The ONE-WIRE is such a very very slow protocol (like milli-seconds approaching a second for some functions) I plan on doing a state machine and walk through the IOs based on the master Atmel timer.  That leaves the I2C, and if it gets too bad will just also use a state machine approach and only poll / update the display every 2 seconds or so...

But yes, that IN220 is a real find.  And cheap too considering all it does!  Plus there are others in the series, I choose this one because it handled low-side Amp shunts

Lloyd:  Looked over your project - So nice!  I do wish I started with a 10-15hp engine and could drive a full 200A+, but I have what I have.  Even so, it has worked well.  Between handling battery recharging and water maker duties am happy.  Though we added a couple of large Solar panels this last Spring, and as a result did not use the generator much at all this summer.  We just pulled into Friday Harbor for the winter, where do you base out of?  Perhaps will cross paths this summer as we are looking to start heading North the next few years.

And Thob - Wow, ya.  That will not work.  I had sized the drop resistor based on the Icc typ of the P82B96 and did not give any consideration to the pull-up resistors.  Can just imaging how those poor drivers IC would struggle with such a noisy Vdd!  I added this in because the Vcc MAX of the P82B96 is 15v, and its ABS rating is 17v.  Normally that would be ok, if not on the line, but during equalization would really be pushing it.  I had 1st looked at 12v LDO regulators, but could not find any that warranted their operation when Vin fell below 12-13v.  Am sure many would work, but clearly would be out of spec.    So, am now just thinking of replacing the Resistor/Zener with a couple of simply Diodes - use them for their voltage drop.  Figure I can get a good 1.2 to 1.4v extra 'headroom' off of the raw battery voltage that way.   Or guess I could do a simple Zener / Emitter Follower regulator.   Any other ideas?

Thank you so much for the catch!

BruceM

Hi William
Here's my thoughts on your schematic this morning:

I'm not sure what the field current being controlled is, but as current goes up you are often better using a gate driver IC (cmos) to get faster on/off switching, less MOSFET heating (and exploding). At the 1 amp peak gate current size they are cheap, small, reliable. Something like an 8 pin TC1411 or MC3315.  In your present design your off transition gate current is seriously limited by R21. I would eliminate Q3 et al and use a driver chip, myself. This may be an irrelevant comment as your field current may be relatively low, but since you used Q1 and Q2 in parallel I it made me worry.

Looks to me that as long as the OC1A pwm function controlling the Field + doesn't require too too much software attention you should be fine, real time wise.  I assume the 2 wire serial interface to the remote display P82B96 has enough buffering to make that less of a cycle stealer, too.  You may have to write some of your own I/O handlers but there is a lot of advanced hobbyist support for Atmel, and you can probably find what you need. 

I would suggest you look into the one wire support overhead before you have your board made.  Last time I looked into them for a project, I ended up avoiding them as there was just too much time lost waiting for conversion and pokey serial data transfer with the software support I had available.  Perhaps your I2C or SPI interface interface and software will be "smart" enough to let you start up a conversion/transfer on your timer schedule and then go about your business.

I hope you'll have time to share your experience as you go, this looks like a lovely, quite advanced design.


Thob

I was thinking of LDO regulator for the line driver with 8 or 9 volts out - that should be sufficient to drive the communication line unless you've got an awful lot of noise.  And it will leave plenty of drop across the regulator on a low battery.  For that matter, you could probably do just fine with +5v, especially since you've already got one on the remote board for the LCD.


Bruce has a good suggestion on using the drivers for the CMOS devices.  I've got some TC4426 (dual) drivers that I've bought for an upcoming project.  If you do use the drivers, be sure to use a bypass capacitor (1uF) right at the chip.

Witte 98RC Gas burner - Kubota D600 w/ST7.5KW head.
I'm not afraid to take anything apart.
I am sometimes afraid I'm not going to get it back together.

BruceM

William, I had another thought:
I'd also change the field drive to low side PWM; it's typically done that way and the N-ch mosfets are higher performance as well as cheaper. You'd likely only need one N-ch Mosfet.  "Field +" connector would become "Field -", and the other leg of the field coil would be tied to +batt.  

I'd also think about going to 2 or more channel gate drivers and then using them for all the mosfet switched controls, and make them all low side switches, if practical.

I'm such a fossil I use a full duplex (TTL, 5ma) optically isolated current loop design for my remote control panel serial link, since it's about 500 feet (on CAT5 cable) away. Hardly high tech but the control signal is run in the same steel conduit with the 240V twisted pair AC power run (technically a no-no), and I needed something simple and interference proof.  It's updated once per second at a blazing 1200 baud.  Current loop is as simple as a resisitor across the LED of an opto-isolator at the receiving end of a twisted pair, with matching series resistor termination of the pair at the driven end.  Even running my 12A central vacuum with a brushed universal motor wouldn't give me a single data error on a continuous loop back test, so I called it good enough at just 5ma current.  CAT5 cable is a marvelous thing.





thomasonw

Bruce / Thob:

Thank you again for your time to review and comment.

I can definitely see the advantage of using a FET Driver for the PWM (Field) FETs, and noted several under $2 each.  Not sure will get the same uplift with the more static state drivers (ala the Glow Plug).  And Thob - ya, guess I have been pushing the I2C expansion noise margin a bit.  Given I have set a low-voltage cut-off point for the project at 9v using an nv LDO would give me LOTS of noise margin on the I2C drivers.  Bruce, the P82B96 are not that expensive, but I do get your point that the demands are not that great and perhaps a different approach would be lower cost.  Will look into it more, but at this point am not too concerned about the costs.  What I do not like is the H-Bridge cost, but guess it is inline with what I would need for a discreet H-bridge.....  Oh Well, think Infineon considered that when they set their pricing for the TLE5205? :-)

I have been spending the past few days looking at the High Drive vs. the Low Drive for the Field.  Seeing if there was some reason for High vs. low from the alternators standpoint, or perhaps safety / corrosion. About the only thing I could find was that at one time GM used one approach, and Ford used the other. . .   What is curious is almost without exception, EVERY external regulator I have seen uses High Drive.  In fact, most the IC regulators I looked at early on (ala from On Semiconductor - CS3341, and CS3361)  use High Side Drive.     I looked at the FETs , and there is about a $0.45 delta between the N and P FETs I am using, and the N FETs do look better on specs as well.  I just have this unanswered question in my mind of Why is High Side to prevalent?

In looking at my design, perhaps I would say that using the High Side drives gives a bit better decoupling (via the voltage regulator, and such) then something bouncing against the Gnd plane?  Of course would be easy to bring in a dedicated Field GND line.  Though adding a 2nd GND connector would eat a bit into the FET savings.

But perhaps mostly I am wondering about Why does it seem High Side is so prevalent - Any ideas???

On the other drivers: Pump and Glow-Plug can not be taken low, but in my case the Fuel Pump and Throttle Clutch could.   The fuel pump I am using has an isolated ground wire, as does the cruise-control box I pulled from a scrap yard (even though the automobile wiring diagram showed GND was serviced via the case as opposed to a seperate wire).  Even so, I might just leave that one high-drive as well - if someone else wants to use this design I do not know how universal isolated gnd wires for the cruise control modules... 

And finally, on the software loop overhead.  I think I just need to get some sample one-wire and I2C devices and see what can be done.  I do know the OneWire communication timings can approach a second PER OPERATION, and yes.  That is huge. But I also would expect temperatures will not change so fast, so sampling round-robbin, and perhaps even sampling one say every 5 seconds would be sufficient.    I am intending on doing a 'command queue' for the OneWire in the main loop, and using the Amtel timer to decide when it is time to pull the next command out of the queue.  In this way, I hope to stall the main loop only during the bit-banging of the actual serial transfer.  What I do not know is how much time it will take for even one session of bit-banding to be completed by the default lib.  But, if even that turns out to be too much then maybe will need to look at doing some type of interrupt driven i/o drivers (as opposed to bit banging).  That could be fun!  Brings back memories of a project I did with a 6502 (KIM-1) and a selectric typewriter - using the Timer / IRQ drive actual I/O port changes...

At this point, am still wondering if something is being messed on the whole high vs. low side Field drive - as from an engineering standpoint I can find no difference.   And for software, think I am just going to have to start mocking up things and see what the current libs do. . . .

Thank you again so much for your time and comments.  I will update the schematics perhaps over the weekend and repost a new version.    And if you have any thoughts on the 'Why High Side is so prevalent' - would LOVE to hear them!

-al-



BruceM

Your research is impressive, William.  My own experience is limited to looking at internal alternator regulator designs, and making a linear regulator as an external replacement (for greatly reduced EMI). Perhaps on external regulator designs the alternators have the negative field and one field brush was bonded to the frame, and  the frame provides the negative to the alternator, per the usual automotive wiring practice. That would account for a high side switched design.

Maybe BobG could answer the question of why external regulators are high side switched?

You're absolutely right about gate drivers on PWM vs  on/off functions. The exception would only be for high current devices with a MOSFET that is being operated close to it's a rated current spec.




mobile_bob

i don't know much about car alternators , however the truck alternators are as follows

most all of the delco's historically were low side driven fields, but they were internal regulators

those with external regulators like the 555, and most all the leece nevilles i know of are high side driven.

i don't think there is any advantage one over the other.

the only thing i can think of is this is a legacy problem, in that in the early days the regulators were remote mounted and if there were a short to ground the alternator would go full field and burn stuff up.

on the other hand if the unit was high side controlled, if the wire got grounded the alternator would quit, and the worst that could happen is the regulator got fried.

as for my preference, as it relates to what is available to drive the field, mosfets are
nice, and low side seems easier to control?  so maybe we go with a low side control?

from a regulator design standpoint, i would probably lean toward a low side (N type mosfet) driver myself.

having said that, every 3 stage controller i know of is a high side controller. balmar, xantrex, amplepower, hehr, and i am pretty sure sterling too.

i can think of no reason why one would be better than the other, and would like to hear if there is a difference or an advantage, with facts to back it up.

bob g

thomasonw

Quote from: mobile_bob on November 02, 2012, 03:11:43 PM
<SNIP>

I can think of no reason why one would be better than the other, and would like to hear if there is a difference or an advantage, with facts to back it up.

bob g

Me too.   

Thanks Bob for the insight.  And FWIW;  Failure Modes I think are a very valid justification.  As I will be installing this in a marine environment, I also am looking to see if I can get any insight from a corrosion / electrolysis risk point of view (So far, nothing)... 

Lacking anything else I am  going to sit on this over the weekend - and decide which way to go:  the better 'electronic' approach, or the 'Lemming' approach :-)

Maybe someone will have a nugget of information between now and then.

-al-

Thob

I could see where having one brush holder be grounded, and not insulated, would save a few pennies in building the alternator.  That would force you to use high side regulation.  It may also have depended on what was available for regulator pass transistors - some very early designs may have had a preference for PNP transistors.

Most old generators (that I've seen) are "ground the field to charge", (low side regulator).  I wonder if they wanted to make the new alternator regulator totally different for some reason?  No conspiracy theories here...

In either case, if the transistor driving the field shorts (a likely failure mode), it goes to full charge.  This is probably why they used avalanche diodes - to protect the electrical system in case the regulator went out.  Maybe a just-right sized fuse in the field circuit is in order (that would assume that full voltage on the field is never required)?
Witte 98RC Gas burner - Kubota D600 w/ST7.5KW head.
I'm not afraid to take anything apart.
I am sometimes afraid I'm not going to get it back together.

mobile_bob

whatever you come up with, i would definitely fuse the field to protect the regulator
in case of some sort of short,  that of course is if you go with a high side control scheme.

low side failure modes wouldn't result in a regulator failure, but might fail to full output.

something to consider i guess

bob g