How to Drive Fast Drone or RC car Brushless Motors using ARDUINO and SOLO in Sensorless Mode up to 30,000 RPM

In this article, we are going to demonstrate how you can use SOLO’s ARDUINO Library to control the speed of a BLDC motor with 4150KV which will reach up to 30000RPM by applying 10V as the Battery or BUS voltage. In this example Closed-loop sensorless control will be used as this configuration will be an ideal setup for very fast RC cars or even flying Drones in terms of cost and ease of use.

The Wiring

The only wiring you need to apply will be the connection of the Motor to SOLO and by just connecting UART_TX, UART_RX and GND lines between SOLO and ARDUINO.




The UART_TX and UART_RX Lines of SOLO BETA are 3.3V, so if you are going to use it with ARDUINO boards with 5V level UART lines (like Arduino UNO), you need to use circuitry similar to image above, otherwise, if your ARDUINO has 3.3V UART lines (TX and RX) you can connect them directly to SOLO.

arduino uno and solo beta wiring

SOLO Setup

In This example make sure you put SOLO into Closed-Loop control mode by pressing the Piano Switch PIN NO# 5 DOWN similar to image below:

How to Drive Fast Drone or RC car Brushless Motors using ARDUINO and SOLO in Sensorless Mode up to 30,000 RPM 1

The Motor

The Motor used in this example is “Turnigy TrackStar SCT 5T Brushless Motor” with 4150KV and you can order it from here. This motor also features Hall sensor outputs which we didn’t use in this example as we are working in Sensorless Mode, but can be a good option for some other closed-loop FOC tests using Hall sensors.

How to Drive Fast Drone or RC car Brushless Motors using ARDUINO and SOLO in Sensorless Mode up to 30,000 RPM 2

The Code

Code Explanation

Now we will try to explain the most important parts of the code given above, although the code is self-explanatory, but it will be helpful if you also have a deeper look on the detailed explanations below:

Important Note for ARDUINO UNO users

In ARDUINO UNO , there is only 1 line of UART which is shared between the UART to USB convertor of ARDUINO board itself which is also used for flashing the ARDUINO UNO board as well, so whenever you want to program your ARDUINO UNO board through the ARDUINO IDE, YOU need to disconnect the UART_TX of SOLO from being connected to RX of ARDUINO UNO, by not doing this, you might get some errors in ARDUINO IDE during uploading the code.
To know more, read this post on ARDUINO website.

Lines 15 to 42

Definition of some variables that are being used within the code

Lines 49 to 57

Defining the data rate baudrate of UART between SOLO and Arduino, by default the UART baudrate of SOLO is 937500 bits/s or 921600 bits/s if you want to go with PC standards, but there is a possibility to have a different baudrate of 115200 [bits/s] for legacy devices like old version of ARDUINO that they don’t support higher baudrates with acceptable error margin.

However, we strongly recommend to use SOLO with its standard baudrate of 937500 [bits/s] as it offers the best performance and minimum data transmission delay which is critical for high speed operations that SOLO deals with, to control brushless motors.

You can select different baudrates for SOLO using SOLO Motion Terminal.

Line 60

Here we are initializing the instance of SOLO object that we made previously, using such a way of instantiation, you’d be able to create multiple SOLO objects and deal with lots of SOLO’s connected in a network based on their device address up to 254 units.

Line 63 to 69

In this part, we have a loop-wait till we receive a positive return over the serial communication. Like this, we are trying to make sure the correct connection between SOLO and ARDUINO is established and working. If the connection line is not in place, the program will wait before starting to communicate with SOLO.

Lines 98 to 99

Here we are tuning the speed controller Kp and Ki gains, please remember, the Current controller gains are automatically tuned after the Motor Identification, so the only gains that you will need to tune are the Speed Controller gains. To know more you can visit here.

Lines 103 TO 137

This is the looping part of the code that firstly tries to ask SOLO to spin the Motor with 10000RPM in Clockwise direction and stay in this condition for a while, then by changing the direction and increases the speed to 30000RPM and then finally stopping the motor for a short time.

You can read more about our SOLO Motor Controller ARDUINO Library here.

Share This

Share This

Share this post with your friends!