Changes for page Power controller

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

From version 38.1
edited by Mathias Larsen
on 2026/09/23 18:47
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,42 +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 -|=Component|=Value|=Ref Des (circuit 1)
121 -|Fuse holder|Littelfuse nano|F101
122 -|Shunt resistor|2 mΩ, 1 %, 5 W, 2512|R101
123 -|Filter resistor|10 kΩ|R102
124 -|Filter capacitor|10 nF|C101
125 -|Green LED resistor|4.7 kΩ, 0805|R103
126 -|Red LED resistor|350 Ω|R104
127 -|RGB LED|Würth 150282M167310|D101
128 -
129 129  === Green LED ===
130 130  
131 -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.
132 132  
133 -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.
134 -
135 135  [[image:1790098808447-123.png]]
136 136  
137 137  === Current sense ===
138 138  
139 -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.
140 -
141 141  ==== Shunt resistor ====
142 142  
143 143  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).
144 144  
145 -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.
146 -
147 147  [[image:1790100157872-786.png]]
148 148  
149 149  ==== Amplifier ====
... ... @@ -150,22 +150,10 @@
150 150  
151 151  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.
152 152  
153 -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.
154 -
155 -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.
156 -
157 -|=Current|=Shunt voltage|=Amplifier output
158 -|1 A|2 mV|0.4 V
159 -|2.5 A|5 mV|1.0 V
160 -|5 A|10 mV|2.0 V
161 -|8 A|16 mV|3.2 V
162 -
163 163  ==== Filter ====
164 164  
165 165  The filter is a low-pass filter with a cutoff frequency of 1.6 kHz.
166 166  
167 -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.
168 -
169 169  === Power amplifier ===
170 170  
171 171  [[image:1790101431805-672.png]]
... ... @@ -172,31 +172,12 @@
172 172  
173 173  === Voltage measurement ===
174 174  
175 -The supply voltage is measured so the microcontroller can monitor the LV battery voltage. The signal is read on pin PB2 (V-sense).
176 -
177 177  A voltage divider with a ratio of 1:11 is used, so 24 V corresponds to 2.182 V on the microcontroller pin.
178 178  
179 -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.
180 -
181 -|=Supply voltage|=Voltage on pin
182 -|12 V|1.09 V
183 -|20 V|1.82 V
184 -|24 V|2.18 V
185 -|30 V|2.73 V
186 -
187 187  [[image:1790101449150-901.png]]
188 188  
189 189  === 12 V supply (did not work) ===
190 190  
191 -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.
192 -
193 -|=Component|=Part|=Ref Des
194 -|Buck controller|LM5148RGYR|U801
195 -|Power MOSFETs|IAUCN04S7L028ATMA1|Q901, Q902
196 -|Inductor|XAL7070-651MEB, 0.65 µH|L901
197 -|Current sense resistor|3 mΩ, 3 W|R910
198 -|Output capacitors|22 µF, 25 V|C909–C912
199 -
200 200  The buck converter overheated under load and made a whining sound.
201 201  
202 202  [[image:1790102044737-969.png||height="368" width="925"]]
... ... @@ -207,67 +207,30 @@
207 207  
208 208  Uses the standard Align template.
209 209  
210 -* **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.
211 -* **3.3 V:** An AP2112K-3.3 LDO regulator (U7) generates 3.3 V for the microcontroller and the current sense amplifiers.
212 -* **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.
213 -
214 -The whole board is protected by a 400 W power TVS diode (D2) on the input, which clamps voltage spikes on the supply.
215 -
216 216  == Control logic ==
217 217  
218 218  === Sourced from the microcontroller ===
219 219  
220 -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.
221 221  
222 -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.
223 223  
224 224  [[image:1790098512666-432.png]]
225 225  
226 226  === High-side switching ===
227 227  
228 -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.
229 -
230 -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).
231 -
232 -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:
233 -
234 -* **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.
235 -* **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.
236 -
237 -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.
238 -
239 239  ==== Buzzer and brake light ====
240 240  
241 241  The buzzer and brake light are switched on the high side using an N-channel MOSFET (BSS123NH6327XTSA1) that drives a P-channel MOSFET (BSS83PH6327XTSA1).
242 242  
243 -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).
244 -
245 245  [[image:1790181075885-591.png||height="343" width="367"]]
246 246  
247 -|=Function|=Buzzer / brake light
248 -|Supply|24 V
249 -|N-channel MOSFET|BSS123NH6327XTSA1 (Q803, Q804)
250 -|P-channel MOSFET|BSS83PH6327XTSA1 (Q801, Q802)
251 -|Gate resistor|1 kΩ (R807, R808)
252 -|Pull-down / pull-up / divider|10 kΩ (R805, R806, R809–R812)
253 -|Maximum output current|330 mA
254 -
255 255  ==== Pump ====
256 256  
257 257  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.
258 258  
259 -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.
260 -
261 261  [[image:1790181054296-268.png||height="306" width="371"]]
262 262  
263 -|=Function|=Pump 1 / Pump 2
264 -|Supply|12 V
265 -|N-channel MOSFET|BSS123NH6327XTSA1 (Q905, Q906)
266 -|P-channel MOSFET|BSC084P03NS3GATMA1 (Q903, Q904)
267 -|Gate resistor|1 kΩ (R913, R914)
268 -|Pull-down / pull-up|10 kΩ (R911, R912, R915, R916)
269 -|Maximum output current|5 A
270 -
271 271  == Known issues ==
272 272  
273 273  * The 12 V supply did not work.
... ... @@ -305,7 +305,7 @@
305 305  |0466.125NR|Electric Fuse, Very Fast Blow, 0.125A, 125VAC/VDC, 1206|F102|1|Littelfuse|0466.125NR
306 306  |776231-1|Conn Shrouded Header, HDR 35 POS, 4mm, Thru-Hole|J1|1|TE Connectivity|776231-1
307 307  |76829-0002|Mega-Fit Straight Male Header, 2x2, 5.7mm Pitch|J2|1|Molex|76829-0002
308 -|(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|
309 309  |44914-0401|Conn Header Vert 4POS 3mm|J4|1|Molex|44914-0401
310 310  |1461247-3|Relay, Gen Purpose, SPST, 8A, 24V|K1|1|TE Connectivity|OJ-SH-124LMH,000
311 311  |784234510|WE-CNSA Common Mode Line Filter, 1210, 7850Ω, 200mA|L1|1|Wurth Elektronik|784234510
... ... @@ -346,16 +346,12 @@
346 346  
347 347  == Changes ==
348 348  
349 -* Connector
350 -** Change main connector
351 351  * Circuits
352 352  ** More dedicated supply circuits
353 -** Keep the same current sensing
354 -** Increase the signal LED resistor on the PCB (the LEDs were too bright)
355 -* Microcontroller
356 -** Needs more inputs
259 +** Keep the same current rating
260 +** Adjust the signal LED resistor on the PCB
357 357  * Digital signals
358 -** Increase the green signal LED resistor on the PCB (the LEDs were too bright)
262 +** Adjust the signal LED resistor on the PCB
359 359  * 12 V supply
360 360  ** Three separate 12 V supplies:
361 361  *** Pump 1
... ... @@ -407,4 +407,4 @@
407 407  |(% style="width:472px" %) |(% style="width:650px" %)
408 408  |(% style="width:472px" %) |(% style="width:650px" %)
409 409  |(% style="width:472px" %) |(% style="width:650px" %)
410 -|(% style="width:472px" %) |(% style="width:650px" %)
314 +|(% style="width:472px" %) |(% style="width:650px" %)