

KiCad CAN motor driver
H-bridge for DC motor controlled by CAN or PWM
- Size
- 66.8 × 42.4 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 78
- Nets
- 42
- Pads
- 231
- Tracks, vias
- 619, 138
- Pours
- 11
- Routed
- Yes
- KiCad
- KiCad 5 (file 20171130)
- Created
- 20 Mar 2021
- Updated
- 4 Sep 2021
Overview
KiCad CAN motor driver is an open-source printed circuit board by wjklimek1, from the wjklimek1/CAN_motor_controller repository on GitHub, published under the MIT licence. It is a 2-layer board of 66.8 × 42.4 mm with 78 parts on 42 nets, routed with 619 tracks and 138 vias.
It is built around the SN65HVD232D, BTN8982TA and SM4007. Its parts include 24 capacitors, 20 resistors, 9 diodes, 6 connectors and 3 ICs. It belongs with the robots and motor control boards and the STM32 boards of this library.
Main components
3SN65HVD232D
SOIC-8-40℃~+85℃ 17mA 1Mbps 3.3V CAN Transceiver SOIC-8 CAN Transceivers ROHSTexas InstrumentsCAN TransceiversBTN8982TA
TO-263-7-40℃~+150℃ 1 50A 8V~18V 欠压锁定、Overcurrent Protection、Over temperature protection、锁存保护、Short-Circuit Protection TO-263-7 Power Distribution Switches ROHSInfineon TechnologiesGate DriversSM4007
MELFMELF Diodes - General Purpose ROHSYONGYUTAIDiodes - General Purpose
README
README.mdCAN motor controller
This project is a device that allows control of DC motor by commands on CAN bus. It is based on STM32F103 microcontroller that interprets CAN messages and drives motor using two BTN8982 half-bridges configured as a single H-bridge.
Motor driving capabilities
DC motor is controlled with 21kHz PWM signal with 0-100% duty. PWM can be regulated in 0.1% steps - from 0 to 1000. Theoretically max current that MOSFETs can handle is 55A, but it can be futher limited by traces width and connectors. It was tested up to 10A, but should handle much more without any problems. Power supply voltage range is 5-24V.
| Parameter | Min | Max |
|---|---|---|
| voltage | 5V | 24V |
| motor current | 55A (10A tested) |
Motor is accelerated slowly by changing PWM duty. If received command orders to immediately set PWM to 100% from 0%, duty is increased slowly in default 10ms intervals. Therefore spinning motor to top speed will take 10s. This property can be disabled by setting "motor inertia" parameter to 0 (see CAN commands table).
CAN configuration
CAN bus in STM32F103 runs on 250kb/s by default. It can be set to other, hard coded value in the initialization function. Other supported baudrates are 500kb/s and 1Mb/s.
Heartbeat
Device emits "heartbeat" frame every 1s. It is an empty frame with ID = 0x444. Heartbeat can be disabled or it's period can be changed in 1s steps up to 255s.
CAN message structure
Device utilizes two identifiers - 0x444 for commands and 0x445 for requesting data. This values are hard coded too, but can be changed in canbus.h file. DLC of CAN messages is not really important, but it cannot be shorter than expected. In both commands and data requests first byte of message is code of command or data request. In commands next bytes represent values of command parameters. When data request is received by device, it will respond with frame of the same ID and data request code. Next bytes will contain requested data.
Commands
Following table shows available commands:
| Command | frame ID | DLC | byte 0 (command code) | byte 1 | byte 2 | byte 3 |
|---|---|---|---|---|---|---|
| Set speed | 0x444 | 4 | 1 | rotation direction (0 or 1) | MSB of speed | LSB of speed |
| Set max temperature internal | 0x444 | 2 | 2 | max internal temperature (uint8_t) in Celcius | - | - |
| Set max temperature external | 0x444 | 2 | 3 | max external temperature (uint8_t) in Celcius | - | - |
| Set max current | 0x444 | 4 | 4 | MSB of max current (mA) | LSB of max current (mA) | - |
| Emergency stop | 0x444 | 1 | 5 | - | - | - |
| Set inertia | 0x444 | 2 | 6 | Inertia (ms delay between changing PWM duty) | - | - |
| Set heartbeat | 0x444 | 2 | 7 | heartbeat interval (0 for disabled) | - | - |
Data requests
To request data, frame of ID = 0x445 and first byte containing data request code can be sent. Device will respond with similar frame, but containing data in next bytes.
Following table shows available data requests:
| Data request | frame ID | DLC | byte 0 (data request code) | byte 1 | byte 2 | byte 3 | byte 4 | byte 5 |
|---|---|---|---|---|---|---|---|---|
| Internal temperature | 0x445 | 2 | 1 | Internal temperature (uint8_t) in | Celcius | - | - | - |
| External temperature | 0x445 | 2 | 2 | External temperature (uint8_t) in | Celcius | - | - | - |
| Power supply voltage | 0x445 | 3 | 3 | MSB of voltage in mV | LSB of voltage in mV | - | - | - |
| Motor current | 0x445 | 3 | 4 | MSB of current in mA | LSB of current in mA | - | - | - |
| Speed | 0x445 | 4 | 5 | rotation direction (0 or 1) | MSB of speed | LSB of speed | - | - |
| Target speed | 0x445 | 4 | 6 | rotation direction (0 or 1) | MSB of speed | LSB of speed | - | - |
| Errors | 0x445 | 5 | 7 | MOSFET fault | overcurrent | overtemperature internal | overtemperature external | emergency stop |
Parts
78| Qty | Value | Footprint | References |
|---|---|---|---|
| 13 | 100nF | Capacitor_SMD:C_0805_2012Metric | C2, C3, C4, C5, C6, C7, C9, C11, C15, C16, C19, C20, C21 |
| 4 | 10k | Resistor_SMD:R_0805_2012Metric | R3, R5, R8, R13 |
| 4 | 10nF | Capacitor_SMD:C_0805_2012Metric | C10, C12, C22, C23 |
| 4 | 220nF | Capacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolder | C13, C14, C17, C18 |
| 4 | 470R | Resistor_SMD:R_0805_2012Metric | R12, R16, R17, R19 |
| 4 | D | Diode_SMD:D_PowerDI-123 | D6, D7, D8, D9 |
| 2 | 1.1k | Resistor_SMD:R_0805_2012Metric | R4, R14 |
| 2 | 1k | Resistor_SMD:R_0805_2012Metric | R15, R18 |
| 2 | 33k | Resistor_SMD:R_0805_2012Metric | R11, R20 |
| 2 | 3V | Diode_SMD:D_MiniMELF | D3, D4 |
| 2 | 47uF | Capacitor_SMD:CP_Elec_6.3x5.7 | C1, C8 |
| 2 | 6.8k | Resistor_SMD:R_0805_2012Metric | R9, R10 |
| 2 | BTN8982TA | Package_TO_SOT_SMD:TO-263-7_TabPin8 | Q1, Q2 |
| 2 | Jumper | Jumper:SolderJumper-2_P1.3mm_Bridged_Pad1.0x1.5mm | JP2, JP3 |
| 1 | 100nF | Capacitor_SMD:C_1206_3216Metric | C25 |
| 1 | 10R | Resistor_SMD:R_0805_2012Metric | R1 |
| 1 | 120R | Resistor_SMD:R_0805_2012Metric | R2 |
| 1 | 22k | Resistor_SMD:R_0805_2012Metric | R7 |
| 1 | 3V3 | TestPoint:TestPoint_THTPad_D1.0mm_Drill0.5mm | TP3 |
| 1 | 4.7uH | Inductor_SMD:L_Wuerth_MAPI-4030 | L1 |
| 1 | 51k | Resistor_SMD:R_0805_2012Metric | R6 |
| 1 | CAN | WK_lib:ScrewTerminal_2_P5.08mm | J6 |
| 1 | Ferrite_Bead | Inductor_SMD:L_1206_3216Metric | FB1 |
| 1 | Ferrite_Bead | Inductor_SMD:L_1206_3216Metric_Pad1.22x1.90mm_HandSolder | FB2 |
| 1 | Jumper | Jumper:SolderJumper-2_P1.3mm_Open_Pad1.0x1.5mm | JP1 |
| 1 | LED | LED_SMD:LED_0805_2012Metric_Castellated | D5 |
| 1 | LMR50410 | Package_TO_SOT_SMD:SOT-23-6_Handsoldering | U2 |
| 1 | LOGO | WK_lib:Anvil_10x10mm | G*** |
| 1 | MOTOR OUT | WK_lib:ScrewTerminal_2_P5.08mm | J5 |
| 1 | NTC 10k | Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolder | TH1 |
| 1 | NTC 10k | Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical | TH2 |
| 1 | NTC INT | TestPoint:TestPoint_THTPad_D1.0mm_Drill0.5mm | TP2 |
| 1 | POWER IN 24V | WK_lib:ScrewTerminal_2_P5.08mm | J4 |
| 1 | PWM OUT 1 | TestPoint:TestPoint_THTPad_D1.0mm_Drill0.5mm | TP5 |
| 1 | PWM OUT 2 | TestPoint:TestPoint_THTPad_D1.0mm_Drill0.5mm | TP7 |
| 1 | PWM_IN | Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical | J3 |
| 1 | SD24_SOD323 | Diode_SMD:D_SOD-323 | D2 |
| 1 | SM4007 | Diode_SMD:D_MELF | D1 |
| 1 | SN65HVD232 | Package_SO:SOIC-8_3.9x4.9mm_P1.27mm | U1 |
| 1 | STM32F103C8Tx | Package_QFP:LQFP-48_7x7mm_P0.5mm | U3 |
| 1 | SWDIO | Connector_PinHeader_2.54mm:PinHeader_1x05_P2.54mm_Vertical | J1 |
| 1 | UART | Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical | J2 |
| 1 | VIN | TestPoint:TestPoint_THTPad_D1.0mm_Drill0.5mm | TP1 |
Similar boards
- 4 layers100 × 77 mm

