Written by SOLO Team
How to control speed or torque of your Brushless Motor with Arduino using SOLO (closed-loop)

SOLO features outstanding options for its users and one of them is enabling them to control the speed or torque of their BLDC, PMSM, BLAC motors in a sensorless closed-loop manner with cutting edge technology of Field Oriented Control, but what’s more interesting is SOLO is probably the simplest motor controller to do FOC with! You can do FOC without even writing a single line of code! With two Potentiometers! In this article, we are going to explain how to apply FOC to your brushless motor with Arduino and SOLO. it’s highly recommended that before proceeding with this article you also check our article about how to control the speed of your brushless motors using ARDUINO and SOLO in an open-loop manner which is the simplest way to run SOLO.

If you have no technical knowledge about these terms we are mentioning like FOC or even closed-loop or open-loop control, it’s not important at all, just follow the following procedures and you’ll have your Brushless motor spinning like a charm.

With SOLO you can have either Torque or Speed control, but what are the differences?
In a simple language, the Torque control is like you want to directly control how much Torque is generated on the shaft of your motor! To simplify even more, you can imagine that The higher the Torque the more forceful your motor will spin. Torque Control is used in TRACTION units, Electric cars or Electric Scooters and so on.

On the other hand, Speed control is used when you want to control the rotational speed of the shaft of your motor! In some applications like Drones, it’s more important to have a constant speed on the propellers to keep the motion steady.

One might ask, Ok then, what’s the difference between Speed and Torque Control? Actually this is a very valid and tricky question to ask, and to answer that, we can say, the speed is a phenomenon resulted from Torque! Meaning that in electrical Motors, by injection current into the windings of your motor, you generate mechanical Torque on the shaft of your motor, now depending on the load on the shaft of the Motor and the amount of generated Torque you will have Speed as the result. So in practice, if we consider a fixed load on the shaft of your motor ( like a robot on a flat plane with a fixed weight), if you increase the Torque your robot will move faster and vice versa!

Anyway, Regardless of the type of Control, you choose ( Speed or Torque ) the wiring of your Brushless motor controller with ARDUINO will be

SOLO UNO to Arduino UNO wirings [PWM control]

SOLO MINI to Arduino UNO wirings [PWM control]

SOLO BETA to Arduino UNO wirings [PWM control]


arduino uno and solo beta wiring

– The “DIR” Pin 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 diagram above.


In Closed_loop configuration with SOLO, you only need one pin of ARDUINO which is capable of generating PWM and one Digital I/O pin which can output a logical 0 or 1 ( 0V or 5V ) outputs. As you can see in IMG1, the configuration in Closed-Loop mode is very simple and all you need to do are as follows:

Closed-Loop Configuration of SOLO

1. Connect your BLDC or PMSM motor to pins “A”, ”B” and “C” of SOLO, The order of connection is not important and it can only affect the direction of rotation of the motor which you can control through “DIR” pin in SOLO.

2. Connect pin number “3” of ARDUINO (or any other pins which is capable of generating PWM) to pins named “SP/TR”.

3. Provide the +5V supply to your ARDUINO module from “+5V” and “GND” pins of SOLO

4. Connect a generic digital output pin from ARDUINO ( in this case pin “7” of ARDUINO) to the “DIR” pin of SOLO for controlling the direction of rotation of your brushless motor.

5. Push “P5” switch in the Piano switch of SOLO DOWN, this will put SOLO in Closed-loop mode

6. Depending on the type of your Brushless motor put switches “P1” and “P2” in PIANO Switch of SOLO in one of the following conditions

    • Motor Type: Normal Brushless Motors ( nominal speed < 8000 RPM) then “P1” Position DOWN and “P2” Position UP
    • Motor Type:Ultra-Fast Brushless motors ( nominal speed > 8000 RPM) then “P1” Position UP and “P2” Position UP

“Ultra-Fast Brushless motors” is referring typically to small-sized motors for drones or hobbyists which are capable of reaching up to 50000rpm or more. In the case of selection of Ultra-Fast mode, which in practice are motors with very low inductance, SOLO will operate with switching frequency of 80kHz, which in case of Normal mode the switching frequency of SOLO will be 20kHz.

7. Now you can Select between “Torque” or “Speed” control using “P4” switch in Piano Switch as below:

    • Control Mode: TORQUE control then “P4” Position UP and the Tuning is NOT Required
    • Control Mode: SPEED control then “P4” Position DOWN and the Tuning is Required

As you can see in the table above, you just need to select a proper position of “P4” for having Torque or Speed mode selected, in the current version of SOLO, Torque control needs no Tuning since SOLO does all the jobs for you, in case of Speed controller you need to tune a little bit two potentiometers which are named “Kp” and “Ki”. in the following you can see 2 videos one is dedicated for explaining the Torque control and how tune SOLO for that, while the other one is dealing with the Speed control and how to tune the Kp,Ki gains of SOLO for that.

Please notice that, in the following videos, the SOLO version in use is from the early versions and the configuration of Piano Switch pins are different with SOLO UNO mentioned in this article.


Closed-loop Sensorless Speed Control Video

Closed-loop Sensorless Torque Control Video

Now you have SOLO configured completely, so depending on the control Mode you’ve selected, you can increase or decrease the Speed / Torque of your Brushless motor by variation of your PWM duty-cycle (from 0% to 100%) or your analog voltage amplitude (from 0V to 5V) from the minimum value to maximum value.

