Skip to the content
4 layersMagneticLevitation, the printed circuit board in 3D

MagneticLevitation

dweggg/MagneticLevitation

My take on one of those active magnetic levitation projects.

Copper layers
4
Thickness
1.6 mm
Parts
149
Nets
63
Pads
390
Tracks, vias
547, 577
Pours
18
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
30 Jul 2026
Updated
7 Nov 2026

Overview

MagneticLevitation is an open-source printed circuit board by dweggg, from the dweggg/MagneticLevitation repository on GitHub. It is a 4-layer board with 149 parts on 63 nets, routed with 547 tracks and 577 vias.

It is built around the CH32X035G8U6, XJNG2103 and GH39FKSW, with the INA199A1DCK, MT3608 and SSP7903P33FR among its other parts. Its parts include 36 resistors, 33 capacitors, 9 diodes, 7 ICs and 4 transistors.

Main components

12

README

hw/README.md

Issues

[ ] -> open [X] -> found

[X] 1. U1 (3V3 buck) was ordered with JLC PN C61063 (XLSEMI XL1509-5.0E1), which is 5V output, and it should've been C74193 (XLSEMI XL1509-3.3E1). Regardless, it outputs ~4.38V out with ~5.1V in. MCU can be flashed and all aber das ist nicht richtig.

[X] 2. U2 and L2 were removed bc that caused L2 to overheat, something might be wrong with gate drivers (chips or bootstrap). No power for now.

[X] 3. NTC reads 0V, so either pin is bad/misconfigured, or C31 is shorted or something (~0Ohm between TP13 and GND)

[X] 4. Some boards have the inductor rotated 90deg!! That would make the boost not work at all

[X] 5. Vbus sag with pulsed current in a coil around the board. I don't think it's a good idea to have inductors wound in the same axis as the coil we're trying to control, but is there any alternative?


Finding: my dumbass didn't configure short circuit rules and there's a group of vias to GND short circuiting the following nets to GND:

  • SWA
  • SWB
  • Gate AH/BH (before gate resistor)
  • Vboot_A/B (top side of bootstrap capacitor)
  • tempMeas

These are all in the bottom inner layer so it can't be seen on the PCB itself. Fix for now could be a nasty cut traces+magnet wire to destination but that'll require some proper tools... But maybe I'll skip that and probably order again when firmware is ~80% there.

So that explains issues #2 and #3: L2 was overheating bc it's rated at 100mA, and when the boost is disabled, the inductor is getting the 3.3V (well, 4.38V) to the gate driver supply, and since Vboot is shorted to GND, it goes trough R16/R17 to D6/D7 to GND... That's also why the power output (SWA/SWB) was shorted to ground, initially I thought it was some sort of gate driver protection magically turning on the low side switch but no lol.

I think I might have added those two via groups to lower switching loop inductance just before producing outputs and didn't run DRC... That was not a very expensive mistake but a very stupid one for sure. We can use rev1 for improving some other minor things found only after ordering.


Changes to be made

[ ] -> Pending [S] -> Schematic only [P] -> Partially done [X] -> Complete

  • 1. Remove violating via groups
  • 2. Swap LCSC PN for U1 (XLSEMI XL1509-3.3E1) -> see change #23
  • 3. Review LED resistor values: by lowering VCC to the correct 3.3V all LEDs should have a more reasonable brightness, increased to 220R anyways.
  • 4. Add external fixed voltage reference, maybe even replacing iRef divider? -> adjusting acq window seems to fix current. Pending tests with real current, but i think it's not needed now that we have a LDO (change #23)
  • 5. Add EEPROM?: I don't think we'd need it, and if we really needed it there's a ch32 eeprom emulation using flash, but will give it some thought. So far I don't think we need it, we have plenty of spare flash still with firmware close to 80% of the features, so crossing this one off.
  • 6. Review RST button behavior, or think of a way to hw reset the MCU, without firmware -> not necessary, but if needed current design could be made work like that if we flashed with a debugger and not with the bootloader
  • 7. Disconnect U2 (MT3608) output without EN pin, PMOS maybe -> not needed, drivers have UVLO at 5.5V
  • 8. Remove JLCJLCJLCJLC
  • 9. Move power supply section a bit down and leave more clearance with board edge
  • 10. Move debug/UART connectors and RST button, also turn them DNP
  • 11. Improve bootstrap layout? Works just fine even with the ugly rework, not needed.
  • 12. Replace expensive capacitors with something cheaper available as basic JLCPCBA: So far replaced all 22uF with 10uF. Pending proper review with BOM. removed yet another bom line! Was cheap enough already i think.
  • 13. Find cuter output connector? Maybe even SMD so back side stays clean -> found a cute but expensive wago. worth it imo
  • 14. Review Rgate, since at 12V V_GS, I_G_pk = 12V/10R = 1.2A which is bigger than XJNG2103 1A -> increased to 15R
  • 15. Try to reduce electrolytic cap height? If we have XY space we can have half capacitance, half height but x2 parts -> reduced to 5.6mm, same as connector, without decreasing C or increasing diameter. Doesnt make sense to go lower unless connector goes lower, which is not happening
  • 16. R16/R17 should be a bit bigger if they need to be hand replaced -> part of bootstrap, same thing, it works
  • 17. Testpoints for gates!!! Even if they're difficult to place
  • 18. Add revision number in sch and pcb
  • 19. Automatic bootloader entry with a MOSFET or similar instead of button (or parallel to button) -> meh not worth it. The flashing experience through bootloader is not that bad. TI is 200x worse even with a fancy jtag probe
  • 20. Add potentiometer for setpoint percentage of power
  • 21. Add sillkscreen for board ID
  • 22. Fix for issue #4 -> added FT Rotation Offset field and set to 0, but investigation is pending. Handled with an assembly remark in prod.
  • 23. Fix for issue #5: Replaced 3V3 buck with LDO which removes change #2. I was scared of the inductor saturating and maybe doing something funny with the analog rail. Playing safe even though it clearly works somehow in the current version.

