How to control the speed of BLDC motor using Arduino and SOLO in Closed-loop sensorless mode |FOC|BLDC|Sensorless 1
Written by Staff
13/07/2020
How to control the speed of BLDC motor using Arduino and SOLO in Closed-loop sensorless mode |FOC|BLDC|Sensorless

In this tutorial we are going to see SOLO controlling the speed of a BLDC motor using ARDUINO UNO as the commanding unit. SOLO, here, controls the speed of this brushless DC motor which is rated for 150W in closed-loop sensorless mode using FOC ( field oriented control). If you are not familiar with the mentioned terms like closed-loop control, sensorless control or FOC, don’t worry, you actually don’t need to know them to be able to use SOLO, and you can skip the next explanations directly to the tutorials itself. But if you are interested here we go:

What is a brushless DC motor?

A Brushless DC motor comes in contrast with Brushed DC motors and as the name suggests in Brushless motors the need for having brushes is eliminated, resulting in much more reliable solutions with very high durability and low maintenance since the Brushes in DC motors tend to wear during time and they need to be replaced; such a phenomenon doesn’t exist in brushless Motors. On the other hand a Brushless DC motor consists of a cylindrical stator with a symmetrical three-phase concentrated winding so as to generate a constant distribution of the magnetomotive force in the air-gap. The rotor flux is created by permanent magnets and there are no damper cages, the stator and the rotor are made of laminated material and of infinite permeability.

What are the Differences between DC brushless and AC brushless Motors?

As you might know we have two different kinds of Brushless motors, DC brushless motors which are known also as BLDC motors as well as AC brushless motors known as PMSM or even BLAC. The main difference between an AC and a DC brushless lies in the realization of the windings, in case of AC brushless the windings are distributed and in case of Brushless DC motor the windings are concentrated. As a result in AC brushless motors the induction distributed along the air gap is sinusoidal while In the case of a DC brushless the induction has a square wave trend.

Steps of setting up and using SOLO alongside with ARDUINO

0. Turn off the system and Reset the Piano switch

Make sure you have disconnected the power supply connected to SOLO or any other peripheral which is in contact with SOLO, after that you need to push UP all the pins of the piano switch which is their default position.

1. Apply the Wirings

To start with SOLO first you need to provide the Wiring of SOLO to ARDUINO as following:
How to control the speed of BLDC motor using Arduino and SOLO in Closed-loop sensorless mode |FOC|BLDC|Sensorless 2

s

make sure you don’t supply the ARDUINO both from your PC using USB or any other supply and Then the 5V from SOLO at the same time, you should use only one of the supplies especially in ARDUINO UNO models where they can’t switch the supplies and this might cause issue for the system

The “DIR” is a 3.3V input, and it’s NOT 5v tolerant, to apply a 5V input you MUST use a resistor with a value between 1kΩ to 2.2kΩ, as can be seen in the wirings

2. Select the Motor type using the Piano Switch

In This tutorial we are using a BLDC motor, and as you can see here, in the piano switch we should put the pin number 1 Down and pin number 2 Up to select the first type brushless motor with 20kHz of switching frequency at the output, this switching frequency is satisfactory for a wide range of Brushless and PMSM motors, but if your Brushless motor has a very low inductance ( below 400uH of phase inductance usually) you can select the ultrafast Brushless motor type and the switching frequency in that case will 80kHz.
You can also set any arbitrary switching frequency from 8kHz to 80kHz using digital commanding methods which SOLO provides through UART, CAN and USB for you.

How to control the speed of BLDC motor using Arduino and SOLO in Closed-loop sensorless mode |FOC|BLDC|Sensorless 3

3. Reset the Kp and Ki potentiometers

Just rotate the two blue potentiometers shown below all the way in Clockwise direction into the blocking point ( please treat them gently! ) , so their value becomes zero.

How to control the speed of BLDC motor using Arduino and SOLO in Closed-loop sensorless mode |FOC|BLDC|Sensorless 4

4. Turn On the system

Now you can turn ON the main supply connected to SOLO’s power input and SOLO will immediately boot up with a blinking E2 LED while E1 LED is off which is the indication of a safe startup with no errors or malfunctions ( like over current, over voltage, … )

5. Put SOLO into Closed-loop mode

