How to connect Delta ASDA-A2 Servo Motor with NVIDIA® Jetson™ Nano™ /Xavier™ NX using QT5

How to connect Delta ASDA-A2 Servo Motor with NVIDIA® Jetson™ Nano™ /Xavier™ NX using QT5

Jetson AGX Xavier | Jetson Nano | Jetson Xavier NX

17 March 2021
WHAT YOU WILL LEARN?

1- Installing QT Creator 

2- Serial communication with Delta ASDA-A2 Servo Motor 

3- Connecting Delta ASDA-A2 Servo Motor with Qt Creator interface

ENVIRONMENT

Hardware: Applied to all Forecr Products

OS: Applied to all Jetpack versions




In this blog post, we will explain how to connect Delta ASDA-A2 Servo Motor with NVIDIA Jetson Nano/ Xavier NX. We will get the firmware version of Delta ASDA-A2 Servo Motor. We are going to use Qt Creator framework for making the interface that enable us to connect Servo Motor Driver via serial communication. We will be using DSBOX-NX2 as development platform and MOXA USB to Serial RS232 Adapter for serial communication. You can find the source codes at the end of the post.

Installing QT Creator 


Here you can see the created Qt interface. When the program runs , firstly we have to use serial communication port from combobox which is at the top side of the interface. Motor buttons are not going to be functional in this blog post. There are receive message text box and send message text box at the right side of the interface.



In this code snippet, we get the available serial ports and we add each of them to the combobox.


Serial communication with Delta ASDA-A2 Servo Motor 


We have created signal slot mechanism for serial port selection. After serial port selection, the combobox slot function executes. We set the properties of serial port in this slot function. In here, the baudrate property should set "38400". We set the signal slot functions here, too.



When the serial device has opened, "GetMotorFirmwareVersion" function runs.



We modified the command string in this function because motor driver needs to get specific request message for returning the firmware message.



In the scope of signal slot mechanism, if the "readyRead" signal occurs, the data is read by below function. We send firmware version request command to servo motor. Then it replies the firmware version message. We read the message by "readData()" function. We make some calculations and reach the exact version of firmware.


Connecting Delta ASDA-A2 Servo Motor with Qt Creator interface


We must run the executable file with "sudo" command like below. The reason to do this is to give access permission to serial communication port.



In the below visual, you can see the firmware version as "1047".


Thank you for reading our blog post. 


English