Please notice that in case you use PWM for commanding SOLO, the frequency of your PWM can be anything between 5kHz to 100kHz as can be seen here
How to control speed or torque of your Brushless Motor with Arduino using SOLO (closed-loop) 1


  1. Christoforos Rekatsinas

    I have a question regarding your product!

    I want to perfrom a FOC using a pmsm motor. The thing is that I also need to perfrom Hardware in the Loop with your module and arduino.
    To achieve that I need either sensor less or sensored control of the speed (or torque of the motor).
    Is it possible to upload my code to arduino? Does solo outputs the BEMF of the motor?

    • Staff

      Hi Christoforos,
      Thanks for the question, to answer that properly I would initially say that SOLO is coming to make Motor Controlling easy and accessible, so in SOLO we tried to shield our users from dealing with complexities of the motor controlling and providing them an easy high-level interface, but if you are interested to dig down deeper you have the possibility as below:
      As you know FOC of a PMSM motor consists mainly of two control loops, one internal control loop which is in charge of controlling the Torque (current) and the exterior loop which is in charge of controlling the speed of the motor. using SOLO you can separately control each of these loops depending on the application.
      For your application specifically, I have an idea for you:
      – What you can do with SOLO and your HIL system can be like you putting SOLO in Torque Control Mode, this means you are neglecting the internal speed Loop which SOLO is providing, as you mentioned now you have two possibilities:
      1- If your motor has an encoder you can connect the encoder to your Arduino, measure the motor’s speed there and close the Speed loop externally inside Arduino
      2- If you want to work in sensorless mode, SOLO provides you the estimated speed of the Motor (much better than BEMF for your application I suppose) on UART or USB which you can read it with the serial input and close your Speed loop in Arduino or your PC.
      I think for you the first method will be a good starting point but also the second method will be powerful.

  2. Wu Ke

    Hi there,

    I am working on a robotic project, which is controlling 4 DC motors in terms of torque in Matlab. As my controller is developed in Matlab, I need to send commands from Matlab through Adruino mega to the 4 DC motors. Does that mean I need 4 SOLOs and one Adruino in this case? I used to do the same with 4 servo motors but I am new in DC motors.

    One more important question: where is the link of the product where I can order it?

    Thanks so much,

    • Staff

      Hi Wu,

      Thanks for your question, the simple answer is YES! As you might know, the Torque Control is done in a closed-loop fashion and SOLO does it totally automatically without the need for any tuning from the user side, so for each motor, you’ll need one separate SOLO, but since in order to control the Torque on SOLO, you’ll need 1 PWM enabled pin from your Arduino, and 1 general-purpose I/O to define the direction of rotation, so in total for 4 motors, you’ll need 4 PWM outputs plus 4 digital outputs (1 if all the motors spin in the same direction), which I’m sure a single Arduino mega can provide them all.
      To Control the Torque of your motor using SOLO, you just need to send to SOLO your desired current ( Torque = Current * TorqueConstant ) in form of a PWM pulse with a variable duty cycle from 0%-100% in which 0% stands for 0 current in the motor ( no torque ) and 100% means the maximum current in the motor ( in SOLO by default it’s 32A, but you can adjust it ). The frequency of the PWM pulse is not important and anything above 5kHz is acceptable and valid. This project has been done using torque control feature of SOLO on a DC motor in an E-Scooter, Pls have a look.

  3. Chris Malcolm

    Can this board be used to control a force feedback wheel for PC?
    I currently have an Arduino Leonardo that uses the EMC pro software to output 1x PWM + 1x DIR signal to a brushed motor controller (Cytron 30a). As far as I know, the PWM signal controls the torque of the motor.
    Can I use the SOLO board in the same way to control a brushless motor? If so, would it require any other interface boards?

    Thanks Chris

    • SOLO Team

      Hi Chris,

      You can control SOLO basically in 4 different ways (regardless of they type of the motor, DC, BLDC, PMSM or ACIM):
      1- using pure Analogue voltages between 0 to 5V ( Torque or Speed )
      2- using PWM pulses, between 0 to 5V with any frequency above 5kHz ( The control using PWM is done by variation of duty cycle, so the frequency is not important, it just needs to be fixed on a value above 5kHz)
      3- using UART communication, the TX and RX of the SOLO Beta model are 3.3V, so if your board is also 3.3V, then you need no intermediate module, but if your board, outputs a 5V level TX and RX, you need to use a simple level shifter module ( costs less than 5 euros normally)
      4- using USB, so you can connect SOLO to your PC directly, and either using our Motion terminal or any other software that can communicate with USB ( COM) port
      5- using CAN bus ( will be available in future firmware updates)

      ++ regarding Arduino, beside analog control using PWM, we are releasing a complete digital library for Arduino using UART within next month, so all the commands can be sent digitally ( pls check https://www.solomotorcontrollers.com/solo-datasheet/uart/)

      ++ The Direction control is similar to your previous controller using a digital I/O, and it can be done using a 0 or 3.3V input to DIR input of SOLO, if you want to do this with 5V logic, you need to use a 1.5K resistor in series to your 5V signal to SOLO. Pls, check the essential wirings in our datasheet page for the BETA model. (https://solomotorcontrollers.com/wp-content/uploads/2020/07/IMG6_EssentialWiring_SOLOandArduino.png)

      we will remain available.


Submit a Comment

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

Share This

Share This

Share this post with your friends!