Skip to content

Commit 29a65a5

Browse files
Initial docs commit
Initial commit for product documentation
1 parent 71a223f commit 29a65a5

File tree

89 files changed

+3629
-36
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+3629
-36
lines changed

Documentation/README.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

Enclosure/README.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

README.md

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,48 @@
1-
SparkFun <PRODUCT NAME>
1+
SparkFun 3-Phase BLDC Motor Driver - TMC6300
22
========================================
33

4-
[![SparkFun Part Name](URL for picture of part)](URL for product on Sparkfun.com)
4+
[![SparkFun 3-Phase BLDC Motor Driver - TMC6300](https://cdn.sparkfun.com/assets/parts/2/1/6/9/6/21867-_SparkFun_Brushless_Motor_Drive-_01.jpg)](https://www.sparkfun.com/products/21867)
55

6-
[*SparkFun Part Name (SKU)*](URL for product on Sparkfun.com)
6+
[*SparkFun 3-Phase BLDC Motor Driver - TMC6300 (ROB-21867)*](https://www.sparkfun.com/products/21867)
7+
8+
The TMC6300 from [ADI + Trinamic](https://www.trinamic.com/) is a powerful and easy to use three phase motor driver that was designed to control our [Brushless Gimbal Motor](https://www.sparkfun.com/products/20441). However, it can be used to control any 3-phase [BLDC](https://en.wikipedia.org/wiki/Brushless_DC_electric_motor "brushless DC") or [PMSM](https://en.wikipedia.org/wiki/Synchronous_motor#Permanent-magnet "permanent magnet synchronous motor") motor with up to 2A (1.4A<sub>RMS</sub>) of total drive current. Separate high-side and low-side control of the three half-bridges allows for incredible control of each phase of the [motor commutation](https://fab.cba.mit.edu/classes/865.21/topics/power_electronics/commutation/#bldc-commutation). The driver also provides temperature and short circuit protections; and a diagnostic output to indicate system faults. With a 1.8V regulated power output and an operating voltage down to 2V, the TMC6300 is suitable for low-power microcontroller and battery powered designs (min. 2 AA/NiMh cells, or 1-2 Li-Ion cells).
9+
10+
Our board layout has been designed with the LEDs and labels facing up, IC down. This allows the thermal pad on the board to be access if cooling is required. Additionally, the breakout pins are specially aligned to fit perfectly onto a breadboard and hold the headers more perpendicular to facilitate assembly.
11+
12+
Controlling 3-phase motors is not trivial and this board requires 6 PWM signals to fully control one motor. We've found the [*Arduino Simple Field Oriented Control*](https://docs.simplefoc.com/) library to work well with the board; however, there are some hadware limitations such as [supported microconrollers for `6PWM Mode`](https://docs.simplefoc.com/microcontrollers#supported-microcontrollers). With additional considerations, for integrating [position sensors](https://docs.simplefoc.com/position_sensors) into the feedback control loop.
713

8-
<Basic description of the part.>
914

1015
Repository Contents
1116
-------------------
1217

13-
* **/Documentation** - Data sheets, additional product information
14-
* **/Enclosure** - Enclosure files
15-
* **/Firmware** - Example code
16-
* **/Hardware** - Eagle design files (.brd, .sch)
17-
* **/Libraries** - Libraries for use with the <PRODUCT NAME>
18-
* **/Production** - Production panel files (.brd)
19-
* **/Software** - Related software for the <PRODUCT NAME>
18+
* **[/docs](/docs/)** - Online documentation files
19+
* [arduino_examples](/docs/arduino_examples/) - Example code
20+
* [board_files](/docs/board_files/) - Files for the product design
21+
* [Eagle design files](/docs/board_files/eagle_files.zip) (.zip)
22+
* [Schematic](/docs/board_files/schematic.pdf) (.pdf)
23+
* [Dimensions](/docs/board_files/dimensions.pdf) (.pdf)
24+
* [component_documentation](/docs/component_documentation/) - Datasheets for hardware components
25+
* [img/hookup_guide/](/docs/img/hookup_guide/) - Images for hookup guide documentation
26+
* **[/Hardware](/Hardware/)** - Eagle design files (.brd, .sch)
27+
2028

2129
Documentation
2230
--------------
23-
* **[Library](GitHub library URL)** - <LANGUAGE> library for the <PRODUCT NAME>.
24-
* **[Hookup Guide](Learn.SparkFun URL)** - Basic hookup guide for the <PRODUCT NAME>.
25-
* **[SparkFun Fritzing repo](https://github.com/sparkfun/Fritzing_Parts)** - Fritzing diagrams for SparkFun products.
26-
* **[SparkFun 3D Model repo](https://github.com/sparkfun/3D_Models)** - 3D models of SparkFun products.
27-
* **[SparkFun Graphical Datasheets](https://github.com/sparkfun/Graphical_Datasheets)** -Graphical Datasheets for various SparkFun products.
31+
* **[Hookup Guide (mkdocs)](http://docs.sparkfun.com/SparkFun_Three_Phase_Motor_Driver-TMC6300/)** - Hookup guide for the USB-C Host Shield hosted by GitHub pages.
2832

29-
Product Versions
33+
*Need to download or print our hookup guide?*
34+
35+
* [Print *(Print to PDF)* from Single-Page View](http://docs.sparkfun.com/SparkFun_Three_Phase_Motor_Driver-TMC6300/hookup_guide/single_page)
36+
* [Download PDF](http://docs.sparkfun.com/SparkFun_Three_Phase_Motor_Driver-TMC6300/assets/board_files/hookup_guide.pdf) *(Beta - Mostly works, but some attributes may be broken.)*
37+
38+
Product Variants
3039
----------------
31-
* [Part SKU](part URL)- Basic part and short description here
32-
* [Retail part SKU](retail URL)- Retail packaging of standard description here
33-
* [Any other parts this repo covers](any other URLs) - Description of said parts
40+
* [ROB-21867](https://www.sparkfun.com/products/21867)- v1.0, Initial Release
3441

3542
Version History
3643
---------------
37-
* [vExxFxxZxxHxxLxxSxx](URL for tag specific to this version) - Description
38-
* [vEyyFyyZyyHyyLyySyy](URL for tag specific to this version) - Description
44+
* [v01](https://github.com/sparkfun/SparkFun_Three_Phase_Motor_Driver-TMC6300/releases/tag/v10) - Initial Release
45+
3946

4047
License Information
4148
-------------------
@@ -44,10 +51,8 @@ This product is _**open source**_!
4451

4552
Please review the LICENSE.md file for license information.
4653

47-
If you have any questions or concerns on licensing, please contact technical support on our [SparkFun forums](https://forum.sparkfun.com/viewforum.php?f=152).
54+
If you have any questions or concerns about licensing, please contact technical support on our [SparkFun forums](https://forum.sparkfun.com/viewforum.php?f=152).
4855

4956
Distributed as-is; no warranty is given.
5057

5158
- Your friends at SparkFun.
52-
53-
_<COLLABORATION CREDIT>_

docs/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
docs directory
2+
====================
3+
This folder should contain the files for the product documentation
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// BLDC driver standalone example
2+
#include <SimpleFOC.h>
3+
4+
// BLDC driver instance
5+
BLDCDriver6PWM driver = BLDCDriver6PWM(5, 6, 9,10, 3, 11);
6+
7+
void setup() {
8+
9+
// pwm frequency to be used [Hz]
10+
// for atmega328 fixed to 32kHz
11+
// esp32/stm32/teensy configurable
12+
driver.pwm_frequency = 32000;
13+
// power supply voltage [V]
14+
driver.voltage_power_supply = 5;
15+
// Max DC voltage allowed - default voltage_power_supply
16+
driver.voltage_limit = 5;
17+
// daad_zone [0,1] - default 0.02f - 2%
18+
driver.dead_zone = 0.05f;
19+
20+
// driver init
21+
driver.init();
22+
23+
// enable driver
24+
driver.enable();
25+
26+
_delay(1000);
27+
}
28+
29+
void loop() {
30+
driver.setPwm(5,0,0);
31+
_delay(1000);
32+
33+
driver.setPwm(0,5,0);
34+
_delay(1000);
35+
}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
// Open loop motor control example
2+
#include <SimpleFOC.h>
3+
4+
5+
// BLDC motor & driver instance
6+
// BLDCMotor motor = BLDCMotor(pole pair number);
7+
BLDCMotor motor = BLDCMotor(7);
8+
// BLDCDriver3PWM driver = BLDCDriver3PWM(pwmA, pwmB, pwmC, Enable(optional));
9+
BLDCDriver6PWM driver = BLDCDriver6PWM(5, 6, 9,10, 3, 11);
10+
11+
// Stepper motor & driver instance
12+
//StepperMotor motor = StepperMotor(50);
13+
//StepperDriver4PWM driver = StepperDriver4PWM(9, 5, 10, 6, 8);
14+
15+
16+
//target variable
17+
float target_velocity = 6;
18+
19+
// // instantiate the commander
20+
Commander command = Commander(Serial);
21+
// void doTarget(char* cmd) { command.scalar(&target_velocity, cmd); }
22+
// void doLimit(char* cmd) { command.scalar(&motor.voltage_limit, cmd); }
23+
24+
void setup() {
25+
26+
// driver config
27+
// power supply voltage [V]
28+
driver.voltage_power_supply = 5;
29+
// limit the maximal dc voltage the driver can set
30+
// as a protection measure for the low-resistance motors
31+
// this value is fixed on startup
32+
driver.voltage_limit = 5;
33+
// pwm frequency to be used [Hz]
34+
// for atmega328 fixed to 32kHz
35+
// esp32/stm32/teensy configurable
36+
driver.pwm_frequency = 32000;
37+
38+
39+
driver.init();
40+
// link the motor and the driver
41+
motor.linkDriver(&driver);
42+
43+
// limiting motor movements
44+
// limit the voltage to be set to the motor
45+
// start very low for high resistance motors
46+
// current = voltage / resistance, so try to be well under 1Amp
47+
motor.voltage_limit = 3; // [V]
48+
49+
// open loop control config
50+
motor.controller = MotionControlType::velocity_openloop;
51+
52+
// init motor hardware
53+
motor.init();
54+
55+
// add target command T
56+
// command.add('T', doTarget, "target velocity");
57+
// command.add('L', doLimit, "voltage limit");
58+
59+
Serial.begin(115200);
60+
Serial.println("Motor ready!");
61+
Serial.println("Set target velocity [rad/s]");
62+
_delay(1000);
63+
64+
}
65+
66+
void loop() {
67+
68+
// open loop velocity movement
69+
// using motor.voltage_limit and motor.velocity_limit
70+
motor.move(target_velocity);
71+
72+
// user communication
73+
command.run();
74+
75+
76+
}

docs/arduino_examples/DC/DC.ino

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// BLDC driver standalone example
2+
#include <SimpleFOC.h>
3+
4+
// BLDC driver instance
5+
BLDCDriver6PWM driver = BLDCDriver6PWM(5, 6, 9,10, 3, 11);
6+
7+
void setup() {
8+
9+
// pwm frequency to be used [Hz]
10+
// for atmega328 fixed to 32kHz
11+
// esp32/stm32/teensy configurable
12+
driver.pwm_frequency = 32000;
13+
// power supply voltage [V]
14+
driver.voltage_power_supply = 5;
15+
// Max DC voltage allowed - default voltage_power_supply
16+
driver.voltage_limit = 5;
17+
// daad_zone [0,1] - default 0.02f - 2%
18+
driver.dead_zone = 0.05f;
19+
20+
// driver init
21+
driver.init();
22+
23+
// enable driver
24+
driver.enable();
25+
26+
_delay(1000);
27+
}
28+
29+
void loop() {
30+
driver.setPwm(5,0,0);
31+
_delay(1000);
32+
33+
driver.setPwm(0,5,0);
34+
_delay(1000);
35+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
## Hardware Assembly
2+
3+
Users should already have followed the instructions from the [component assembly](../../component_assembly) and [example setups](../../hardware_assembly) sections to setup their hardware for this example.
4+
5+
<figure markdown>
6+
[![](../img/hookup_guide/example-BLDC_motor.jpg){ width="200" }](../img/hookup_guide/example-BLDC_motor.jpg "Click to enlarge")
7+
<figcaption markdown>
8+
A graphical representation of the connections between the [RedBoard Plus](https://www.sparkfun.com/products/18158) and a [breadboard](https://www.sparkfun.com/products/12002) with the [TMC6300 motor driver](https://www.sparkfun.com/products/21867) attached.
9+
</figcaption>
10+
</figure>
11+
12+
13+
### RedBoard Plus to TMC6300
14+
15+
Connect the following pins from the RedBoard Plus to the TMC6300.
16+
17+
--8<-- "./docs/hardware_assembly.md:12:26"
18+
19+
### Connecting the Gimbal Motor
20+
21+
--8<-- "./docs/hardware_assembly.md:45:52"
22+
23+
### Powering the TMC6300
24+
25+
If users are unable to find a suitable power source, we have found that the 5V power output from the RedBoard Plus is sufficient to drive the gimbal motor, under a no load condition at low speeds.
26+
27+
--8<-- "./docs/hardware_assembly.md:83:97"
28+
29+
30+
## Example Code
31+
32+
After installing and setting up the Arduino IDE and the Simple FOC Arduino library, users will need to upload the following example code to the RedBoard Plus. This code can be copied or downloaded below:
33+
34+
<center>
35+
[:octicons-download-16:{ .heart } Download `BLDC.ino` Example Code](../BLDC/BLDC.ino){ .md-button .md-button--primary }
36+
</center>
37+
38+
!!! code "Example Code"
39+
``` c++ title="BLDC.ino"
40+
--8<-- "./docs/arduino_examples/BLDC/BLDC.ino"
41+
```
42+
43+
### Running the Motor
44+
45+
Be default, the motor should spin automatically. However, if users wish to control the speed of the motor, they can uncomment lines **21-22** and **56-57** of code and reprogram the RedBoard Plus.
46+
47+
??? code "Code Changes Highlighted"
48+
Uncomment the following lines of code (**21-22** and **56-57**):
49+
50+
``` c++ hl_lines="21-22 56-57" title="BLDC.ino"
51+
--8<-- "./docs/arduino_examples/BLDC/BLDC.ino"
52+
```
53+
54+
In order to drive the motor, users will need to access the [serial monitor](https://learn.sparkfun.com/tutorials/8) and provide the [commands](https://docs.simplefoc.com/commands_source) necessary to drive the motor. A full list of the available commands can be found in the [Simple FOC Arduino library documentation](https://docs.simplefoc.com/commands_source). However, only the `T` and `L` commands are enabled in the example code.
55+
56+
* Sending a `T` command will set the target motor velocity in rads/s
57+
* Example - Entering `T6` into the serial monitor, will set the target motor velocity to 6 radians/s.
58+
* Sending a `L` command will set the voltage limit of the motor driver and in turn, the current limit *(voltage_limit / motor_resistance)*
59+
* Example - Entering `L5` into the serial monitor, will set the voltage limit to 5V and the current limit to .5A *(5V/10&ohm;)*.
60+
61+
!!! tip "Baud Rate"
62+
THe serial monitor baud rate should be configured to 115200bps.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
## Hardware Assembly
2+
3+
Users should already have followed the instructions from the [component assembly](../../component_assembly) and [example setups](../../hardware_assembly) sections to setup their hardware for this example.
4+
5+
<figure markdown>
6+
[![](../img/hookup_guide/example-DC_motor.jpg){ width="200" }](../img/hookup_guide/example-DC_motor.jpg "Click to enlarge")
7+
<figcaption markdown>
8+
A graphical representation of the connections between the [RedBoard Plus](https://www.sparkfun.com/products/18158) and a [breadboard](https://www.sparkfun.com/products/12002) with the [TMC6300 motor driver](https://www.sparkfun.com/products/21867) attached.
9+
</figcaption>
10+
</figure>
11+
12+
13+
### RedBoard Plus to TMC6300
14+
15+
Connect the following pins from the RedBoard Plus to the TMC6300.
16+
17+
--8<-- "./docs/hardware_assembly.md:12:26"
18+
19+
### Connecting the DC Motor
20+
21+
--8<-- "./docs/hardware_assembly.md:71:71"
22+
23+
### Powering the TMC6300
24+
25+
If users are unable to find a suitable power source, we have found that the 5V power output from the RedBoard Plus is sufficient to drive the gimbal motor, under a no load condition at low speeds.
26+
27+
--8<-- "./docs/hardware_assembly.md:83:97"
28+
29+
30+
## Example Code
31+
32+
After installing and setting up the Arduino IDE and the Simple FOC Arduino library, users will need to upload the following example code to the RedBoard Plus. This code can be copied or downloaded below:
33+
34+
<center>
35+
[:octicons-download-16:{ .heart } Download `DC.ino` Example Code](../DC/DC.ino){ .md-button .md-button--primary }
36+
</center>
37+
38+
!!! code "Example Code"
39+
``` c++ title="DC.ino"
40+
--8<-- "./docs/arduino_examples/DC/DC.ino"
41+
```
42+
43+
### Running the Motor
44+
45+
Be default, the motor should spin automatically. However, if users wish to control the motor, they can modify lines **30** and **33** of code and reprogram the RedBoard Plus. These lines control the high and low-side MOSFETS of the H-bridge directly through pins `5`, `6`, `9`, and `10`.
46+
47+
??? code "Code Changes Highlighted"
48+
MOdify the following lines of code (**30** and **33**):
49+
50+
``` c++ hl_lines="30 33" title="DC.ino"
51+
--8<-- "./docs/arduino_examples/DC/DC.ino"
52+
```
53+
54+
* The PWM voltage value `driver.setPwm(voltage_value,0,0)` affects the speed of the motor.
55+
* The position of this value inr elation to the PWM drive channel `driver.setPwm(channel_v,channel_w,0)` affects the direction.
56+
57+
??? tip
58+
Users may also be interested in the [SimpleDC Motor library](https://docs.simplefoc.com/dc_motors_library) to drive DC motors with the Simple FOC Arduino library.

0 commit comments

Comments
 (0)