- 2 layers114 × 57 mm

Carte puissance
INSA-GEI/insa-nxpcup
Dépôt du département GEI de l'INSA Toulouse pour la compétition NXPCup
63 parts9GPL-3.0 - 2 layers50.3 × 45 mm

Titancore-7960 industrial
Glitch-Out-Hardware/TitanCore-7960
DIY Dual Channel Driver de Motores basado en BTS7960
36 parts3 - 2 layers140.3 × 89.3 mm

- 4 layers83.6 × 84.8 mm

Skateboard
86kkd/millionBoard
Amazing 500million sensor enetric skateboard use body center of gravity to control !!!
186 parts - 4 layers120 × 46 mm

TATAMI STM32-V2
AgustinPrietoValdez/competition-robots
Custom competition robots — maze/micromouse (MISA), sumo (TATAMI 1) & mini-sumo (RUCHO). KiCad PCBs, STM32/Arduino firmware, Fusion 360. National champion & international prizes — by EDNAROBOTICS.
115 partsMIT - 2 layers125 × 95 mm

Vanchor helm
AlexAsplund/vanchor-pcb
95×92 mm 2-layer board. Full H-bridge for a 12–24 V brushed trolling motor, controlled by the vanchor-helm board over one straight 8-wire cable. Two build variants share the same PCB:
69 parts - 4 layers80 × 120 mm

Questions
How big is the KiCad CAN motor driver PCB?
It measures 66.8 × 42.4 mm and has 2 copper layers, 1.6 mm thick.
What parts does the KiCad CAN motor driver use?
78 parts, built around the SN65HVD232D, BTN8982TA and SM4007. 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 KiCad CAN motor driver KiCad files?
From the wjklimek1/CAN_motor_controller repository on GitHub, at the commit this page was made from: the board is PCB_and_schematic/KiCad_CAN_motor_driver/KiCad_CAN_motor_driver.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.
Can I use the KiCad CAN motor driver design in my own project?
Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).