Asked

Send Commands To Servos Over Serial

I have a Raspberry Pi running Synthiam on an installation of Windows 10 and I need to send serial commands to the servos. How can this be done?


Related Hardware Raspberry Pi

ARC Pro

Upgrade to ARC Pro

Join the ARC Pro community and gain access to a wealth of resources and support, ensuring your robot's success.

PRO
Canada
#1  

To send serial commands to servos using a Raspberry Pi running Synthiam ARC on Windows 10, you can use the Serial Terminal skill in ARC. Here's how you can set it up and send commands:

  1. Add the Serial Terminal Skill:

    • In your ARC project, add the Serial Terminal skill by going to Project -> Add Skill -> Communication -> Serial Terminal.
  2. Configure the Serial Terminal:

    • Select the appropriate COM port that your Raspberry Pi is using for serial communication. This will be the port that is connected to your servo controller.
    • Choose the correct baud rate that matches the baud rate of your servo controller.
    • If necessary, adjust the flow control settings to match the requirements of your servo controller.
  3. Connect to the Serial Port:

    • Click the "Connect" button in the Serial Terminal skill to establish a connection with the servo controller over the selected COM port.
  4. Send Serial Commands:

    • Once connected, you can send serial commands to your servos by typing the appropriate command strings into the text field at the bottom of the Serial Terminal skill.
    • Use the "Send" button to transmit the commands to the servo controller.
  5. Control Servos:

    • The specific serial commands you need to send will depend on the type of servo controller you are using. Refer to the documentation of your servo controller for the correct command syntax.
    • Common commands might include setting the servo position, speed, or acceleration.
  6. Scripting:

    • If you want to automate the process or send commands programmatically, you can use scripting within ARC. You can write scripts using EZ-Script or other supported languages like JavaScript or Python to send serial commands to the servos.
    • Use the UART commands in your script to send and receive data over the serial port. For example, UART.sendSerial() can be used to send data to the servo controller.

Remember to ensure that the wiring between the Raspberry Pi and the servo controller is correct and that the power requirements for the servos are adequately met. Additionally, make sure that the Raspberry Pi's serial interface is enabled and properly configured to communicate with the servo controller.

If you encounter any issues or need further assistance, refer to the support documentation for the Serial Terminal skill and the EZ-Script manual for scripting guidance.


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
#2  

It is also to point out that Athena assumes you have serial-compatible servos. Without mentioning what services you are using, there's no way Athena or Synthiam support can provide information. Can you give more details about what servos you are using?

#3  

Many thanks.

I'm happily using Feetech servos in the hand with the scripting working very well and commands going over USB to the Feetech interface board.

The arm though uses industrial CAN bus for it's motor controllers in a master/slave configuration. The slaved motor controllers are commanded by an embedded master Mbed (LPC1768 with Cortex M3) chip which receives serial commands over an Xbee wireless network from a higher level Master controller which will be running Synthiam, the Raspberry Pi and/or a PC.

I just need to output serial commands from the Master to the serial port that the Xbee USB adaptor automatically creates and once received by the mbed side I can repackage as necessary to drive the arm controllers.

#4  

We recommend using the servo Script to control a servo controller ARC does not support. Details are here: https://synthiam.com/Support/Skills/Scripting/Servo-Script?id=19068

With servo Script, you can create a script that sends the appropriate UART commands for virtual servo ports.

As for controlling FeeTech servos, that is done by adding the FeeTech servo robot skill and configuring the servos you wish to use. You do not need to manually send serial commands to the servos because the robot skill takes care of that. Follow the fintech manual and configure the servos you wish to bind and use the standard servo commands in ARC, and the fintech robot skill will move the respective servos.

@Athena can explain more about the servo Script robot skill...

PRO
Canada
#5  

To control your Feetech servos and send serial commands to your industrial CAN bus motor controllers using the servo Script skill in Synthiam ARC, follow these steps:

  1. Add the servo Script Skill:

    • In your ARC project, add the servo Script skill by going to Project -> Add Skill -> Scripting -> servo Script.
  2. Configure the servo Script:

    • Click on the gear icon to open the configuration menu for the servo Script skill.
    • In the configuration menu, specify the virtual servo ports (e.g., V1, V2, etc.) that you want to monitor for position changes. These virtual ports will correspond to the actual servos or motor controllers you want to control.
  3. Edit the Script:

    • In the script editor within the servo Script skill, write the code to send the appropriate serial commands over the UART to your Feetech interface board or the industrial CAN bus motor controllers.
    • Use the UART commands provided by the ARC JavaScript or Python API to send data. For example, you can use UART.sendSerial() to send commands to the Feetech servos or UART.sendSerialString() to send string commands to your industrial motor controllers.
  4. Bind to Virtual Servos:

    • The servo Script skill allows you to bind the script to specific virtual servo movements. Whenever a virtual servo is moved in ARC, the script will execute and send the corresponding serial commands.
  5. Test Your Setup:

    • Test the servo Script skill by moving the virtual servos in ARC and observing the response from your Feetech servos and industrial motor controllers. Ensure that the serial commands are correctly formatted and sent to the intended devices.
  6. Automate with Scripting:

    • If you want to automate the control of your servos and motor controllers, you can use additional scripting within ARC to trigger the servo Script skill based on various events or conditions.

Remember to ensure that the serial communication settings (baud rate, data bits, parity, stop bits, and flow control) match the requirements of your Feetech interface board and industrial motor controllers. Additionally, verify that the Xbee wireless network is correctly configured to relay the serial commands from the Master controller to the mbed chip.

By using the servo Script skill, you can integrate custom serial communication protocols into your ARC project without the need for a dedicated robot skill for your specific hardware.


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.