-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreadme
76 lines (60 loc) · 3.46 KB
/
readme
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
adaESC Firmware Copyright (C) 2024 Ada Tessar
Schematics Copyright (C) 2024 Kooper Q and Ada Tessar
This program comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions
This project implements a sensorless Brushless DC (BLDC) motor controller using an Arduino and the MCP2515 CAN bus module. The controller uses open loop control for sensorless commutation and receives speed control commands via CAN bus.
- Supports minimum speed for reliable sensorless operation
- MOSFET-based motor drive
- canbus control (example in canbus-motor-test.py)
- user interface for testing directly over usb
Hardware Requirements
see /partslist
Pinout
+---------------------+
| Xiao ESP32-C3 |
+----------+ | |
| Xiao | | | 0 ----+
| CAN Bus | | | 1 ----|--+
| Module | | | 2 ----|--|--+
| (MCP2515)| | | 3 ----|--|--|--+
| | | | 4 ----|--|--|--|--+
| CS -----|-- 7 | | 5 ----|--|--|--|--|--+
| SO -----|-- MISO | | | | | | | |
| SI -----|-- MOSI | | +H L H L H L MOSFET Drivers
| SCK -----|-- SCK | | | | | | | | (for each phase)
+----------+ | | v v v v v v
| | Phase A B C
+---------------------+
+-------------------+
A --------------------| |
B --------------------| BLDC Motor |
C --------------------| |
| (e.g. T200/Neo ) |
| |
+-------------------+
Notes:
1. MOSFET connections:
- Phase A: High (Pin 5), Low (Pin 6)
- Phase B: High (Pin 7), Low (Pin 8)
- Phase C: High (Pin 9), Low (Pin 10)
3. CAN Bus Module connections:
- CS: Pin 7
- SO: MISO of Arduino
- SI: MOSI of Arduino
- SCK: SCK of Arduino
4. Double-check all connections before powering on the system!!!! (i maybe shorted a 12v battery :3)
Dependencies
- SPI library (built-in to arduino ide :3)
- MCP2515 library (https://github.com/autowp/arduino-mcp2515)
Setup
1. Connect the MOSFET driver circuit and BLDC motor according to the pinout.
2. Connect the MCP2515 CAN bus module to the Arduino.
3. Install the MCP2515 library in your Arduino IDE.
4. Compile and upload the code to your Arduino board (CHECK YOUR PINOUT AND WIRING NOW!!!!!!)
Usage
1. The motor controller listens for CAN messages with ID 0x123.
2. Send a 16-bit speed value (0-1000) via CAN to control the motor speed.
3. The controller will automatically handle commutation and speed control.
Ensure proper cooling and protection for the MOSFETs and motor during operation.
This code controls high-power electronics. Incorrect use can lead to equipment damage or personal injury. Always ensure proper insulation, cooling, and safety measures when working with motor controllers and power electronics.