Changes for page Power controller

Last modified by Mathias Larsen on 2026/09/24 21:21

From version 39.1
edited by Mathias Larsen
on 2026/09/24 21:21
Change comment: There is no comment for this version
To version 37.1
edited by Mathias Larsen
on 2026/09/23 18:23
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -15,8 +15,6 @@
15 15  
16 16  {{toc/}}
17 17  
18 -
19 -
20 20  == Pinout ==
21 21  
22 22  === Connector pinout ===
... ... @@ -108,33 +108,20 @@
108 108  
109 109  == Distribution circuit ==
110 110  
111 -The board has 9 distribution circuits, one for each fused output group. All 9 circuits use the same design, and the component reference designators follow the circuit number (circuit 1 uses R101–R104, C101, D101 and F101, circuit 2 uses R201–R204, and so on). Each circuit consists of:
112 -
113 -* A fuse in a Littelfuse nano fuse holder, so the fuse can be replaced without soldering
114 -* A 2 mΩ shunt resistor for current measurement
115 -* A current sense amplifier channel and a low-pass filter to the microcontroller ADC
116 -* An RGB LED, where the green channel shows that the fuse is intact and the red channel is controlled by the microcontroller
117 -
118 118  [[image:1790100104451-169.png]]
119 119  
120 120  === Green LED ===
121 121  
122 -The green LED indicates whether the fuse is intact. It is connected from the output side of the fuse to ground through a 4.7 kΩ resistor. When the fuse is intact, the LED lights up. If the fuse blows, the LED loses its supply and turns off. This makes it easy to find a blown fuse by looking at the board.
113 +The green LED indicates whether the fuse is intact.
123 123  
124 -The LED is powered directly from the output voltage, so the current depends on the supply. At 24 V the current is roughly 4–5 mA, and at 12 V it is about 2 mA. This turned out to be brighter than necessary.
125 -
126 126  [[image:1790098808447-123.png]]
127 127  
128 128  === Current sense ===
129 129  
130 -The current in each circuit is measured by passing it through a shunt resistor with a very low resistance and measuring the voltage drop across it. This small voltage is amplified, filtered and read by the microcontroller's ADC.
131 -
132 132  ==== Shunt resistor ====
133 133  
134 134  A 2 mΩ shunt resistor is placed in series with the load. The voltage drop across it is 2 mV per ampere of current (0.002 V/A).
135 135  
136 -The shunt is a Vishay WSLF2512 metal strip resistor with 1 % tolerance and a 5 W rating. The low resistance keeps the losses small: at 8 A the voltage drop is only 16 mV and the power loss is about 0.13 W.
137 -
138 138  [[image:1790100157872-786.png]]
139 139  
140 140  ==== Amplifier ====
... ... @@ -141,22 +141,10 @@
141 141  
142 142  The amplifier is a quad-channel current sense amplifier with a gain of 200 V/V. When the measured voltage drop passes through the amplifier, the output is therefore 0.4 V per ampere.
143 143  
144 -The board uses three INA4180A4 amplifiers (U3, U4, U5) from Texas Instruments. This gives 12 channels, of which 9 are used. The INA4180 measures on the high side and accepts a common-mode voltage of up to 26 V, so it can measure directly on the 24 V outputs.
145 -
146 -With the 3.3 V ADC on the microcontroller, the maximum measurable current is about 8 A (3.3 V / 0.4 V/A ≈ 8.25 A). Above this, the amplifier output saturates.
147 -
148 -|=Current|=Shunt voltage|=Amplifier output
149 -|1 A|2 mV|0.4 V
150 -|2.5 A|5 mV|1.0 V
151 -|5 A|10 mV|2.0 V
152 -|8 A|16 mV|3.2 V
153 -
154 154  ==== Filter ====
155 155  
156 156  The filter is a low-pass filter with a cutoff frequency of 1.6 kHz.
157 157  
158 -It is an RC filter made of a 10 kΩ resistor and a 10 nF capacitor between the amplifier output and the ADC pin: f,,c,, = 1 / (2π × 10 kΩ × 10 nF) ≈ 1.6 kHz. The filter removes high-frequency noise, for example from PWM-controlled fans and switching loads, before the signal is sampled. The capacitor also acts as a charge reservoir for the ADC's sampling capacitor.
159 -
160 160  === Power amplifier ===
161 161  
162 162  [[image:1790101431805-672.png]]
... ... @@ -163,24 +163,12 @@
163 163  
164 164  === Voltage measurement ===
165 165  
166 -The supply voltage is measured so the microcontroller can monitor the LV battery voltage. The signal is read on pin PB2 (V-sense).
167 -
168 168  A voltage divider with a ratio of 1:11 is used, so 24 V corresponds to 2.182 V on the microcontroller pin.
169 169  
170 -The input voltage is calculated in firmware as V,,in,, = V,,pin,, × 11. With a 3.3 V ADC, the highest voltage that can be measured is about 36 V, which gives good margin above the 24 V supply.
171 -
172 -|=Supply voltage|=Voltage on pin
173 -|12 V|1.09 V
174 -|20 V|1.82 V
175 -|24 V|2.18 V
176 -|30 V|2.73 V
177 -
178 178  [[image:1790101449150-901.png]]
179 179  
180 180  === 12 V supply (did not work) ===
181 181  
182 -The 12 V supply is a synchronous buck converter that steps the 24 V supply down to 12 V for the pumps, inverter and data logger. It is built around an LM5148 buck controller (U801) from Texas Instruments, which drives two external N-channel power MOSFETs (IAUCN04S7L028, Q901 and Q902) as the high-side and low-side switches. The output inductor is a 0.65 µH Coilcraft XAL7070 (L901), and a 3 mΩ resistor (R910) is used for current sensing in the controller.
183 -
184 184  The buck converter overheated under load and made a whining sound.
185 185  
186 186  [[image:1790102044737-969.png||height="368" width="925"]]
... ... @@ -191,41 +191,22 @@
191 191  
192 192  Uses the standard Align template.
193 193  
194 -* **5 V:** An AP64060 synchronous buck converter (U6) steps the input voltage down to 5 V. It accepts 4.5–40 V in and delivers up to 0.6 A.
195 -* **3.3 V:** An AP2112K-3.3 LDO regulator (U7) generates 3.3 V for the microcontroller and the current sense amplifiers.
196 -* **CAN bus:** An NCV7344 CAN FD transceiver (U2) connects the microcontroller to the CAN bus. The transceiver supports up to 5 Mbps, and the bus runs at 1 Mbps. A common-mode choke (L1) reduces noise on the bus lines, and a TVS diode (D1) protects them against ESD and voltage spikes.
197 -
198 -The whole board is protected by a 400 W power TVS diode (D2) on the input, which clamps voltage spikes on the supply.
199 -
200 200  == Control logic ==
201 201  
202 202  === Sourced from the microcontroller ===
203 203  
204 -The programmable red light is part of the same RGB LED as the green fuse indicator. It is controlled by the firmware and can be used to show the status of each circuit, for example an overcurrent or an output that is switched off.
159 +The programmable red light is part of the same RGB LED.
205 205  
206 -Current is sourced directly from the microcontroller through a 350 Ω series resistor. When the pin is driven high (3.3 V), current flows through the resistor and the red LED to ground. The STM32 pins can supply up to about 20 mA each, so no transistor is needed. This gives an LED current of roughly 3–4 mA, which made the LEDs too bright. The resistor value should be increased on the next version.
161 +Current is sourced directly from the microcontroller through a 350 Ω series resistor.
207 207  
208 208  [[image:1790098512666-432.png]]
209 209  
210 210  === High-side switching ===
211 211  
212 -The buzzer, brake light and pumps are switched on the high side. The load's negative side is permanently connected to ground, and the controller switches the positive supply. This means a short from the output wire to chassis cannot turn the load on, and the load is completely unpowered when it is off.
213 -
214 -Each output uses a P-channel MOSFET as the main switch between the supply and the load. A P-channel MOSFET is used because it can switch the high side without a charge pump or gate driver. It turns on when its gate is pulled below its source (the supply voltage).
215 -
216 -The microcontroller runs on 3.3 V and cannot pull the gate of the P-channel MOSFET far enough on its own. A small N-channel MOSFET is therefore used as a level shifter:
217 -
218 -* **Output off:** The microcontroller pin is low, so the N-channel MOSFET is off. A pull-up resistor holds the P-channel gate at the supply voltage, so V,,GS,, = 0 V and the P-channel MOSFET is off.
219 -* **Output on:** The microcontroller pin goes high (3.3 V) and turns on the N-channel MOSFET. This pulls the P-channel gate towards ground, V,,GS,, becomes negative and the P-channel MOSFET turns on.
220 -
221 -A 1 kΩ series resistor on the N-channel gate limits the current from the microcontroller pin, and a 10 kΩ pull-down keeps the output off while the microcontroller is starting up or in reset.
222 -
223 223  ==== Buzzer and brake light ====
224 224  
225 225  The buzzer and brake light are switched on the high side using an N-channel MOSFET (BSS123NH6327XTSA1) that drives a P-channel MOSFET (BSS83PH6327XTSA1).
226 226  
227 -These outputs run on 24 V. The BSS83P is rated for -60 V and -0.33 A, which limits each output to 330 mA. This is enough for the buzzer and an LED brake light. The maximum gate-source voltage of the BSS83P is ±20 V, so the gate must not be pulled all the way to ground from 24 V. The two 10 kΩ resistors on the P-channel gate form a voltage divider that limits V,,GS,, to about half the supply (≈ -12 V).
228 -
229 229  [[image:1790181075885-591.png||height="343" width="367"]]
230 230  
231 231  ==== Pump ====
... ... @@ -232,8 +232,6 @@
232 232  
233 233  The N-channel MOSFET (BSS123NH6327XTSA1) is the same as for the buzzer and brake light, but the P-channel MOSFET (BSC084P03NS3GATMA1) has a much higher current rating.
234 234  
235 -The pumps run on 12 V and draw considerably more current. The BSC084P03 is a power MOSFET rated for -30 V and -78.6 A, with an on-resistance of about 8.4 mΩ. At 5 A this gives a loss of only about 0.2 W, so no heatsink is needed. Since the supply is 12 V, the gate can be pulled fully to ground without exceeding the ±20 V gate-source rating.
236 -
237 237  [[image:1790181054296-268.png||height="306" width="371"]]
238 238  
239 239  == Known issues ==
... ... @@ -273,7 +273,7 @@
273 273  |0466.125NR|Electric Fuse, Very Fast Blow, 0.125A, 125VAC/VDC, 1206|F102|1|Littelfuse|0466.125NR
274 274  |776231-1|Conn Shrouded Header, HDR 35 POS, 4mm, Thru-Hole|J1|1|TE Connectivity|776231-1
275 275  |76829-0002|Mega-Fit Straight Male Header, 2x2, 5.7mm Pitch|J2|1|Molex|76829-0002
276 -|(4 pin header)|2.54mm pitch 1x4 vertical header|J3|1|Generic|
216 +|(4 pin header)|2.54mm pitch 1x4 vertical header|J3|1|Generic|
277 277  |44914-0401|Conn Header Vert 4POS 3mm|J4|1|Molex|44914-0401
278 278  |1461247-3|Relay, Gen Purpose, SPST, 8A, 24V|K1|1|TE Connectivity|OJ-SH-124LMH,000
279 279  |784234510|WE-CNSA Common Mode Line Filter, 1210, 7850Ω, 200mA|L1|1|Wurth Elektronik|784234510
... ... @@ -314,16 +314,12 @@
314 314  
315 315  == Changes ==
316 316  
317 -* Connector
318 -** Change main connector
319 319  * Circuits
320 320  ** More dedicated supply circuits
321 -** Keep the same current sensing
322 -** Increase the signal LED resistor on the PCB (the LEDs were too bright)
323 -* Microcontroller
324 -** Needs more inputs
259 +** Keep the same current rating
260 +** Adjust the signal LED resistor on the PCB
325 325  * Digital signals
326 -** Increase the green signal LED resistor on the PCB (the LEDs were too bright)
262 +** Adjust the signal LED resistor on the PCB
327 327  * 12 V supply
328 328  ** Three separate 12 V supplies:
329 329  *** Pump 1
... ... @@ -375,4 +375,4 @@
375 375  |(% style="width:472px" %) |(% style="width:650px" %)
376 376  |(% style="width:472px" %) |(% style="width:650px" %)
377 377  |(% style="width:472px" %) |(% style="width:650px" %)
378 -|(% style="width:472px" %) |(% style="width:650px" %)
314 +|(% style="width:472px" %) |(% style="width:650px" %)