Cobra Flex
| ||
Introduction
Cobra Flex is a universal modular wire controlled chassis with strong off-road capability and seismic performance. It is open source with all code, making it convenient for users to use for secondary development. It requires the expansion of multiple upper computers (such as Raspberry Pi, Jetson Orin Nano, etc.) and can communicate with the chassis through USB or serial port. The four wheels are driven by a bus hub motor with built-in FOC control circuit, which is powerful and has a smooth rotational speed. Reserved a large internal space for users to install a battery set for uninterruptible power of the robot (a 3s2p 18650 Lithium battery set is recommended), supports charging and power output at the same time. The built-in multi-functional robot driver board, adopts strong and weak electric isolation design and can expand bus servos. The driver board is based on ESP32, with on-board Wi-Fi (only for short-distance debugging) and Bluetooth. The compact four-wheel independent suspension with CNC process makes it easy to meet the needs of heavy loads, shock absorption and off-roading. It comes with two 1020 Euro-standard extrusion expansion rails, providing more feasibility for secondary development.
Specifications
| Cobra Flex related parameters | |||||
|---|---|---|---|---|---|
| Physical parameters | Size (Length*Width*Height) | 235*173*101 (mm) | Performance parameters | Drive mode | Differential drive |
| Weight | 2375±5g | Suspension | 4-wheel independent suspension | ||
| Maximum load | 12kg | Maximum operating speed | 0.53m/s (subject to voltage) | ||
| Wheelbase | 154mm | Minimum turning radius | 0m (in-situ rotation) | ||
| Track width | 228mm | Maximum climbing angle | 30° | ||
| Ground clearance | 34.24mm | Motor no-load speed | 180rpm (subject to voltage) | ||
| Drive wheel diameter | 74.5mm | Operating temperature | 0~40℃ | ||
| Electrical parameters | Supply voltage | 9~12.6V | Motor parameters | Operating voltage | 9~28V DC |
| Battery specification | 5000mAh 18650 lithium battery×6 | Rated current | 0.24±0.07A | ||
| Battery life | 10h | Rated speed | 100rpm | ||
| Charging time | 3h | Rated torque | 0.15Nm/V | ||
Features
- Independent Suspension - High Strength Shock Absorption: The four-wheel independent suspension system built with CNC craftsmanship is compact and has excellent shock absorption performance, making it easy to cope with rough terrain.
- Bus Hub Motor: Adopts bus hub motor with built-in FOC control circuit for strong power and smooth operation.
- High-efficiency Power System: Reserved a large internal space for users to install a battery set for uninterruptible power of the robot (a 3s2p 18650 Lithium battery set is recommended), supports charging and power output at the same time.
- Multi-function Driver Board: The main control module is based on ESP32, with built-in Wi-Fi (only for short-range debugging) and Bluetooth, and supports expansion of bus servos, sensors and other peripherals.
- Separation of High-Voltage and Low-Voltage Circuits: The driver board adopts the design of separation of high-voltage and low-voltage circuits, which effectively improves system stability and electrical safety.
- Modular Design: The Cobra Flex adopts a modular structure and is compatible with various upper computer platforms (such as Raspberry Pi, Jetson Orin Nano, etc.). It supports USB and serial communication, making it convenient for users to conduct secondary development.
- Open Source Code: All the code of the lower computer is open source and provides rich development documents and tutorials.
- Scalability: The structure is equipped with double 1020 European standard profile rails, flexible expansion space, can easily carry cameras, radar, robotic arms and other modules.
Description
Chassis Structure Description
The following are annotations of various parts and commonly used interfaces of the Cobra Flex:
Product Assembly
Precautions
Please read the following before use:
- Please use qualified 3s2p 18650 Lithium battery set to avoid damaging the battery or catching fire.
- The product supports charging and discharging at the same time, but it is not recommended to use it for a long time during high load tasks to protect battery life.
- Do not leave the batteries in overcharged or overdischarged states for long periods of time. Please check the voltage regularly and maintain the battery.
- This product has a protection level of only IP32 and should not be operated in rainy, muddy, snowy, or high humidity environments.
- Long term high temperature (>40 ℃) or low temperature (<0 ℃) can affect the performance of batteries and motors, please use them reasonably.
- The robot provides a DC5521 female to DC5525 male + XH2.54 female adapter cable for power supply from the battery pack to the Jetson Orin Nano. This power is output directly from the battery pack and cannot be used directly to power a Raspberry Pi. An additional power supply or a step-down voltage regulator is required for the Raspberry Pi.
Product Firmware Update
We offer the ESP32 download tool for Cobra Flex, which allows users to quickly update the firmware or restore the product to factory programs.
1. First, connect the robot to your computer using a USB cable. (This step requires disassembling the robot to complete).
2. Download the ESP32 download tool for Cobra Flex: ESP32 download tool for Cobra Flex. After downloading, unzip and double-click to open the "flash_download_tool_3.9.5.exe" program. After opening, two windows will pop up, we need to operate the UI interface of the download tool, and the other window will act as a terminal to show the working status of the download tool.
3. In the "DOWNLOAD TOOL MODE" interface, select ChipType as ESP32-S3 and WorkMode as Factory. When using Factory, the binary file will be called using a relative path, so the user does not need to manually input the binary file path. After selecting, click OK.
4. In this software interface, keep the "LockSettings" checkbox selected, with the right side indicating that programs can be uploaded to 8 UGV02 units simultaneously. Click "COM", and select the new COM (the new COM here is COM3); BAUD is used to set the download speed, the higher the value, the faster the speed, and it can be up to 921600 for ESP32.
5. After selection, click "START" to start uploading the program. Once the upload is complete, "IDLE WAIT" will change to "FINISH COMPLETE". After completion, you can disconnect the USB connection between the driver board and the computer, turn on the switch of the robot product, and control the robot after powering on.
Product Usage and Development
Battery Selection
- Battery voltage: 9~28V
- The corresponding serial number of lithium battery cells is 3s~6s
- Voltage exceeding 20.5V cannot be directly supplied to Jetson. It must be stepped down before connecting to Jetson, otherwise it may damage the equipment
- Current requirements:
- The minimum current requirement for chassis devices (motor, LED lights, Lower device ESP32S3) is 5A, and it is recommended to use power lithium batteries or internal parallel battery packs, such as 3s2p lithium battery packs
- Size requirements:
- If you wish to reserve half of the internal space for other SBC devices: <115x70x20 (mm)
- If you want all the internal space to be used for storing batteries: <145x102x53 (mm)
- Interface requirements:
- Charging interface: It is best to have a DC5521 female head for connecting to an external power supply interface
- Power supply interface: DC5521 male connector or loose head
- Recommended purchase: 12V20000mAh/12V30000mAh
Basic Debugging
The first time you use it, you will need to plug it into the robot's power connector using the configured 12.6V 2A charger. After you turn on the power switch, the robot will initialize, and the OLED screen will display a series of initializations.
- The meaning of the display on the OLED screen after the robot is turned on is as follows:
- The first line indicates that the WiFi is in AP mode and the robot has created a hotspot, the WiFi hotspot is named UGV;
- The second line indicates that STA mode is off. the router assigns an IP address to the robot and displays it when the WiFi is in STA mode;
- The content of the third line is the MAC address of this device, which is unique and used for ESP-NOW communication.
- The fourth line V indicates the supply voltage of the robot product.
- After booting up, use your phone or computer to connect to the robot's WiFi: UGV, the password is 12345678. After connecting to WiFi, open Google Chrome and enter 192.168.4.1 in the URL bar to open the web interface. Next, you can use the buttons on the web to perform basic control on the robot, or send JSON commands to the robot on the web control interface.
JSON Communication Protocol
When communicating with the robot chassis, we use a specific control command—a JSON command—to tell the robot what action it should perform. In this section, we mainly introduce how to send JSON commands for robot control and instructions for using robot JSON commands.
What is JSON Command
JSON (JavaScript Object Notation) is a lightweight data exchange format, typically used for transmitting and storing data between different systems. JSON originally originated from JavaScript, but it has become an independent data format from programming languages and can therefore be used and parsed in various programming languages.
JSON commands are like a standardized "menu", which can tell the robot the speed of movement and the direction of rotation.
Basic Format of JSON Command
The basic format of a JSON command is: key:value
- The key must be a string enclosed in double quotation marks;
- Values can be of various types: strings, numbers, objects, arrays, Boolean values, or null. Among them, strings must be enclosed in double quotes, while others do not require quotes;
The following is the command for driving the robot to move:
{"T":1,"L":100,"R":100}
Among them, T, L and R in double quotation marks are keys, and values are after colons. Explanation of this command:
- "T": 1 means that this command is used to drive the robot to move (SPEED_INPUT). This is a fixed value, which cannot be changed, is a numerical value that the program recognizes the purpose of the command.
- The value of T is defined in the header file json_cmd.h of the product's slave computer program.
- Note: Different control commands will use different T values.
- "L": Indicates left-hand wheel speed. The range of speed is 0~1800, positive value is forward, negative value is backward. The unit is 0.1rpm.
- "R": Indicates right-hand wheel speed. The range of speed is 0~1800, positive value is forward, negative value is backward. The unit is 0.1rpm. The robot stops when the values of L and R are both zero.
This command tells the robot: "Please move forward at a speed of 10rpm."
Here is the command for driving the motor individually:
{"T":11,"M1":1000,"M2":1000,"M3":1000,"M4":1000}
- "M1": The speed of the left front wheel. The range of speed is 0~1800, positive value is forward, negative value is backward. The unit is 0.1rpm.
- "M2": The speed of the right front wheel. The range of speed is 0~1800, positive value is forward, negative value is backward. The unit is 0.1rpm.
- "M3": The speed of the right rear wheel. The range of speed is 0~1800, positive value is forward, negative value is backward. The unit is 0.1rpm.
- "M4": The speed of the left rear wheel. The range of speed is 0~1800, positive value is forward, negative value is backward. The unit is 0.1rpm.
Here is the command for getting feedback from the robot:
{"T":130}
The command for the feedback of the Q&A mechanism is as follows:
{"T":1001,"M1":0,"M2":0,"M3":0,"M4":0,"odl":0,"odr":0,"v":1173}
- "M1": The speed of the left front wheel. The range of speed is 0~1800, positive value is forward, negative value is backward. The unit is 0.1rpm.
- "M2": The speed of the right front wheel. The range of speed is 0~1800, positive value is forward, negative value is backward. The unit is 0.1rpm.
- "M3": The speed of the right rear wheel. The range of speed is 0~1800, positive value is forward, negative value is backward. The unit is 0.1rpm.
- "M4": The speed of the left rear wheel. The range of speed is 0~1800, positive value is forward, negative value is backward. The unit is 0.1rpm.
- "odl": The mileage of the left wheel. The unit is cm.
- "odr": The mileage of the right wheel. The unit is cm.
- "v": the voltage.
Below is the continuous feedback command to start the robot:
{"T":131,"cmd":1}
- "cmd": 0 for off, 1 for on.
Below is the continuous feedback command to start the robot:
{"T":132,"IO1":255,"IO2":255}
- "IO1": The brightness of the front LED light, with a value range of 0~255, where 255 represents the brightest.
- "IO2": The brightness of the front LED light, with a value range of 0~255, where 255 represents the brightest.
Why use JSON commands for communication?
The following are the advantages of using JSON formatted commands to control robots:
1. Good readability
JSON is a lightweight text data format that is easy for humans to read and write. It uses the form of key-value pairs, which makes the commands easy to understand and debug, especially during the development and testing phases.
2. Easy to parse
Many programming languages provide JSON parsers, making parsing JSON commands very easy. This makes it easy to convert commands into executable operations.
3. Cross platform compatibility
JSON is a universal format that can be used on almost any programming language and platform. This means that you can use different programming languages to send and receive JSON commands.
4. Structured data
JSON supports nested data structures and can contain objects and arrays. This allows you to organize commands in a clear manner, including parameters, options, and subcommands.
5. Scalability
You can easily add new fields and parameters to JSON commands to support more features and options without changing the overall structure of the command.
6. Easy to integrate
JSON is the standard input and output format for many APIs and Web services. This enables robots to seamlessly inherit from other systems and services, such as communicating through REST APIs.
7. Standardization
JSON is a standardized data format that is widely supported and adopted. This means that you can use various libraries and tools to process and manipulate JSON data.
8. Support for multiple languages
Due to the fact that JSON can be used in multiple programming languages, it is possible to implement robot control systems written in multiple languages without the need to rewrite command parsers.
Overall, JSON formatted commands provide a simple, flexible, readable, and easily parsed way to control robots, making robot control systems more powerful and maintainable.
Product Hardware Introduction
Slave Driver Board Onboard Interfaces
![]()
1. ESP32 main controller
2. 12V switch interface controlled by ESP32‑IO1
3. 12V switch interface controlled by ESP32‑IO2
4. I2C device interface
5. 12V switch interface controlled by ESP32‑IO8
6. 12V switch interface controlled by ESP32‑IO9
7. ESP32 RESET button
8. USB communication/download interface
9. ESP32 BOOT button
![]()
10. Main controller 20PIN expansion interface
11. Power supply screw terminal
12. Power switch interface
13. LIN hub motor interface
14. RSBL servo interface
15. Host communication interface
16. Serial hub motor interface (TTL level)
17. Hub motor power supply interface
18. RS485 hub motor interface
Resources
Cobra Flex Drawing
Cobra Flex 3D Model
Cobra Flex 2D Dimensions
Software
Software
Lower Computer Source Code
ROS2 Driver and Model Package
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)

