Whichever MCU you use, I'd add a precision voltage reference (2.5V ?) so the ADC readings are consistent rather than being proportional to the device supply voltage.
In the DRM, the output voltage of the generator is compared to a precision
voltage reference. When the generator output exceeds this reference, the
current to the field coils is cut off. This causes the generator output to fall.
When the output falls below the reference voltage, the field current is turned
back on. In this way, the field current is modulated at a rate of 50 – 125 Hz.
These rapid changes are smoothed out by the inductance of the field coils, thus
maintaining a constant output voltage.
Current limiting is accomplished in the same way. Output current is sensed
with a Hall-Effect device that detects the magnetic field created by the output
current. When the output current exceeds a preset limit, the field current is
turned off. Just as with the voltage regulation, the field current is modulated to
maintain a constant output current.
Instead of a cut-out relay, DRM uses a MOSFET “ideal diode”, which is much
more efficient than Schottky diodes. Power is supplied whenever the dynamo
output voltage is greater than the battery voltage, rather than a pre-set voltage as
in the mechanical regulator.
JLCPCB looks like a great service! Do you use EasyEDA?...
Personally, I'd use a mid-range PIC as the controller; they have all the facilities needed and you can get a PCB made at JLCPCB, with a surface mount PIC ready assembled (along with any other surface mount parts).
...
Well, I'm looking at extremely low volume production here. To use the PIC, wouldn't I need something like the MPLAB ICD 4 In-Circuit Debugger? That's $57.95 USD. The STM32 Nucleo-32 development board has the ST-LINK debugger/programmer on board, so all I should need is a PC and a USB cable.Fairly obviously the 18F PIC you've listed there is a LOT cheaper than the others, a LOT easier to use (as it's presumably through hole), but also still has far more power than you need for such a low requirement as this project.
That 18F27K42 does look like a very capable device. I agree that a 32 bit ARM processor is massive overkill, but it's easy to use (in the form of the Nucleo-32) and I can afford it.My 18F of preference is the 18F27K42, which has plenty of peripherals, loads and loads of memory, is cheap, and comes in 28 pin skinny DIP for easy use.
32 bit ARM processors seem somewhat massively over kill
Well, I'm looking at extremely low volume production here. To use the PIC, wouldn't I need something like the MPLAB ICD 4 In-Circuit Debugger? That's $57.95 USD.
Also, (something I should probably add to my high level design) I'll need some kind of user interface for configuration of the voltage regulator (and maybe diagnostics, etc.) The Nucleo-32 has a UART and the USB port, so, again, all I need is a PC and a USB cable.
That 18F27K42 does look like a very capable device. I agree that a 32 bit ARM processor is massive overkill, but it's easy to use (in the form of the Nucleo-32) and I can afford it.
Well, that's still $57.95.No, just a PICKit3 or PICKit 4.
Both the NUCLEO-G431KB and the Teensy 3.2 have an an Arduino Nano V3 connector, so maybe they could be (somewhat) swappable with a real Arduino. But the NUCLEO-G431KB is $12, cheap enough, and roughly the same form factor. I've been programming in C/C++ for decades, and I don't really want to use the Arduino scripting language, but I could see where others might prefer that.You could use an Arduino Nano, for small and cheap, and no programmer required.
You are looking in the wrong places! Try ebay..Well, that's still $57.95.
Thanks! How's this, then?You need to look at the gate drive for Q2; as it is, it can never turn on - the gate needs to be a few volts positive of the source when on & equal to the source when off.
Possibly use a P channel FET plus a smaller transistor switching the gate to ground, & pullup resistor to source?
It will also need a diode from J3 to D+, a "flywheel diode" across the field coil output, to avoid damage to Q1. Preferably a big schottky that can stand the field current.
The quiescent current of the LD1117s is 5-10mA, which isn't horrible for the prototype, but reducing it would be nice.To reduce standby power, you could use a regulator that has a shutdown pin to power all the non-MCU stuff?
Or, maybe I could move all the ground connections for the power supplies and the B+ voltage sense to an N channel FET gated by the ignition switch?Or add another P channel FET in the power connection from the MCU reg to the battery sense and other reg, so they can be shut off.
Makes sense. Thanks.That looks OK, but I forgot about the FET diode - a single one as it is arranged will allow reverse current from the battery to the dynamo..
You would have to use two back-to-back (sources and gates commoned) for total isolation, or just reverse source and drain - MOSFETS conduct in both directions, as long as the gate-source voltage is present. That would never cut off the dynamo output from the battery, but the field control should minimise any residual output.
Thinking about this some more... Besides trying to make an "ideal diode", there is the notion of "cut in voltage". On my old regulator, the spec. is 6.2-6.8v. Of course, the voltage probably droops once it's cut in, but there is a huge amount of hysteresis: the reverse current (at cut out) is spec'd at 2-5.5 amps! (That reverse current is something I'd like to avoid.)That looks OK, but I forgot about the FET diode - a single one as it is arranged will allow reverse current from the battery to the dynamo..
You would have to use two back-to-back (sources and gates commoned) for total isolation, or just reverse source and drain - MOSFETS conduct in both directions, as long as the gate-source voltage is present. That would never cut off the dynamo output from the battery, but the field control should minimise any residual output.
I don't know enough about batteries to know if there's any harm in flowing current to a battery at a voltage less than that at which it can accept a charge. It could be that's a bug, not a feature: e.g., maybe it would help to warm up a cold battery. I was thinking I could kinda emulate the original regulator and cut in at a specified voltage, but once cut in, stay cut in until the Hall effect sensor shows a reverse current (but I would cut out at any reverse current, not wait for -2-5.5A). But that's all a "simple matter of programming" and could be configured later (if I add a second FET).On a mechanical regulator, the cut-out contact allows current both ways. The cut-in voltage and reverse current system is to prevent the battery being drained by the dynamo at low revs.
You don't have that problem with the the electronic version.
D'oh! I didn't really think that all the way through, did I? But, if I control the MCU's power supply regulator from the MCU, don't I have a bootstrap problem? Maybe I need to do both, with a diode OR at the ON switch of the 5v regulator. When the ignition switch is turned on, the power supply turns on and powers the MCU, and the MCU can then use a digital I/O pin to latch the power supply ON until it is done with it. (Bonus: allows for some kind of orderly shutdown sequence, if needed.)I'd run the regulator switch from the MCU; the ignition & voltage sense signals are there regardless, so you can control the whole thing as needed then.
(Plus the regulator would turn off when you force the ignition lamp on, as shown).
I will have to educate myself about those. I've been looking at Transient Voltage Suppressor (TVS) diodes, e.g.: ON Semiconductor 500 Watt Peak Power MiniMOSORB Zener Transient Voltage Suppressors (one example of many).Re. the protection you mentioned earlier, you could add relatively large VDRs (eg. Zenamics) at each external terminal to help suppress transient spikes.
Thanks, I'll fix that.I also just realised R7 is now in the wrong place, I only glanced at it last time. R7 should be to ground to hold the Q2 off with no signals,
I think that's what I had until I flipped source and drain to avoid the current drain problem. So, R7 just needs to move, right?and the FET needs a resistor between gate and source to hold that off unless turned on.
Sounds like a very good idea. Say, 100Ω? Maybe a TVS zener?You could add overvoltage protection there, to prevent a spike damaging the FET gate; a low value series resistor between Q2 and the gate and a zener across gate & source to clip the gate voltage; eg. 10V.
I think a common problem is the "current dump", which happens then the car is going down the highway and the battery decides to open up (or the terminal falls off, etc.) The alternator regulator is slow to respond and there is a big, long, high-voltage, high-current surge. Luckily, my generator is pretty anemic and can barely raise 25v on an open circuit with DF shorted to ground. And, from the point of view inside the regulator, we're in charge of regulating any surges!I remember from somewhere than 12V vehicle electronics are supposed to be rated to stand 60V transients!
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?