|
| 1 | +--- |
| 2 | +layout: default |
| 3 | +title: Connecting the hardware |
| 4 | +parent: Starting with Mini |
| 5 | +description: "Connecting SimpleFOCMini with your hardware." |
| 6 | +nav_order: 1 |
| 7 | +permalink: /mini_connect_hardware |
| 8 | +grand_parent: <span class="simple">Simple<span class="foc">FOC</span>Mini</span> |
| 9 | +grand_grand_parent: <span class="simple">Simple<span class="foc">FOC</span> Boards</span> |
| 10 | +--- |
| 11 | + |
| 12 | +# Connecting the hardware |
| 13 | + |
| 14 | +<p> |
| 15 | +<img src="extras/Images/mini_gif1.gif" class="width50"> |
| 16 | +</p> |
| 17 | + |
| 18 | +Connecting the <span class="simple">Simple<span class="foc">FOC</span>Mini</span> to the microcontroller, BLDC motor and power-supply is very straight forward. |
| 19 | + |
| 20 | +<p> |
| 21 | +<img src="extras/Images/mini_where.png" class="width40"> |
| 22 | +</p> |
| 23 | + |
| 24 | +## Microcontroller |
| 25 | +- <span class="simple">Simple<span class="foc">FOC</span>Mini</span> is designed as a standalone BLDC driver, which will basically work with any microcontroller. |
| 26 | +- This board has 10 pins exposed for the connection to the microcontroller |
| 27 | + |
| 28 | +<p> |
| 29 | +<img src="extras/Images/mini_req_opt.png" class="width30"> |
| 30 | +</p> |
| 31 | + |
| 32 | +There are 5 pins that are required to be connected |
| 33 | + |
| 34 | +Pin Name | Description |
| 35 | +--- | --- |
| 36 | +GND | Ground (common ground) |
| 37 | +IN1 | PWM input phase 1 |
| 38 | +IN2 | PWM input phase 2 |
| 39 | +IN3 | PWM input phase 3 |
| 40 | +EN | Driver Enable |
| 41 | + |
| 42 | +These pins need to ba connected whenever using the <span class="simple">Simple<span class="foc">FOC</span>Mini</span>. The 3 pwm pins and the enable pin are used to control the DRV8313 driver and in terms of the <span class="simple">Simple<span class="foc">FOC</span>library</span> they correspond to the entries of the `BLDCDriver3PWM` class. The common ground pin is very important as well in order to make sure that all the PWM and Enable pins are read properly by the driver chip. Once you decide which pins you will be using for `INx` and `EN` pins you will be able to porvide them to the `BLDCDriver3PWM` class in your Arduino sketch. |
| 43 | + |
| 44 | +```cpp |
| 45 | +BLDCDriver3PWM driver = BLDCDriver3PWM(IN1, IN2, IN3, EN); |
| 46 | +``` |
| 47 | + |
| 48 | +In addition to these pins there are 5 pins that are optional. |
| 49 | + |
| 50 | +Pin Name | Description |
| 51 | +--- | --- |
| 52 | +3.3V | 3.3V output - **NOT INPUT** |
| 53 | +GND | Ground |
| 54 | +nRT | Reset (active LOW) |
| 55 | +nSP | Sleep (active LOW) |
| 56 | +nFT | Fault output (active LOW) |
| 57 | + |
| 58 | +<span class="simple">Simple<span class="foc">FOC</span>Mini</span> is based on the DRV8313 driver which has integrated 3.3V regulator which might be useful in some applications to power a sensor or similar. The 3.3v pin of the <span class="simple">Simple<span class="foc">FOC</span>Mini</span> can therefore be used as a 3.3v source pin with the maximum current output of 10mA. Both GND pins exposed in the <span class="simple">Simple<span class="foc">FOC</span>Mini</span>'s header are connected to the same ground, so you can choose the one which is more convenient to your application. |
| 59 | +<blockquote class="warning"><p class="heading">BEWARE: 3.3V LDO Power limitations</p> |
| 60 | +DRV8313 comes with the 3.3V voltage regulator and it is connected to the <span class="simple">Simple<span class="foc">FOC</span>Mini</span>'s 3.3V pin. However it has a limitation of 10mA, which is in general not enough to power a microcontroller. But it might be enough to power a LED light or some position sensors. |
| 61 | +</blockquote> |
| 62 | + |
| 63 | +Pin `nFT` (fault) is an active LOW output of the <span class="simple">Simple<span class="foc">FOC</span>Mini</span> which can be read to verify if the DRV8313 driver is working properly. If this pin is in LOW it means the DRV8313 is its fault state and it cannot drive the motor. Then the pin `nRT` (reset), which is also active LOW, can be used to reset the DRV8313 driver to reinitialise its internal state and exit the fault state, this cannot be done by simply toggling the enable pin. Finally the pin `nSP` (sleep) is an active LOW pin that puts the DRV8313 in the low-power sleep mode, consuming the current of under 1uA. |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | +## BLDC motor |
| 70 | +- Motor phases `a`, `b` and `c` are connected directly the motor terminal connector `M1`,`M2` and `M3` |
| 71 | + |
| 72 | +<blockquote class="warning"><p class="heading">BEWARE: Power limitations</p> |
| 73 | +<span class="simple">Simple<span class="foc">FOC</span>Mini</span> is designed for gimbal motors with internal resistance higher than R>10Ohm. The absolute maximal current of this board is 5A. Please make sure when using this board in your projects that the BLDC motor used does comply with these limits. <br> |
| 74 | +If you still want to use this driver with the BLDC motors with very low resistance R < 1Ohm make sure to limit the voltage set to the board. <br> |
| 75 | +For a bit more information about the choice of motors visit <a href="bldc_motors"> BLDC motor docs</a> |
| 76 | +</blockquote> |
| 77 | + |
| 78 | +## Power supply |
| 79 | +- Power supply cables are connected directly to the terminal pins `+` and `-` |
| 80 | +- Required power supply voltage is from 8V to 24V. |
| 81 | + |
| 82 | + |
| 83 | +## Examples of connection schematics |
| 84 | + |
| 85 | +<span class="simple">Simple<span class="foc">FOC</span>Mini</span> can be connected to any microcontroller (MCU) pin combination that can ensure that the mini's `GND` pin is connected to the MCU's `GND` pin, MCU's 3 pwm capable pins are connected to the `IN1`,`IN2` and `IN3` pins, and one MCU's digital pin is connected to the `EN` pin. |
| 86 | + |
| 87 | + |
| 88 | +An example connection of the <span class="simple">Simple<span class="foc">FOC</span>Mini</span> and Nucleo board is shown on the image below. |
| 89 | + |
| 90 | +<img src="extras/Images/mini_connection_mucleo.png" class=""> |
| 91 | + |
| 92 | +<span class="simple">Simple<span class="foc">FOC</span>Mini</span> can be directly plugged into the Arduino headers of teh Nucleo board from the pin `10` to the `GND` pin and in that way reduce the amount of wires necessary. For more information on this example connection see [this library example](mini_example_nucleo). |
| 93 | + |
| 94 | +--- | --- | --- | ---| --- | --- |
| 95 | +Mini Pin | EN | IN3 | IN2 | IN1 | GND |
| 96 | +Nucleo Pin | 10 | 11 | 12 | 13 | GND |
| 97 | + |
| 98 | +```cpp |
| 99 | +BLDCDriver3PWM driver = BLDCDriver3PWM(13, 12, 11, 10); |
| 100 | +``` |
| 101 | + |
| 102 | +An example connection of the <span class="simple">Simple<span class="foc">FOC</span>Mini</span> and Arduino UNO is shown on the image below. |
| 103 | +<img src="extras/Images/mini_connection_uno.png" class=""> |
| 104 | + |
| 105 | +<span class="simple">Simple<span class="foc">FOC</span>Mini</span> can be directly plugged into the Arduino headers of the UNO board from the pin `8` to the `12` pin (pin 12 can act as a GND pin) and in that way reduce the amount of wires necessary. For more information on this example connection see [this library example](mini_example). |
| 106 | + |
| 107 | +--- | --- | --- | ---| --- | --- |
| 108 | +Mini Pin | EN | IN3 | IN2 | IN1 | GND |
| 109 | +UNO Pin | 8 | 9 | 10 | 11 | 12 |
| 110 | + |
| 111 | +```cpp |
| 112 | +BLDCDriver3PWM driver = BLDCDriver3PWM(11, 10, 9, 8); |
| 113 | +``` |
| 114 | + |
| 115 | +Another example of connecting the Arduino UNO with <span class="simple">Simple<span class="foc">FOC</span>Mini</span> is shown below |
| 116 | +<img src="extras/Images/mini_connection_uno2.png" class=""> |
| 117 | + |
| 118 | +--- | --- | --- | ---| --- | --- |
| 119 | +Mini Pin | EN | IN3 | IN2 | IN1 | GND |
| 120 | +UNO Pin | 4 | 5 | 6 | 9 | GND |
| 121 | + |
| 122 | +```cpp |
| 123 | +BLDCDriver3PWM driver = BLDCDriver3PWM(9, 6, 5, 4); |
| 124 | +``` |
| 125 | + |
| 126 | +An example connection of the <span class="simple">Simple<span class="foc">FOC</span>Mini</span> and stm32 Bluepill is shown on the image below. |
| 127 | +<img src="extras/Images/mini_connection_bluepill.png" class=""> |
| 128 | + |
| 129 | + |
| 130 | +--- | --- | --- | ---| --- | --- |
| 131 | +Mini Pin | EN | IN3 | IN2 | IN1 | GND |
| 132 | +Bluepill Pin | PB15 | PA8 | PA9 | PA10 | GND |
| 133 | + |
| 134 | +```cpp |
| 135 | +BLDCDriver3PWM driver = BLDCDriver3PWM(PA10, PA9, PA8, PB15); |
| 136 | +``` |
0 commit comments