Как стать автором
Обновить

Controlling Brushless Motors from Windows

Время на прочтение4 мин
Количество просмотров1.4K

In this video, we will look at how to connect brushless motors to a Windows computer via USB. We are going to connect a network of Servosila brushless motor controllers to the computer. The other option is CANbus interface, but we will look at CANbus in a dedicated video. A regular USB cable is used. Note that the USB cable is not used to power the controller and its motor.

The first brushless motor controller in the network appears to Windows as a Virtual COM port. Once connected via USB, it can be found in a general list of devices in the Window's "Settings" window. If one of the interconnected brushless motor controllers is connected to a computer via USB, then that particular controller becomes a USB-to-CANbus gateway for the rest of the network. Up to 16 controllers can be connected in a network inside a robotic vehicle.

Up to 16 brushless motor controllers can be networked together within a robotic vehicle
Up to 16 brushless motor controllers can be networked together within a robotic vehicle

If your computer happens to have more that one serial port, you may wish to check a COM port's number assigned by Windows to the controller. Then, you pick this COM port in a drop down menu in the Servoscope software, and click Connect. If the COM port is not listed in the drop-down menu, click the Refresh button. If everything is good, the controller appears in a list of devices. Double-click to open up a control and configuration window.

First, we need to download and install software called Servoscope. The installation process boils down to un-zipping a downloaded file. Look for an executable file inside the directory with unzipped files. Double-click on the file to launch it.

Next, we need to power up our brushless motor controller. Look for power input terminals designated by "+" and "-" signs. The controller can be powered by a power supply unit or by a battery. Typical input voltages are 7 to 60 volts DC. Please be extra careful with voltage polarity. Make sure that the controller's LED power indicator is on once you've connected power supply.

Note that you can connect multiple motor controllers to the same computer via a single USB cable. This way, multiple motors can be controlled by the same computer. Lets quickly look at how to do that. You would need one or more CANbus cross-cables to interconnect the controllers. Each controller comes with two identical ports for the cables. Connect as many as 16 motor controllers in a chain this way. Only one of the motor controllers needs to be connected to the computer via the USB cable. This chaining approach simplifies building machines with multiple degrees of freedom. I powered up two motor controllers in my network. If we go back to Servoscope program, we will see that both controllers appear in a list of devices in the window.

Since the motor controller appears to Windows as a Virtual COM port, any program can connect to that port to receive telemetry or to send commands to the controller or a network of controllers.

Lets close the Servoscope program, and start an open source serial port terminal program called PUTTY. This is one of many serial port terminal utilities that can be downloaded from the Internet. Make sure you select a proper COM port. All other connection parameters do not matter since the port is a virtual one. You can see telemetry data being streamed by the controller in a text format. Using the terminal, you can also send commands to the motor controller, but we will look into this in a separate video.

At this point, our installation on the Windows system is finished.

I've got a brushless motor with a quadrature absolute encoder. I have already connected it to the rectangular controller. I also got a small sensorless motor. I am going to connect it to the circular controller. The sensorless motor has just 3 phase wires that need to be plugged to proper terminals on the controller. Make sure that the power supply is turned off before connecting the motors, Hall sensors or encoders. If your electric drive has an absolute encoder, the controllers can turn the electric drive into a servo motor or a direct drive motor. In this demo, we will look at simpler Electronic Speed Control mode.

But first, we need to launch an Auto-Configuration routine that allows the controller to commission a new motor that we have just connected. Let's launch the Servoscope program again, and select an Auto-Configuration command from the drop-down menu. Specify a maximum phase-to-phase electric current that the motor can handle. Specify the number of poles your motor has. By the way, these values normally come from the motor's datasheet. Click the Send button.

The smaller motor is making what looks like mysterious kong-fu moves. What actually is happening is that its controller is automatically measuring various characteristics of the motor. The measurement routines cause the motor to make the moves. The motor accelerates to its maximum speed. Be careful as the motor is producing its maximum torque at this moment. The rapid accelerations may take place a few times during the auto-configuration procedure.

Lets launch the Auto-Configuration procedure for the second motor as well.

Note that the motors produce a beep sound at the beginning of the Auto-Configuration routine. The controller sends probing electric pulses to the motor to measure various characteristics of the motor. The beauty of the Auto-Configuration function is that the controller automatically configures itself when commissioning a new motor.

Beware of the rapid accelerations of the motor that might take place a few times. The motor produces the second beep sound to indicate the end of the auto-configuration procedure.

Now that both motors have been commissioned, lets send Electronic Speed Control commands to the controllers. Choose Electronic Speed Control command from the same drop-down menu. I specified speed as 150 electrical revolutions per second. Hit the Send button. Note that the program sends the commands to the serial port in a text format. The motor starts spinning with the commanded speed.

That's it for now. In this video we looked at how to connect brushless motor controllers to a Windows computer via USB interface.

Теги:
Хабы:
Всего голосов 5: ↑3 и ↓2+1
Комментарии0

Публикации