Wind generator control PCB

I've created a PCB for my newly built 3D printed Windmill. Now I am not entirely sure about all the components and the way they function, so I'd like to have your opinion on the circuitry before I place my order.

The idea is that the circuitry charges an externaly protected and managed 18650 and stores sudden current spikes inside the a capacitor (C1). The battery management circuitry requires a voltage of 3.7V and specifies 9A max (Aliexpress protector board, so I'm expecting around 4.5A max charging current).

The board should be able to recover from a total black-out using only the the generator's power, so the generator must be able to power the required chips (U4) to store the power into the battery. I think I did this right.

I expect a maximum of 20V@6A to ever come from the BLDC under load, which will probably only occur during a tornado. You can find the BLDC here: https://aliexpress.com/item/32834130958.html?spm=a2g0s.9042311.0.0.27424c4dvEScG2.


You can find the 3.7V and 5V regulator schematics in the attachments below.

The schematic requires some comments.

The power from the BLDC comes in through connector J2 and goes through a diode rectifier bridge (D3-D8) In order to have the capability to slow the BLDC down, I've added three 0.22 Ohm power resistors in combination with a N-Channel mosfet (Q2) to control the speed of the motor in a high wind force push event.

To enable/disable charging the capacitor, another N-channel mosfet (Q1).
U4 requires an logic level enable signal and VIN (5V-40V) can be used; I'd like to control the charging, so I added a pull-up (R25) to the enable line and a schotky diode (D2) after the pull-up to protect the 328P from the 5V-40V that might be on VIN. Is this the proper implementation and can I enable (5V@CHARGE_EN) and disable (0V@CHARGE_EN) U4 using this layout? I've done some simulations using LTSpice but they only gave me more doubt.
I'm still in doubt if I'll implement this method for Q1, to make sure that the default state of Q1 is on until the 328P wakes up.

To get the voltage of the current spike cap, a voltage divider is used (R4-R6).

A current sensor is integrated onto the PCB to monitor the current.

U3 is the 5V system power supply, which provides power to the MCU and various sensors. The idea is that this power supply is able to wakeup on it's own, without the MCU running. (WeBench design: https://webench.ti.com/appinfo/webench/scripts/SDP.cgi?ID=8BDB047EA3CA84C8)

U4 is the battery power supply, which converts the input voltage to 3.7V. (WeBench design: https://webench.ti.com/appinfo/webench/scripts/SDP.cgi?ID=3C967BFA6477601C)

A temperature sensor is also present to monitor the temperature inside the windmill.

The connectors:

  • BT1: the battery connection terminals.

  • J2: the 3 phase BLDC input.

  • J3: the magnetic sensor header for the BLDC.

  • J4: the UART header.

  • J5: the ICSP header.

  • J6: the 433 MHz radio transmit module.

The screw terminals visible are not the ones that will be used.

There is a cut-out between the current in and current out pins of the ACS712 which also goes underneath the chip it self. The 3 pin mosfets use the tap for the drain instead of pin 2, the solder mask has been removed underneath the taps.

Those big blocks next to the diode bridge are the power resistors that dump the energy when needed. (0.22 Ohms, 5W each. They are bendable and you can solder an additional resistor to the top of each resistor, so in total 5 power resistors can be used, the middle one is too high to solder another resistor onto.)
I simulated the break dump in LTSpice and that looked promising.

I ran the DRC and everything is solved and passes the checks.

My questions;

  • Have I implemented the mosfets (Q1 and Q2) properly (I don't mean the mosfets used around U3 and U4)
  • Is the board able to start charging the battery, or wake-up the 328P, from a complete black-out?
  • What do you think of the schematic and the PCB?
  • Do you spot any cricital faults?

Block diagram of the windmill's circuitry

Now I am not entirely sure about all the components and the way they function, so I'd like to have your opinion on the circuitry before I place my order.

Most people construct a prototype, in order to test and correct the design errors before ordering a PCB.

jremington:
Most people construct a prototype, in order to test and correct the design errors before ordering a PCB.

I already did that and the majority of the parts are working!

What doesn’t work?

jremington:
Most people construct a prototype, in order to test and correct the design errors before ordering a PCB.

Theoretically yes and I agree in principle. But PCBs can be so cheap now that it is sometimes worth taking the risk, especially if you would anyway have to start making up special break out boards to test specific components on a bread board. If you have used the components before (or are otherwise confident of understanding their behaious from the data sheet) and liberally include jumpers on the board to isolate/test certain sections, that may work for you. This is how I tend to work now. I've not had a disaster, but some of the PCBs look a mess with cut tracks, snipped out parts, soldered on bridges and additional components.

jremington:
What doesn't work?

I'm not sure about that, but the last two attempts resulted in a fried Arduino, even though everything should have worked.

I'm confident about the mosfet and the braking system, simulation showed that that should work, but I'm not so confident about the effectiveness of D2 to protect the 328P form getting 20V on it's pins. I don't want to risk another Arduino testing that, since I'm low on Arduino's.

6v6gt:
Theoretically yes and I agree in principle. But PCBs can be so cheap now that it is sometimes worth taking the risk, especially if you would anyway have to start making up special break out boards to test specific components on a bread board.

Exactly! Sometimes circuits just get too complicated to be able to test them on a breadboard.

I'm not in a position to comment much on the circuit, however I know 16850's don't like to be discharged below 3V. And if you do go below 3V the max charging current should be ~100ma until the battery terminal is comfortably above 3V then it can increase to the recommended charge current.

JohnRob:
I'm not in a position to comment much on the circuit, however I know 16850's don't like to be discharged below 3V. And if you do go below 3V the max charging current should be ~100ma until the battery terminal is comfortably above 3V then it can increase to the recommended charge current.

Correct! The battery management circuitry should handle that for me (I hope)

I'm not keen on 'join the dots' schematics; it took me 10 minutes to find out where the current went after it left the 3 phase rectifier, it would have been obvious if there had been a wire drawn. D2 is a good example of this, the cathode is labelled CHARGE_EN, which appears to go to pin 2 of the '328, which is right next to it, a wire could have been shown.

As far as possible schematics should be drawn with the signal / power flow from left to right. As this one is about power in from a wind turbine I'd expect the 3 phase input connector and rectifier on the left and everything from that moving across to the battery and output on the right, with everything else around it as needed.

For some reason you label the output of the rectifier as voltage (V_POS) but that becomes current (CURR_OUTPUT) after the ACS712, this seems confused, all you have done is pass the current through a measuring device.

I expect a maximum of 20V@6A to ever come from the BLDC

This suggests a fundamental misunderstanding of the relationship between voltage, resistance and current. The amount of current that comes from the BLDC is dependent on what the load, your circuit, draws. The current does not just come unbidden. Do you know Ohms Law?

I don't understand what you have done with C1. Why is C1 not just across the output of the rectifier? What is Q1 for? I'm not even convinced you should use a MOSFET like that as the current will be flowing the wrong way when C1 discharges.

I already did that and the majority of the parts are working!

To commit the design to a circuit board when you know some parts don't work seems a bit optimistic; I think I would want to know that all the parts worked first.

I'm not so confident about the effectiveness of D2 to protect the 328P form getting 20V on it's pins.

I'm not confident either! How do you think D2 stops anything from getting 20V on its pins? I am completely lost on how that's supposed to protect the '328 from 20V.

I'm low on Arduinos

I'm sure the folk who sponsor this web site will be delighted to help you with that.

The TPS61232 datasheet shows 3 x 22μF capacitors on the output, you have 1 x 10μF capacitor.

The data sheet also says that the TPS61232 has a 1V (nominal) reference, and that for a 5V output you need a potential divider from the output to the FB pin, you have the output connected directly.

Does PD3 have input pullup activated? I ask because PG is an open drain output and there is no pull up resistor in your circuit. The data sheet shows a 1M Ohm resistor from PG to the 5V output.

I have not studied the rest of the circuit in detail as too many of the devices are ones I am not familiar with. I do wonder if that much circuitry really needed. It looks too complicated for the stated purpose, but that might just be me showing my ignorance of what you are trying to do and the components used.

I hope something I've said helps.

PerryBebbington:
For some reason you label the output of the rectifier as voltage (V_POS) but that becomes current (CURR_OUTPUT) after the ACS712, this seems confused, all you have done is pass the current through a measuring device.

What is your suggestion on labeling that signal after the current sensor?

PerryBebbington:
This suggests a fundamental misunderstanding of the relationship between voltage, resistance and current. The amount of current that comes from the BLDC is dependent on what the load, your circuit, draws. The current does not just come unbidden. Do you know Ohms Law?

Yes I do!

PerryBebbington:
I don't understand what you have done with C1. Why is C1 not just across the output of the rectifier? What is Q1 for? I'm not even convinced you should use a MOSFET like that as the current will be flowing the wrong way when C1 discharges.

C1 is there to provide the battery charging circuitry with a stable energy source, so that when there are big wind shocks, which generate a lot of power spikes, the battery is still able to charge as C1 charges up from those power spikes.
Q1 is there to enable charging or discharging of the capacitor, and will be used to prevent over current and is used to do MPPT. Do you suggest putting it on the high side and use an P-Channel Mosfet?

PerryBebbington:
How do you think D2 stops anything from getting 20V on its pins? I am completely lost on how that's supposed to protect the '328 from 20V.

How would you solve this? I thought I am using D2 as a voltage clamping diode, but it seems that I'm wrong.

PerryBebbington:
The TPS61232 datasheet shows 3 x 22μF capacitors on the output, you have 1 x 10μF capacitor.

The data sheet also says that the TPS61232 has a 1V (nominal) reference, and that for a 5V output you need a potential divider from the output to the FB pin, you have the output connected directly.

Page 3 states that the fixed voltage version, the TPS61232, requires a direct connection from FB to VOUT.

PerryBebbington:
The TPS61232 datasheet shows 3 x 22μF capacitors on the output, you have 1 x 10μF capacitor.

You're right, I did this wrong with U4 as well.

PerryBebbington:
Does PD3 have input pullup activated? I ask because PG is an open drain output and there is no pull up resistor in your circuit. The data sheet shows a 1M Ohm resistor from PG to the 5V output.

There is a 10kOhm pull-up, right under U3. I'll try to clear the schematic up a bit!

PerryBebbington:
I hope something I've said helps.

Certainly! I'm able to improve the design drastically!
Thanks for your feedback :slight_smile:

What is your suggestion on labelling that signal after the current sensor?

I don’t have one other than being consistent, to call it current in one place and voltage in another is confusing. However, I would not label it at all, I would have the power flow of the circuit from left to right with everything joined up with wires not labels, then it would all be obvious, no labels needed, or not many.

Yes I do!

That leaves the question of why you made the comment that made me ask; if you understand Ohms law then you understand that what matters is the voltage from the generator.

C1 is there to provide the battery charging circuitry with a stable energy source, so that when there are big wind shocks, which generate a lot of power spikes, the battery is still able to charge as C1 charges up from those power spikes.

Several things:
There’s no point. The battery is a storage device, the capacitor is a (very much smaller capacity) storage device. Storing some of the output from the generator in a capacitor to later put it in a battery is pointless, just store it in the battery when it’s available.
If there was a point 15000μF isn’t going to store enough to make much difference. Are you aware of the relationship between voltage on a capacitor, its capacity and the current into / out of it? So, for a 1F capacitor if you draw 1A from it the voltage will change by 1V in 1 second. You have 15000μF, so if you draw 100mA from it then in 1 second the voltage will drop by 6V6. I suggest this is neither useful nor ornamental in your application.
If you were to implement this then the way to do it is to put the capacitor across the output of the rectifier. Trying to switch it in and out of circuit is pointless.

Q1 is there to enable charging or discharging of the capacitor, and will be used to prevent over current and is used to do MPPT. Do you suggest putting it on the high side and use an P-Channel Mosfet?

I had to look up MPPT. Intuitively I don’t see the point in this application, and even if I am wrong and there is a point then see my comments above about the size of the capacitor. In any case, to get the maximum output from the generator I would think (I’ve not tried) you would vary the load by using the change controller to control the current fed into the battery and thus the current drawn from the generator. The aim being, I guess, to draw the maximum power possible. In communications terms, you want to match the output impedance of the generator to the input impedance of the load. I don’t think switching a capacitor in and out is going to make a meaningful difference, and if it is to make a meaningful difference it needs to be a lot bigger than the one you have.
The problem with the FET is you are asking it to switch AC. I did a quick experiment with a capacitor, FET and LED like you have in your circuit and it did work. You are however trying to pass DC through the FET the wrong way when the capacitor discharges. Using a P channel FET makes no difference to this.

I thought I am using D2 as a voltage clamping diode, but it seems that I’m wrong.

I don’t know that you are wrong, I am saying I can’t see how it would protect anything from anything else. it is between the LM5141 (which I don’t know) and PD4 of the '328. Please explain how that clamps anything. I can’t tell you how I would do it because I don’t understand what you are trying to do.

There is a 10kOhm pull-up, right under U3. I’ll try to clear the schematic up a bit!

So there is! See, join the dots schematics, I hate them, can’t see where things go.

PerryBebbington:
I don't have one other than being consistent, to call it current in one place and voltage in another is confusing. However, I would not label it at all, I would have the power flow of the circuit from left to right with everything joined up with wires not labels, then it would all be obvious, no labels needed, or not many.

So there is! See, join the dots schematics, I hate them, can't see where things go.

I've fixed it!

PerryBebbington:
That leaves the question of why you made the comment that made me ask; if you understand Ohms law then you understand that what matters is the voltage from the generator.
Several things:
There's no point. The battery is a storage device, the capacitor is a (very much smaller capacity) storage device. Storing some of the output from the generator in a capacitor to later put it in a battery is pointless, just store it in the battery when it's available.

I'll consider removing it, which will save loads of space too.

PerryBebbington:
The problem with the FET is you are asking it to switch AC. I did a quick experiment with a capacitor, FET and LED like you have in your circuit and it did work. You are however trying to pass DC through the FET the wrong way when the capacitor discharges.
Using a P channel FET makes no difference to this.

I don't see how I am switching AC, the mosfet is present after the rectifiers, maybe that wasn't visible enough in my previous Mona Lisa a like schematic :wink:

Without debating if the capacitor is a good choice or not, should I reverse the mosfet in order to fix this problem? I find mosfet's interesting but sometimes very confusing.

I don't see how I am switching AC.

Capacitors don't conduct DC...

Draw yourself a battery on the left of a piece of paper, a capacitor in the middle and a resistor for a load to the right. Connect all three in parallel. Now imagine the battery is charging the capacitor (ignore the resistor for a moment). Draw some arrows for the current flow (similar to this). Which way is the current flowing through the wires to the capacitor? Now ignore the battery and do the same exercise for the capacitor discharging through the resistor, draw some arrows for the current flow. Which way is the current now flowing through the wires to the capacitor?

PerryBebbington:
Which way is the current flowing through the wires to the capacitor?

From battery + to capacitor + and from capacitor - to battery -

PerryBebbington:
Which way is the current now flowing through the wires to the capacitor?

From capacitor + through the resistor to capacitor -

PerryBebbington:
Capacitors don't conduct DC...

But they are able to store DC energy right?

Which way are the arrows showing the current flow in the wires of the capacitor in each case?

But they are able to store DC energy right?

Yes, but that's not the point. You are confusing direct and alternating current with direct and alternating voltage.

PerryBebbington:
Which way are the arrows showing the current flow in the wires of the capacitor in each case?

From battery + to capacitor + and from capacitor - to battery -

Quote from: PerryBebbington on Today at 03:41 pm

Which way is the current now flowing through the wires to the capacitor?

From capacitor + through the resistor to capacitor -

This is frustrating. I don't just want to tell you the answer.

Look at the capacitor's leads*. Not the wires to the battery or the resistor, just the capacitor.

When it is charging which way is the current flowing in the capacitor's leads?
When it is discharging which way is the current flowing in the capacitor's leads?

*There are 2 wires coming out of the capacitor, maybe side by side, maybe at opposite ends: I am asking about the direction of current flow in these wires.

This is frustrating. I don't just want to tell you the answer.

Haha it is indeed :D, but I'm trying my best

Quote from: PerryBebbington on Apr 23, 2020, 06:34 pm

Which way are the arrows showing the current flow in the wires of the capacitor in each case?

Into the capacitor's top and out from the capacitor's bottom.

Quote from: PerryBebbington on Today at 03:41 pm

Which way is the current now flowing through the wires to the capacitor?

Out of the capacitors top and into the capacitor's.

FINALLY! :slight_smile:

Into the capacitor's top and out from the capacitor's bottom.
Out of the capacitors top and into the capacitor's (bottom).

So, opposite directions. What is current called that flows one way for a bit then flows the other way?

PerryBebbington:
FINALLY! :slight_smile: So, opposite directions. What is current called that flows one way for a bit then flows the other way?

Haha yeah, AC.
But, I only want to control the charging of the capacitor. What effect does the mosfet have when the battery charger is trying to use it's energy?