since the control type we are using here is among the closed-loop controls, you need to push the Piano switch number 5 Down while the system is ON, when you do that, SOLO in less than a second will identify your motor parameters and it will store them on it’s non-volatile memory, during this time if the shaft of the motor is free, you might witness some little vibrations which are totally normal. So as long as the Piano Switch number 5 is down, the last saved parameters will be used, even if you turn off the whole system and turn it back on later.

How to control the speed of BLDC motor using Arduino and SOLO in Closed-loop sensorless mode |FOC|BLDC|Sensorless 5

Under the following conditions you need to pull up and push down again the piano switch number 5 : – In case of changing the Motor – In case of changing the wiring of the motor ( not mandatory but better to be done ) – The very first time you run SOLO and you put it into closed-loop ( after receiving the factory made module )

6. Put SOLO into Speed control Mode

Just put the piano switch number 4 Down, by doing this, SOLO will understand it has to control the Speed of your motor .

How to control the speed of BLDC motor using Arduino and SOLO in Closed-loop sensorless mode |FOC|BLDC|Sensorless 6

7. Tune The Kp and Ki gains

Turn a little bit Kp ( like 5 degrees in counter clockwise direction ) and for a very small amount Ki ( much less than Kp, around 1 or 2 degrees), the best is you watch the video up there to master this. In general these two potentiometer are like some gains and in a very simple language:

Kp : defines for you how fast your motor should react and reach the speed you asked, so if you increase this value, your motor will be more reactive, but too much of this gain might make vibrations, so you need to tune it enough. Also another effect of this gain will be how “harshly” the controller ( here SOLO ) should react to the variation of the load on the shaft of the motor to keep the speed constant, so in case of using this functionality in a mobile robot as an instance, if you increase Kp of SOLO, and the robot reaches to some ramps, it will adjust it’s speed faster but also it might make your robot too fast. So it’s not always good to increase this gain, it totally depends on your system.

Ki: defines how good your motor during time should reach the goal, so by increasing this value your motor might reach the goal slower but more consistent. Also by increasing this gain too much your motor might get unstable. So you need to tune this similar to Kp with patience and accuracy.

In general the first time you tune these two gains, as long as you are using the same Motor in the same system you won’t need to touch them, it’s only the matter of the first time.

8. Send PWM pulses from ARDUINO to SOLO

one of the methods of commanding SOLO is using pulse width modulation ( PWM) method, in this method you will send some digital pulses which their high-state is 5V and their low-state is 0V. These pulses should have any frequency above 5kHz ( the higher the frequency the better the resolution). Now by varying the duty cycle of these pulses you can increase or decrease the speed of your brushless motor from 0 speed( 0% duty cycle ) to maximum allowable speed ( 100% duty cycle).
How to control the speed of BLDC motor using Arduino and SOLO in Closed-loop sensorless mode |FOC|BLDC|Sensorless 7

9. Limit The current fed into your motor:

You can limit the amount of current fed to your motor using the connection shown in the wiring section to “P/F” input of SOLO. Again here, you can use PWM pulses with any frequency above 5kHz, and by changing their duty-cycle the value of the current limit will change based on the following formula:

The current Limit value = ((100 – duty cycle of PWM at P/F input)/100) * 32

For example if we put the duty cycle at 80%, the maximum current allowed into the motor will become 6.4 Amps = ((100-80)/100)*32
As you see, this input works in reverse, so if you leave it open, the maximum allowed current into your motor will be the default value of 32A and if you apply a 100% duty-cycle PWM into “P/F” input, the current limit will be set at 0 (no current allowed into the motor). If you don’t want to use this feature you can leave this input unconnected.

Results

The image below is a real time plot of Torque-Speed of a DC brushless motor controlled by SOLO in closed-loop sensorless speed control mode. As you can see, the speed of the BLDC motor ( green plot) remained constant even at those moments where a load applied to the shaft of the motor, you can find those moments that the load has been applied from the Torque (the red track) , because whenever a load has been applied on the motor, SOLO automatically increases the Torque of the BLDC motor to overcome the load and keep the speed constant.
How to control the speed of BLDC motor using Arduino and SOLO in Closed-loop sensorless mode |FOC|BLDC|Sensorless 8

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Related Articles