Changes for page Power controller

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

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

Summary

Details

Page properties
Content
... ... @@ -15,6 +15,8 @@
15 15  
16 16  {{toc/}}
17 17  
18 +
19 +
18 18  == Pinout ==
19 19  
20 20  === Connector pinout ===
... ... @@ -106,20 +106,42 @@
106 106  
107 107  == Distribution circuit ==
108 108  
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 +
109 109  [[image:1790100104451-169.png]]
110 110  
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 +
111 111  === Green LED ===
112 112  
113 -The green LED indicates whether the fuse is intact.
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.
114 114  
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 +
115 115  [[image:1790098808447-123.png]]
116 116  
117 117  === Current sense ===
118 118  
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 +
119 119  ==== Shunt resistor ====
120 120  
121 121  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).
122 122  
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 +
123 123  [[image:1790100157872-786.png]]
124 124  
125 125  ==== Amplifier ====
... ... @@ -126,10 +126,22 @@
126 126  
127 127  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.
128 128  
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 +
129 129  ==== Filter ====
130 130  
131 131  The filter is a low-pass filter with a cutoff frequency of 1.6 kHz.
132 132  
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 +
133 133  === Power amplifier ===
134 134  
135 135  [[image:1790101431805-672.png]]
... ... @@ -136,12 +136,31 @@
136 136  
137 137  === Voltage measurement ===
138 138  
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 +
139 139  A voltage divider with a ratio of 1:11 is used, so 24 V corresponds to 2.182 V on the microcontroller pin.
140 140  
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 +
141 141  [[image:1790101449150-901.png]]
142 142  
143 143  === 12 V supply (did not work) ===
144 144  
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 +
145 145  The buck converter overheated under load and made a whining sound.
146 146  
147 147  [[image:1790102044737-969.png||height="368" width="925"]]
... ... @@ -152,30 +152,67 @@
152 152  
153 153  Uses the standard Align template.
154 154  
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 +
155 155  == Control logic ==
156 156  
157 157  === Sourced from the microcontroller ===
158 158  
159 -The programmable red light is part of the same RGB LED.
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.
160 160  
161 -Current is sourced directly from the microcontroller through a 350 Ω series resistor.
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.
162 162  
163 163  [[image:1790098512666-432.png]]
164 164  
165 165  === High-side switching ===
166 166  
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 +
167 167  ==== Buzzer and brake light ====
168 168  
169 169  The buzzer and brake light are switched on the high side using an N-channel MOSFET (BSS123NH6327XTSA1) that drives a P-channel MOSFET (BSS83PH6327XTSA1).
170 170  
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 +
171 171  [[image:1790181075885-591.png||height="343" width="367"]]
172 172  
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 +
173 173  ==== Pump ====
174 174  
175 175  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.
176 176  
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 +
177 177  [[image:1790181054296-268.png||height="306" width="371"]]
178 178  
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 +
179 179  == Known issues ==
180 180  
181 181  * The 12 V supply did not work.
... ... @@ -213,7 +213,7 @@
213 213  |0466.125NR|Electric Fuse, Very Fast Blow, 0.125A, 125VAC/VDC, 1206|F102|1|Littelfuse|0466.125NR
214 214  |776231-1|Conn Shrouded Header, HDR 35 POS, 4mm, Thru-Hole|J1|1|TE Connectivity|776231-1
215 215  |76829-0002|Mega-Fit Straight Male Header, 2x2, 5.7mm Pitch|J2|1|Molex|76829-0002
216 -|(4 pin header)|2.54mm pitch 1x4 vertical header|J3|1|Generic|
308 +|(4 pin header)|2.54mm pitch 1x4 vertical header|J3|1|Generic|
217 217  |44914-0401|Conn Header Vert 4POS 3mm|J4|1|Molex|44914-0401
218 218  |1461247-3|Relay, Gen Purpose, SPST, 8A, 24V|K1|1|TE Connectivity|OJ-SH-124LMH,000
219 219  |784234510|WE-CNSA Common Mode Line Filter, 1210, 7850Ω, 200mA|L1|1|Wurth Elektronik|784234510
... ... @@ -254,12 +254,16 @@
254 254  
255 255  == Changes ==
256 256  
349 +* Connector
350 +** Change main connector
257 257  * Circuits
258 258  ** More dedicated supply circuits
259 -** Keep the same current rating
260 -** Adjust the signal LED resistor on the PCB
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
261 261  * Digital signals
262 -** Adjust the signal LED resistor on the PCB
358 +** Increase the green signal LED resistor on the PCB (the LEDs were too bright)
263 263  * 12 V supply
264 264  ** Three separate 12 V supplies:
265 265  *** Pump 1
... ... @@ -311,4 +311,4 @@
311 311  |(% style="width:472px" %) |(% style="width:650px" %)
312 312  |(% style="width:472px" %) |(% style="width:650px" %)
313 313  |(% style="width:472px" %) |(% style="width:650px" %)
314 -|(% style="width:472px" %) |(% style="width:650px" %)
410 +|(% style="width:472px" %) |(% style="width:650px" %)