To be verified w current rev before ordering:

[ ] -> Pending [P] -> Partially done [X] -> Complete

  • 1. Current measurement: At first it looked fine but I noticed it's a little bit asymmetrical with positive and negative setpoints. not a problem, since the important thing is that the controller is fast, not accurate. But maybe can be fine tuned. I think I'm closing it since it doesnt make much of a difference to have 200mA error when the position controller is jerking the current setpoint between -5A and 5A
  • 2. Magnetic field measurement: idk lol. It seems proportional to current without magnet (good!), and sort of checks out with what's expected of magnet. Other than that, lol idk. I guess it's fine. the control loop is more important than the accuracy of this sensor
  • 3. USB PD + Voltage measurement: ahh I'll have to be smart about how to test this, since my laptop's usb probably can't do very much. we have LEDs tho, that can be useful -> Firmware was able to request 20V from my laptop charger, I think we're good. but having debug + USBPD would be goated. My idea is to have the current comms stack routed to uart and using it instead of the usb port.
  • 4. Temperature measurement: cut traces+jump for avoiding issue #3, then thermal cam to verify I guess. So far the measurement seems reasonable with reality, but to be checked against a better measurement. I used a hairdryer to warm the board and i think it's accurate, my cooking skills allow me to distinguish temperatures above and below 60degC so i believe it's fine. its not that critical, even 10deg error would probably be ok. but i think we're at 2deg error, guesstimating. coil gets quite hot too, could we even measure that?
  • [P] 5. Gate driver: cut traces+jump (nasty, 6 nets), then program PWM open loop and use scope, verify bootstrap against SPICE -> after i reworked the board i didnt give a fuck and tested power directly without checking gate driver, i have no waveforms but the board is able to control current pretty well. 5W no problem! next up is 100W from USB PD.
  • [P] 6. Power: make em MOSFETs warm. Yeah so 5W so far. More to come after USB PD+comms

Parts

