I have fried a few PI PICOs. Capacitor C1 is shorted to ground, so I suspect voltage spikes, but am unable to find any culprits.
The project is a portable engine driven “smartish” 12V generator for battery charging in remote locations when the sun hides from my solar panels. The aim is for a high charge rate (up to about 50A), which can be selected by the user, and maximum voltage regulation set to 14.8V. This voltage be safe for lead-acid and LIFePO4 batteries.
I am using a small (1.2kW) engine coupled to an automotive alternator. After a great deal of “discovery learning” I concluded that the modern alternator regulators are no longer analogue and cannot be fooled into delivering a high charge rate. So the project now has armature current control, as well as a servo driven governor attached to the engine throttle. Good thing the PICOs have two cores!!!
The schematic is at this link: https://drive.google.com/file/d/15XYPCNY6TaBOb3aJMDjl1AwuTZA7dPXE/view?usp=sharing
The LM7805 powering a 5V rail for the PICO, throttle servo, and hall-effect speed sensor. The recommended filter capacitors have been used and, just for fun, I added D2, a 5.1V zener diode to try and clamp any damaging voltage spikes. But the PICO continue to fail. D1 is there to OR the 5V and USB power supplies into the PICO.
I note that the C1 capacitor in the PICO is only 6V. This seems a bit low for long life to me because its working voltage is 5V on the input to the PICOs power supply.
Any comments and advice would most welcome.
Welcome to the forum!!
Do you have an oscilloscope that you could hook up to the output of the generator? It sounds like there might be some voltage spikes making its way through your circuit to the Pico:
It looks like your schematic link is set to private, I’ve just updated your trust level so you can post photos!
As far as the rating goes for C1 the SMPS and Vsys specs have a max rating of 5.5V so should be more than enough for just about every use case.
Just to confirm, if you hold the continuity tester across Vsys and GND it shows as a short?
With the schematic sent through we’ll be able to take a close look!
Sorry for the delay. I had to re-rearrange my garage to get the thing set up again.
Attached are two traces. One each for the 12V and 5V supplies. The purple lines in each are the FFT. Maximum frequency of these is 1275 Hz (256 bins of 5 Hz each). To refresh your memory I have also attached a schematic.
I cannot see spikes in either trace. Hence my query about known failures.
Any help or suggestions would be welcome.
12V Generator Mk 2.3.pdf (159 KB)
Hi Liam (again),
To answer your original question. Yes, Vsys to ground shows a short, and I traced it to C1.
Nice schematic! Nothing is ringing alarm bells from how you have everything connected as is.
The voltage spike would appear as the alternator starts to run, and turn off.
If you only connect the power pins of the Pico up what happens then?
- Flash a blink LED file on the Pico
- Unplug the USB
- Plug in a single GND and Vsys
With the program loaded into the PI:
- With the USB connected LED flashes immediately which indicates that the governor software loop is operating.
- Likewise, with the battery only connected (12V) the LED flashes.
- Same thing with both USB and 12V connected. The PICO is running off the USB since the voltage at VSYS is a little lower than 5V because of the D1 voltage drop.
- Disconnecting the USB and leaving USB connected does not change things.
- When I start the alternator, everything works OK. The armature PWM is working, and the throttle servo is also operating. I can start tuning the armature and governor controls.
- UNTIL - After a variable time the PICO fails.
I am confounded.
Yesterday I removed C1 from one of the bad PICOs. The input to the power supply is down to 4 ohms (aka the 5V pad of C1). This seems a bit low to me. It may be that the power supply has also been cremated.
I think I have found the problem. To recap (see attached schematic):
- Installed separate 6V shunt regulator to drive just the SG5010 servo. The 5V regulator is supplying the PICO only.
- Became aware that the servo is very noisy. It propagates about 2V spikes which are visible on the 12V input.
- Installed a 470uf electrolytic across he 6V regulator between Gnd and Output.
- This reduced the spikes to about 0.5V at the 12V input. There is negligible noise on the 5V supply to the PICO.
- When they arrive, I will try a 6.2V Zener to try and clamp the 6V supply.
So far, the PICO has survived for almost a day. Whoopee!!! I can now get back to tuning the governor.
It seems that it is good practice to put very good filtering on the 5V rail which supplies the PICO. Do you have and recommended circuits/advice. I would like to get rid of the spikes altogether.
12V Generator Mk 2-4.pdf (173 KB)
Glad to hear you solved it!!
Designing a filter is very much a craft, the easiest way to get rid of spikes to a bare Pico would be to use an external battery (LiPo’s voltage range sweeps the whole Vsys so you’ll have a clean input!)
If you’re keen to go down the path of creating a circuit I’d check out this video that touches on bandpass filters: https://youtu.be/ENy_zg9dX5c
I would seriously think about trying another servo. What do these spikes look like and what is roughly the repetition frequency. This info could be a clue. If indeed the interfering spikes are caused by the servo there is something seriously wrong and throwing capacitors at it is only a band aid solution. Usually the 7805 regulator is very good at eliminating discrepancies in the supply.
I have a couple different servos on order to try. Originally I had a 7805 providing power to both the PICO and the servo. I then put a 7806 in to supply the servo only, and that is when I became aware of the 2V spikes being produced. As you say, the 7805 is very good at eliminating this sort of thing, and it now seems to be protecting the PICO quite well.
Like you, I suspect that the servo is not very good quality. The 7806 is getting quite hot at 20% duty and almost no torque loading The 7806 is good for about 850 mA. I would not expect it to be labouring in this circumstance.
We will see what happens with a replacement servo.
I have just been having a look at your circuit.
This may or may not be a concern but I would have a look at D3. I don’t know anything about the armature you are driving with the Mosfet but that flywheel diode (1N5822) does not seem adequate for that application at 40V 3A. It would not be considered robust enough for a motor speed controller to drive a reasonably sized 12V motor. The back EMF spikes could be well over 40V and the current could equal the stall current of the motor.
I consider a more suitable diode for this application and one that is widely used is the MBR20100CT which is a dual 100V 10A schottky. Connect the 2 diodes in parallel for a 20A capability.
A malfunction of this diode is far more likely to cause spikes on the 12V line that the servo.
Might be worth replacing the Mosfet too in case of hidden damage. Not that expensive and good insurance.
Thanks for taking the time to investigate my travails. Your expertise is much appreciated.
My understanding is that the armature does not carry much current but is prone to spikes as you say. The armature has about a 3 ohm resistance so, neglecting back emf, I would expect to see maximum steady state current of 4 – 5 amps.
The attached (inverted) trace is taken at the -ve rotor terminal. Duty is about 25%, and frequency 50 Hz. The Fourier report shows a 4V spike at 50 Hz, otherwise nothing of note, as indicated by the trace.
I must respectfully disagree with your hypothesis regarding the source of the spikes. With the engine running and charging the battery, but the throttle servo unplugged (manual throttle), the 12V trace is free of spikes (see trace), and vice versa. Hence my focus on the servo.
So far, nothing has died at the armature end of things after something like 10 – 15 hours operation under test. The armature spikes are not ideal but appear tolerable for the moment.
I will keep your recommendations in mind when it comes time to finalise the design. Thank you.
An update on the throttle servo driver – the 8706 gets very hot. As I remarked before, I would not expect the servo to draw anything like the rated current of this regulator. I suspect the so-called SG5010 is a look-alike and the source of my grief.
That result is showing the Mosfet (Q3) switching which is not as you suggest interference spikes. If that signal is inverted it would signify about 80% duty cycle. When signal is zero (Gnd) Mosfet ON and signal 12V Mosfet OFF. If the signal is not “inverted” you can reverse that duty cycle to 20%. The “inverted” term has me a bit confused as I don’t see any means of “inverting” the input signal on the oscilloscope controls or any indication that this is so.
Back to your trace. Assume for the moment that the signal to the oscilloscope is not inverted and the duty cycle is 20%. These pulses are not interference but what you would expect to see across the Mosfet while switching. The interference is that positive going spike at switch off. Would be interested in looking at that see exactly what it is and what amplitude. You will have to run the time base much faster to see this. This is what the diode D3 gets rid of. It is actually a reverse spike across the armature inductance at Q3 switch off and should be no more that the forward voltage drop across D3, Probably about 0.7V, the diode data sheet will tell you. It could possibly be instrument overshoot but if that were the case I would expect to see it on he negative transition also.
Assuming the lower trace is measured at the same point this indicates that Q3 is simply turned off and is not switching when in manual throttle mode. I don’t know what is supposed to happen here but I assume you have this in hand. This could be why the “interference” seems to disappear when the servo is not working, the Mosfet Q3 stops switching.
The heating of the 7806 is something else and could be due to a faulty servo. Although “overheating” is a pretty relative term and could be normal. I think if you can hold your finger on it probably OK. You would have to check data sheets etc to see what the current requirements actually are.
The Fourier report just shows the make up of the square wave with the horizontal trace representing frequency instead of time. Shows the fundamental (50Hz) and all the odd harmonics of this which is what a square wave is. More details on this on the Wikipedia page for “square wave”.
No activity for over a week. Have you managed to nail down your problem or are you still doing battle with it. Would be good to know.
By the way, a small point which does not matter much except for your information. The regulator 7806 is NOT a shunt regulator as you mentioned earlier. A small point but you may as well investigate the difference for your own education and satisfaction. The series and shunt regulators work quite differently. They have been largely sidelined in recent years for switch mode units with a view to power saving but they still have the advantage of no interfering switching artefacts to contend with if you can cater for the power loss as heat.
Yes, it is the project that keeps on giving. I think the last time I was in contact I had just put a dedicated LM7806 solely to power the throttle servo. Three Tower Pro SG-5010 servos failed in quick succession. I suspect they developed an internal short to ground because the LM7806 became very hot. I can vouch for their internal protection!
I tried a S303 servo and that has survived for the best part of a week. My suspicion is the SG-5010 servos were poor quality knock offs. The servo is operating at almost no load all the time (wiggling a throttle control), so I find it hard to believe that the would be drawing anywhere near 1 Amp.
Interestingly, with the servo disconnected and everything else operating, including the alternator, all power supplies are free of spikes. Connect the servo and a small AC signal appears on the 6V and 12V supplies. The waveform is typical of sinusoidal ringing at a frequency of about 100 kHz with a peak voltage of about +/- 1V. The noise appears in short irregular bursts which do not seem to synchronise with anything I know about. Surely the servos cannot be that noisy??
At the moment the ringing is of little consequence since the servo and the PICO are surviving well, and I can start tuning the governor and armature control. I am sure there is more “discovery” learning to come.
Thanks for your interest
Can you post a pic of that “ringing”. If there are any transitions involved it could be measurement technique. Your oscilloscope probe should have an earth clip with a short earth wire. It is not unknown for a long probe earth to introduce ringing which you can see but actually disappears in real life. The probe is putting it there. This usually has to be initiated in some way like the leading and trailing edge of a square wave. Would be easier to offer a suggestion if we can see exactly what this looks like.
Did you ever look up the components of a square wave. Very fast square waves could get up to the 13th or 15th harmonic. That is what that Fourier display is. For what you are doing don’t bother with it and let it worry you. You have no interest in Fourier analysis for your application and unless you understand it (I don’t fully) you are likely to worry about nothing.