In this tutorial we will explain how to control the speed of a brushless DC (BLDC) or a permanent magnet synchronous motor (PMSM) in standalone mode using SOLO without using any extra modules and totally in manual mode. Here the only thing you will need is a pair of potentiometers and a simple switch if you want to utilize all the possibilities and features of SOLO in this mode.
- 1 The Steps of Setting Up and Using SOLO in Standalone Mode
- 1.1 Turn Off the System and Reset the Piano Switch
- 1.2 The Wirings
- 1.3 Stand alone wirings for SOLO UNO using Potentiometers
- 1.4 Stand alone wirings for SOLO MINI using Potentiometers
- 1.5 Stand alone wirings for SOLO BETA using Potentiometers
- 1.6 Select the Motor Type Using the Piano Switch
- 1.7 Reset the Kp and Ki Potentiometers
- 1.8 Turn On the System
- 1.9 Put SOLO Into Closed-loop Mode
- 1.10 Put SOLO into Speed Control Mode
- 1.11 Tune The Kp and Ki Gains
- 1.12 Turn the Speed/torque Potentiometer to Increase or Decrease the Speed
- 1.13 Limit the Current Fed Into Your Motor
- 2 Results
The Steps of Setting Up and Using SOLO in Standalone Mode
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.
To start with SOLO first you need to provide the Wiring of SOLO as following
Stand alone wirings for SOLO UNO using Potentiometers
Stand alone wirings for SOLO MINI using Potentiometers
Stand alone wirings for SOLO BETA using Potentiometers
– 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Ω
– The use of current limit Potentiometer is not mandatory and if you leave the “P/F” input of SOLO unconnected, the default value of current limit which is 32A will be used.
– By connecting or disconnecting the “DIR” input to the “GND” or the ground of the system, the direction of the rotation of the motor will change from C.W to C.C.W or vice versa.
Select the Motor Type Using the Piano Switch
In This tutorial we are using a BLDC motor, and as you can see 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.
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.
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, … )
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.
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 )
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 .
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.
Turn the Speed/torque Potentiometer to Increase or Decrease the Speed
The Speed/Torque potentiometer here, is actually in charge of increasing or decreasing the voltage on the “S/T” in an analogue manner from 0V to 5V, so when you put the potentiometer on its maximum value (here 10kΩ) the voltage level at “S/T” input of SOLO will be around zero and subsequently the Motor will be stopped, and while you keep increasing the voltage on the “S/T” input by turing the same potentiometer, you are actually increasing the value of the voltage on “S/T” up to +5V which indicates the maximum achievable speed. The maximum speed depends on the nominal speed of your motor and the type of the motor you choose, look the datasheets for more information..
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 using the Current Limit potentiometer. This input works in reverse, meaning that if you apply 0V on it ( or unconnected), SOLO will allow up to 32A continuously flow into your motor if needed, and if you apply +5V to thing input, SOLO will put the current limit at 0 Amps, meaning that it will not allow no current into your motor ( the motor will stop ). So the formula to find the maximum allowed current into your motor will be as following:
The current Limit value = ((5.0 – Analogue Voltage applied at P/F input)/5.0) * 32
So as an example, if you apply 3V at the “P/F” input the value of current limit becomes 12.8A : ((5-3)/5)*32
The image below is a real time plot of Torque-Speed of a brushless motor controlled Manually by SOLO in closed-loop sensorless speed mode, as can be seen the direction of the rotation of the motor has been changed abruptly during time from one direction to the other direction with different values of Speed in each direction just to show the stability and reaction of SOLO (the positive speeds are for C.W rotation and the negative speeds are for C.C.W rotation).