Using Raspberry PI with Brushless Motor Controllers (PMSM, BLDC, Direct Drive, Brushed)

Описание к видео Using Raspberry PI with Brushless Motor Controllers (PMSM, BLDC, Direct Drive, Brushed)

https://www.servosila.com/en/motion-c...

In this video, we will control a pair of brushless motors from a Raspberry PI computer. The entire set up is going to be powered by a single battery.

We will use one of the computer's USB ports to connect a network of brushless motor controllers. The brushless motor controllers come in rectangular or circular form factors. The controllers have USB and CANbus ports for connecting to control computers such as Raspberry PI.

We will power the computer, the controllers, and the brushless motors using a single battery, similar to a autonomous vehicle design. The first motor is an outrunner type, a kind of what you would use for a vehicle propulsion.
The bigger motor comes with a quadrature encoder which means it can be used as a powerful servo.

By the way, the controllers need 7 to 60 Volts DC. I put proper connectors at the ends of the cable, so that I could just plug it into the controllers.

I am using an 11.1 Volts RC battery that I got in a local hobby store.

The upper part of the cable goes into a SBEC module that I got in the same hobby store. The SBEC module converts whatever voltage the battery provides, into a regulated 5 Volts DC voltage that Raspberry PI wants.

I extended my setup with a USB cable. This way I provide a 5 Volts DC power from BEC to my Raspberry PI via a USB connector that the computer needs.

Now, lets plug the motors into the controllers. Although the motors have Hall sensors, I will only plug the motor's phase wires for this video. The controllers will treat the motors as sensorless ones. I suggest that you watch separate videos dedicated to Sensored, Direct Drive or Servo Control modes of operation.

A regular USB cable is used to connect the brushless motor controllers to the computer. Only one of the controllers in the network needs to be connected to the computer.

Next, we need to build an internal CANbus network between the controllers. We are going to use a CANbus cable to interconnect the controllers. Each controller comes with two identical CANbus ports that help chain multiple controllers together in a network.

Up to 16 controllers can be connected this way via a single USB cable to the same control computer or a PLC.

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.

Once you plug the power supply cables into the motor controllers, and into the Raspberry PI computer, you will see the following cabling network. I spread it out on the floor to make it easier to trace. Be very careful with voltage polarity when connecting the motor controllers to a power supply.

This should look like an autonomous vehicle to an eye of an electrical engineer. The setup has an autonomous source of power, a WIFI-based radio link, an on-board computer, and a set of actuators.

We need to install a software tool called Servoscope on the Raspberry PI computer. Download the Servoscope package to your Windows or Linux computer. Launch VNC client software and connect to the Raspberry PI computer.

Now that the package has been uploaded to Raspberry PI, we need to un-zip it, and launch the Servoscope application.
Open the Terminal and navigate to the directory with un-zipped file. Launch the Servoscope application by launching a script.
To connect to the motor controllers, pick a proper serial port from the drop-down menu, and click the Connect button.
Both controllers in our network appear in the list of devices. Double-click on a device name to open a command and configuration window.

Please note that the motor controller appears to Raspberry PI OS as a virtual serial port. Any application running on Raspberry can read and write to the serial port.
There is a way to find the virtual serial port in the Terminal by listing all serial devices. Here it is. The motor controllers send telemetry via the virtual serial port.

Use the following Terminal command to display telemetry. The motor controller uses a text protocol to send telemetry. Your applications can send commands back to the controller by writing the same kind of text strings back to the serial port. The other option is by using CANbus. We will look at CANbus interface in a dedicated video.

We need to initiate an Auto-Configuration routine for both of our motor controllers. The beauty of the Auto-Configuration function is that the controller automatically configures itself when commissioning a new motor.

Now that the controller of the out-runner motor is configured, we need to repeat the procedure for the second motor. As both motors have been commissioned, we can start sending commands to the motors.

The green LED light tells that the controller is receiving commands from a parent control system.

#RaspberryPI #Brushless #PMSM #BLDC #Encoder #Raspberry #Sensorless #Sensored #DirectDrive #Controller #MotorControl #BISS-C

Комментарии

Информация по комментариям в разработке