149
QtyValueFootprintReferences
45TestPoint_SmallTestPoint:TestPoint_Pad_D1.0mmTP1, TP2, TP10, TP11, TP12, TP13, TP14, TP15, TP16, TP17, TP18, TP19, TP20, TP21, TP22, TP23 +29
1310uFPCM_JLCPCB:C_0805C4, C5, C6, C7, C8, C9, C11, C14, C15, C16, C17, C18, C19
810kΩPCM_JLCPCB:R_0402R10, R11, R18, R19, R24, R25, R26, R29
70ΩPCM_JLCPCB:R_0402R3, R4, R5, R8, R13, R16, R17
4100nFPCM_JLCPCB:C_0402C2, C3, C29, C30
410nFPCM_JLCPCB:C_0603C13, C31, C32, C33
415ΩPCM_JLCPCB:R_0603R20, R21, R22, R23
4NCE3020QPCM_JLCPCB:NCE3020Q_DFN3.3x3.3-8LQ1, Q2, Q3, Q4
4RVT100UF35V34RV0158easyeda2kicad:CAP-SMD_BD6.3-L6.6-W6.6-LS7.2-FD_3C20, C21, C22, C23
4~PCM_JLCPCB:Hole, 3mmH1, H2, H3, H4
310nFPCM_JLCPCB:C_0402C1, C10, C28
3220ΩPCM_JLCPCB:R_0603R1, R14, R15
35.1kΩPCM_JLCPCB:R_0603R2, R35, R36
3FiducialFiducial:Fiducial_0.5mm_Mask1.5mmFID1, FID2, FID3
2100nFPCM_JLCPCB:C_0603C26, C27
21uFPCM_JLCPCB:C_0805C24, C25
21ΩPCM_JLCPCB:R_0603R27, R28
25.1kΩPCM_JLCPCB:R_0402R6, R7
2BAT54C_C916424easyeda2kicad:SOT-23-3_L2.9-W1.3-P1.90-LS2.4-BRD5, D6
2PESD5V0X1BT-Neasyeda2kicad:SOT-23-3_L2.9-W1.3-P1.90-LS2.4-BRD2, D3
2PZ254V-11-04P_C2691448easyeda2kicad:HDR-TH_4P-P2.54-V-MSWD1, UART1
2Tactile Button, 160gfPCM_JLCPCB:SW_TS-1088-AR02016S1, S2
2XJNG2103PCM_JLCPCB:SOIC-8_L5.0-W4.0-P1.27-LS6.0-BLU4, U5
10805Geasyeda2kicad:LED0805-R-RDLED1
1100ΩPCM_JLCPCB:R_0603R34
110pFPCM_JLCPCB:C_0603C12
11mR, 1%, 1Weasyeda2kicad:R1206R30
12.7kΩPCM_JLCPCB:R_0603R12
12061-602/998-404easyeda2kicad:CONN-SMD_2061-602-998-404J2
127uH 100mAeasyeda2kicad:IND-SMD_L2.9-W2.8L1
133kΩPCM_JLCPCB:R_0603R32
151kΩPCM_JLCPCB:R_0603R9
1CH32X035G8U6Package_DFN_QFN:WQFN-28-1EP_4x4mm_P0.4mm_EP2.7x2.7mmU2
1Connector, USB-TYPE-C-16PPCM_JLCPCB:TYPE-C-SMD_HX-TYPE-C-16PINJ1
1FC-2012HRK-620Deasyeda2kicad:LED0805-RDLED3
1GH39FKSWeasyeda2kicad:SOT-23-3_L2.9-W1.3-P1.90-LS2.4-BRU7
1HNTC0603-103F3450FAeasyeda2kicad:R0603R31
1INA199A1DCKPackage_TO_SOT_SMD:SOT-363_SC-70-6U6
1JER33X-1-14easyeda2kicad:RES-ADJ-SMD_JER33X-1-14R33
1LOGOLOGOG***
1MT3608Package_TO_SOT_SMD:SOT-23-6U3
1P6SMAJ33CAPCM_JLCPCB:D_DO-214AC(SMA)D1
1SS210easyeda2kicad:SMA_L4.3-W2.6-LS5.2-RDD4
1SSP7903P33FReasyeda2kicad:SOT-223-3_L6.5-W3.4-P2.30-LS7.0-BR-1U1
1whiteLEDSMDeasyeda2kicad:LED0805-R-RDLED2

Similar boards

  • 4 layers100 × 55 mmResonant converter, the printed circuit board in 3D

    Resonant converter

    Dominik-Workshop/resonant-converter

    Resonant converter PCB, 60V -> 12V 10A

    147 parts1MIT
  • 2 layers34 × 71.8 mmPutkiranta, the printed circuit board in 3D

    Putkiranta

    zouppen/putkiranta

    Jotakin sekoilua

    18 parts
  • 4 layers70 × 157.5 mmController Tv Lift, the printed circuit board in 3D

    Controller Tv Lift

    vyrubaev/TV-Lift-Controller

    TVLift Controller is an intelligent controller for TV lift and lower mechanisms, based on the ESP32 microcontroller.

    103 parts
  • 2 layers24.7 × 31.7 mmAsac esc rev a, the printed circuit board in 3D

    Asac esc rev a

    victorhook/asac-esc

    asac esc is an open source ESC written in pure C.

    54 parts8
  • 2 layers65 × 56 mmRadioberry preamp, the printed circuit board in 3D

    Radioberry preamp

    OE9SAU/SAUBerry9

    SDR TRX from Radioberry

    142 parts4
  • 2 layers100 × 100 mmDc brushed motor driver, the printed circuit board in 3D

    Dc brushed motor driver

    DsThakurRawat/PCB-AND-CHIP-DESIGN-WITH-AIML

    All production files have been generated in manufacturing/: - Gerber Layers (RS-274X): Copper, solder masks, silkscreen, and board edge cuts (manufacturing/gerbers/) - Excellon Drill Files: Plated and non-plated drill…

    122 parts
  • 2 layers55 × 55 mmRelay driver, the printed circuit board in 3D

    Relay driver

    IremAktas95/relay_driver

    🔗 Yüksek Performanslı Röle Sürücü Devresi

    34 parts
  • 2 layers145.7 × 107.8 mmTRS IO++, the printed circuit board in 3D

    TRS IO++

    apuder/TRS-IO

    TRS-IO gives a TRS-80 Model 1/III online capabilities and provides access to a variety of services. TRS-IO currently features the following capabilities:

    104 parts75GPL-3.0

Questions

What parts does the MagneticLevitation use?

149 parts, built around the CH32X035G8U6, XJNG2103, GH39FKSW and INA199A1DCK. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the MagneticLevitation KiCad files?

From the dweggg/MagneticLevitation repository on GitHub, at the commit this page was made from: the board is hw/MagneticLevitation.kicad_pcb and its schematic hw/MagneticLevitation.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the MagneticLevitation design in my own project?

Its repository states no licence, so its author keeps all rights: ask dweggg before reusing the design.