Servo Driver with ESP32
| ||
Overview
Introduction
This product is a bus servo control board based on ESP32 and we provide examples that can control bus servos through the WEB application. This product supports the programming of servos to change the ID and working mode of the servos (servo mode/motor mode) in theory, it can control 253 bus servos and read the current angle, load, voltage, mode, and other information of each servo, and can use the serial port to communicate with the upper computer, which is used to build the lower computer of the robot project, and the on-board OLED. The screen can be used to display key information and is suitable for robot projects that require feedback on the angle and load of the servos such as robotic arms, hexapod robots, humanoid robots, wheeled robots, etc.
Specifications
- Supply voltage: DC 6-12V(the input voltage and the servo voltage must be matched)
- Controloller: ESP32
- Control interface: UART
- Download interface: Type-C
- Power supply connector: 5.5*2.1mm DC
- Dimensions: 65mm x 30mm
- Fixing hole diameter: 3.0mm
- Mounting hole size: 2.75mm
- Mounting hole spacing: 23 × 58mm
Features
- Allows controlling up to 253 SC, ST series serial bus servos at the same time (adequate power supply required).
- Wide range voltage input 6-12V (the input voltage and the servo voltage must be matched).
- Built-in WiFi and Bluetooth, as well as ESP-NOW support, for remote control and servo debugging.
- Automatic download circuit for easy uploading programs.
- Open source web application and various robot structures.
- Compact size and space-saving, suitable for integration into sorts of space-limited projects.
Open Source Project
You can download the relevant open-source robot models in the product documentation for building your own projects.
How to Use
ESP32 Flash Download Tool
Generally, we control the ST series servos by compiling and uploading the demo through the Arduino IDE. However, compiling through Arduino requires installing various dependency libraries before use. Therefore, we provide an ESP32 download tool. With this tool, users can download the demo to the driver board without needing to download other dependency libraries or the Arduino IDE software.
- Click here to download ESP32 Flash Download Tool. Once downloaded, extract the files and double-click on the "flash_download_tool_3.9.5.exe" program. After opening, two windows will appear. The UI interface of the download tool is the one you need to operate, while the other window serves as a terminal to display the working status of the download tool.
- In the "DOWNLOAD TOOL MODE" interface, select Chip Type as ESP32 and WorkMode as Factory. When using Factory to call the binary file, it will use a relative path, eliminating the need for users to manually input the binary file path. After making these selections, click OK.
- In this software interface, keep the "LockSettings" option checked. On the right side, you can simultaneously upload demos to 8 driver boards. Next, connect the servo driver board to the computer using a USB cable. Click on "COM" and select the newly appeared COM port (in my case, it's COM3). BAUD is used to set the download speed, higher values result in faster speeds, with the ESP32 supporting speeds up to 921600.
- After selecting, click START to begin uploading the demo. Once the upload is complete, "IDLE" will change to "FINISH". After completing this process, you can disconnect the USB connection between the servo driver board and the computer. Then, connect the servos to the servo driver board, provide power to the driver board, and start controlling the ST series servos.
SC Servo
- Click to download SC servo ESP32 download tool. The procedure after downloading is the same as ST series servos. After uploading the program, connect the servo to the servo driver board and then connect the power to the servo driver board to control the SC series servos.
Product Usage Tutorial
- The following tutorial uses servo driver by default to explain how to use the servo, if you need to use it in your own project, you can refer to the sample program and the bus servo drive circuit schematic for secondary development.
- The factory default ID of the servo is 1. Among the servos connected to the same servo drive board, the same ID can only correspond to one servo, and there cannot be more than one servo with the same ID in the one control circuit. When you set the ID for the servo, try to ensure that only one servo whose ID is to be changed is connected to the driver board. After the ID is changed, it will be permanently saved in the servo and will not be lost even if the power is off.
- First of all, you need to set an independent ID for each servo. When setting an ID for one servo, the driver board should not be connected to other servos.
- If you use the ST3020 servo, after connecting it to the driver board, you need to provide 6-12.6V (12V is recommended) via the DC port (5.5*2.1mm) on the board, and the port will directly power the servo. If you use a large number of servos, you need to provide enough currents for the port.
- After the driver board is powered on, a WiFi hotspot will be created by default. The default hotspot name is ESP32_DEV, and its password is 12345678. Please connect to this hotspot with your phone.
- After connecting to the hotspot issued by the servo driver board, it is recommended to use Google Chrome to access the address 192.168.4.1. Noted that the phone will fail to verify the server with ping after connecting the WiFi, so it may automatically switch to the other known WiFi. In this case, you should connect ESP32_DEV again, and the phone will not connect to other WiFi automatically after the reconnection is successful.
- The driver board will automatically scan the servo ID (0-20) when it is powered on (in order to save the boot time). If your servo ID is more than 20, you must change the MAX_ID value in ServoDriverST.ino and upload it to the driver board again.
- If the servo is connected after the driver board is powered on, you need to click Start Searchingon the mobile browser page to scan again.
- Active IDis the currently selected servo ID number, ID to Setis the new ID number to be set, adjust the value of ID to Setthrough ID to Set+andID to Set-, and press the Set New ID button to set the servo ID Active ID as ID to Set.
- When the IDs of all servos are set, you can connect them all. If you do not restart the device, you need to clickStart Searchingto scan all servos.
- ID: shows all ID numbers of servos currently connected to the servo driver board.
- Active ID The currently selected servo ID number, and the subsequent operations are all controlling thisActive ID servo.
- You can select the Active ID servo via the ID to Set+ and ID to Set- buttons.
- Middlekey, you can turn the servo to the middle position, the position range of the servo is 0-4095, and the middle position is 2047.
- Stopkey, the default program will not let the servo move all the time. If the servo cannot be stopped after the secondary development, you can press the Stop key to hault the servo movement.
- Releasekey, press it and the servo will close torque lock (Torque Off), then you can turn the servo by hand.
- Torquekey, after pressing the servo, the servo will turn on the torque lock (Torque On), at this time, the servo will maintain the specified position with force.
- Position+key, after pressing the servo, the servo will start to rotate clockwise. When the servo is in the servo mode, it will not continue to rotate after turning to the 4095 position.
- Position-key, after pressing the servo, the servo will start to rotate counterclockwise. When the servo is in the servo mode, it will not continue to rotate after turning to the 0 position.
- Speed+ and Speed- are used to set the speed of the servo. The maximum setting for ST series servos is about 3073. The speed is the number of steps per second, 50 steps/sec≈0.732RPM.
- Set Middle Positionkey, no matter what position the current servo is in, when this key is pressed, the servo will set the current position to the middle position (2047).
- Set Servo Modekey, set the servo to servo mode, 360° absolute angle control can be performed in the servo mode, the setting will be permanently saved and will not be lost even if the power is turned off.
- Set Motor Modekey, set the servo to stepper motor mode, the servo can rotate continuously 30,000 steps. If you press it continuously, the motor will keep rotating. This mode can control the relative angle within ±7 circles and the number of circles will not be saved when power is off, but the stepper motor mode settings will be permanently saved even if power is off.
- Start Serial Forwardingbutton, set the servo driver board to serial forwarding mode, you can directly control the servo and get the feedback of the servo with the type C interface on the board. This function is used to debug the servo.
- Normalkey, set the servo driver board to normal mode, in this mode, it will not send or receive any information via ESP-NOW.
- Leaderkey, set the servo driver board as the host, in this mode, the driver board continuously sends the ID, position, and speed of the current Active ID servo to the driver board of the controlled slave through the ESP-NOW protocol. After the servo driver board is turned on, the MAC:on the first line of the screen is the MAC address of this development board, which is unique, such as MAC: 08 3A F2 93 5F A8. The premise of ESP-NOW communication is to get the MAC address of the slave, please write down the address, and fill it in the broadcastAddress[] = {0x08, 0x3A, 0xF2, 0x93, 0x5F, 0xA8} of ServoDriverST.ino, then upload it to the driver of the host and the function is enabled.
- Followerkey, set the servo drive board as the slave, after changing the MAC address of the slave in the program of the host, it can act under the remote control of the host.
- RainbowONand RainbowOFFkeys are used to turn on and off the rainbow effect of RGB lights.
Resource
Demo
- ST/SC serial bus servo control library (Arduino IDE)
- ST/SC serial bus servo control library (Python)
- SC series servo sample demo
- ST series sample demo
Document
Software
Open source structure
Support
Technical Support
If you need technical support or have any feedback/review, please click the Submit Now button to submit a ticket, Our support team will check and reply to you within 1 to 2 working days. Please be patient as we make every effort to help you to resolve the issue.
Working Time: 9 AM - 6 PM GMT+8 (Monday to Friday)