Skip to the content
2 layers66.8 × 42.4 mmKiCad CAN motor driver, the printed circuit board in 3D

KiCad CAN motor driver

wjklimek1/CAN_motor_controller7

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

3

README

README.md

CAN 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.

ParameterMinMax
voltage5V24V
motor current55A (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:

Commandframe IDDLCbyte 0 (command code)byte 1byte 2byte 3
Set speed0x44441rotation direction (0 or 1)MSB of speedLSB of speed
Set max temperature internal0x44422max internal temperature (uint8_t) in Celcius--
Set max temperature external0x44423max external temperature (uint8_t) in Celcius--
Set max current0x44444MSB of max current (mA)LSB of max current (mA)-
Emergency stop0x44415---
Set inertia0x44426Inertia (ms delay between changing PWM duty)--
Set heartbeat0x44427heartbeat 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 requestframe IDDLCbyte 0 (data request code)byte 1byte 2byte 3byte 4byte 5
Internal temperature0x44521Internal temperature (uint8_t) inCelcius---
External temperature0x44522External temperature (uint8_t) inCelcius---
Power supply voltage0x44533MSB of voltage in mVLSB of voltage in mV---
Motor current0x44534MSB of current in mALSB of current in mA---
Speed0x44545rotation direction (0 or 1)MSB of speedLSB of speed--
Target speed0x44546rotation direction (0 or 1)MSB of speedLSB of speed--
Errors0x44557MOSFET faultovercurrentovertemperature internalovertemperature externalemergency stop

Parts

78
QtyValueFootprintReferences
13100nFCapacitor_SMD:C_0805_2012MetricC2, C3, C4, C5, C6, C7, C9, C11, C15, C16, C19, C20, C21
410kResistor_SMD:R_0805_2012MetricR3, R5, R8, R13
410nFCapacitor_SMD:C_0805_2012MetricC10, C12, C22, C23
4220nFCapacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolderC13, C14, C17, C18
4470RResistor_SMD:R_0805_2012MetricR12, R16, R17, R19
4DDiode_SMD:D_PowerDI-123D6, D7, D8, D9
21.1kResistor_SMD:R_0805_2012MetricR4, R14
21kResistor_SMD:R_0805_2012MetricR15, R18
233kResistor_SMD:R_0805_2012MetricR11, R20
23VDiode_SMD:D_MiniMELFD3, D4
247uFCapacitor_SMD:CP_Elec_6.3x5.7C1, C8
26.8kResistor_SMD:R_0805_2012MetricR9, R10
2BTN8982TAPackage_TO_SOT_SMD:TO-263-7_TabPin8Q1, Q2
2JumperJumper:SolderJumper-2_P1.3mm_Bridged_Pad1.0x1.5mmJP2, JP3
1100nFCapacitor_SMD:C_1206_3216MetricC25
110RResistor_SMD:R_0805_2012MetricR1
1120RResistor_SMD:R_0805_2012MetricR2
122kResistor_SMD:R_0805_2012MetricR7
13V3TestPoint:TestPoint_THTPad_D1.0mm_Drill0.5mmTP3
14.7uHInductor_SMD:L_Wuerth_MAPI-4030L1
151kResistor_SMD:R_0805_2012MetricR6
1CANWK_lib:ScrewTerminal_2_P5.08mmJ6
1Ferrite_BeadInductor_SMD:L_1206_3216MetricFB1
1Ferrite_BeadInductor_SMD:L_1206_3216Metric_Pad1.22x1.90mm_HandSolderFB2
1JumperJumper:SolderJumper-2_P1.3mm_Open_Pad1.0x1.5mmJP1
1LEDLED_SMD:LED_0805_2012Metric_CastellatedD5
1LMR50410Package_TO_SOT_SMD:SOT-23-6_HandsolderingU2
1LOGOWK_lib:Anvil_10x10mmG***
1MOTOR OUTWK_lib:ScrewTerminal_2_P5.08mmJ5
1NTC 10kResistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolderTH1
1NTC 10kConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalTH2
1NTC INTTestPoint:TestPoint_THTPad_D1.0mm_Drill0.5mmTP2
1POWER IN 24VWK_lib:ScrewTerminal_2_P5.08mmJ4
1PWM OUT 1TestPoint:TestPoint_THTPad_D1.0mm_Drill0.5mmTP5
1PWM OUT 2TestPoint:TestPoint_THTPad_D1.0mm_Drill0.5mmTP7
1PWM_INConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ3
1SD24_SOD323Diode_SMD:D_SOD-323D2
1SM4007Diode_SMD:D_MELFD1
1SN65HVD232Package_SO:SOIC-8_3.9x4.9mm_P1.27mmU1
1STM32F103C8TxPackage_QFP:LQFP-48_7x7mm_P0.5mmU3
1SWDIOConnector_PinHeader_2.54mm:PinHeader_1x05_P2.54mm_VerticalJ1
1UARTConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ2
1VINTestPoint:TestPoint_THTPad_D1.0mm_Drill0.5mmTP1

Similar boards

  • 4 layers100 × 77 mmXT V1, the printed circuit board in 3D

    XT V1

    Synthron/SynPLC

    STM32-based PLC system

    92 parts1
  • 2 layers114 × 57 mmCarte puissance, the printed circuit board in 3D

    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 mmTitancore-7960 industrial, the printed circuit board in 3D

    Titancore-7960 industrial

    Glitch-Out-Hardware/TitanCore-7960

    DIY Dual Channel Driver de Motores basado en BTS7960

    36 parts3
  • 2 layers140.3 × 89.3 mmAVPCB, the printed circuit board in 3D

    AVPCB

    Paarseus/AVPCB

    Autonomous Vehicle PCB - KiCad project

    48 parts1
  • 4 layers83.6 × 84.8 mmSkateboard, the printed circuit board in 3D

    Skateboard

    86kkd/millionBoard

    Amazing 500million sensor enetric skateboard use body center of gravity to control !!!

    186 parts
  • 4 layers120 × 46 mmTATAMI STM32-V2, the printed circuit board in 3D

    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 mmVanchor helm, the printed circuit board in 3D

    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

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).