This section is divided into five subsections. Through the study of this part, we will understand the concept and components of robots, have a clear idea of the overall design of the robot, and then introduce the basic ideas for designing an intelligent car through the four main components: mechanical structure, drive system, sensing system, and control system.
Through this lecture, we hope that everyone can have a clear understanding and development idea of intelligent cars in their minds. In the future, we will tackle each part step by step and build it piece by piece.
Overall Design Concept
From the perspective of control, robots can be divided into four main components as shown in the figure: sensing system, actuator, drive system, and control system.
First, let’s look at the actuator, which is an important device for the robot to move. For example, a mobile robot needs to move, so how do we drive the wheels to rotate or turn? This is done using motors and servos to execute the movement. However, not all moving parts will have motors installed. For example, in a real car, there is generally only one motor or engine. So how do we make two wheels or even four wheels turn? This requires a transmission system that completes power distribution, such as dynamically adjusting the speed of the left and right wheels when turning, which requires precise mechanical design, namely the function of a differential. In addition to mobile robots, in some industrial robots, the motors for driving the robot’s joints and the suction cups for grasping objects can also be seen as actuators. In short, the actuator is a set of devices that execute movement.
To ensure that the actuator accurately executes actions, a drive system needs to be connected in front of the actuator. For example, if we want the robot’s motor to rotate at a speed of 1m/s, how do we dynamically adjust the voltage and current to achieve accurate movement? This is accomplished by the motor driver. If it is an electric actuator, the corresponding drive system generally consists of a driver board and control software, which is also an important field of embedded systems application. The concepts we learn in school, such as microcontrollers, PID, and digital circuits, are closely related to this part. The selection of the drive system is based on the actuator. For example, for a regular DC motor, a driver board similar to this will suffice. In industry, servo motors often require 220V or even 380V voltage, which necessitates the use of a professional servo driver. There are also pneumatic drives for suction cups, external device drives like keyboards and mice, and various sensor drives. In short, the responsibility of the drive system is to ensure the normal operation of various devices in the robot.
A robot cannot just move; it also needs to have sensing capabilities, which rely on the sensing system. The sensing system is generally divided into internal sensing and external sensing. Internal sensing is used to perceive the robot’s own state, such as calculating the speed of its wheels through odometers to determine cumulative displacement, sensing the robot’s angular acceleration through gyroscopes, judging the state when turning, and perceiving acceleration in various directions through accelerometers to determine motion trends or slopes. Force sensors can also be used to sense the interaction force between the robot and the external environment, such as when grasping an egg without breaking it.
In contrast to internal sensors, external sensors help the robot perceive external information, similar to human eyes. For instance, cameras can capture external color images. However, robots can surpass human limits through various external sensors. For example, infrared sensors can allow the robot to see its surroundings even in the absence of light, similar to night vision devices. Laser radar, sonar, ultrasonic sensors, and other distance sensors can perceive obstacles within a certain angle range. Additionally, microphones and speakers facilitate voice communication with the robot.
The sensing system is a crucial component of intelligent robots. Many robots are equipped with dozens or even hundreds of sensors to perceive various information about themselves and their environment, such as in autonomous vehicles.
At the upper level of these systems is the brain of the robot—the control system. The control system is generally composed of hardware and software. The hardware mostly uses processors with rich computing resources, such as our commonly used laptops, Raspberry Pi, NVIDIA boards, etc. The software running on them consists of various rich applications, such as enabling the robot to build maps of unknown environments, moving to delivery locations, or recognizing faces.
The core algorithms of intelligent robots are implemented within the control system, which is also the main area for our future robot software development.
Robot Examples
Mechanical Structure Design
Taking the above robot as an example, it seems that this small car is not complicated.
The chassis is the base of the entire car, with four wheels and corresponding motors and servos installed through screws to drive the car’s movement.
The first layer on the chassis is the battery, which is relatively heavy and should be placed at the bottom to lower the center of gravity of the car. The second layer is used to place the main sensors and controller boards, which can effectively hide the overlap of the two layers while ensuring the safety of the boards.
At the front end of the car chassis, to install the camera, we need to design a mounting bracket, one side fixed to the chassis with screws, and the other side can hold the camera, preferably adjustable for the camera’s viewing angle.
The third layer has an LED display and some through-holes for placing sensors that require a certain height for debugging, such as radar.
Additionally, RGB light strips are placed on both sides of the car body to make it look cooler.
This is the mechanical structure of the intelligent car, and everyone can choose various component sizes based on their choices.
Next, let’s focus on the car’s actuator structure, which consists of these two motors and four wheels. How do they control the car’s movement?
For intelligent cars, there are generally three common modes of movement, which will be introduced one by one.
Differential Drive Mode
What is differential drive? Simply put, it is to drive the robot forward or turn by the speed difference of the two sides of the driving mechanism.
A balance car is a typical example of differential drive. Imagine the movement of a balance car: if both wheels rotate at the same speed, the balance car moves forward; if they rotate backward at the same speed, the balance car moves backward. If the left wheel’s speed is faster than the right wheel’s, the balance car turns right; conversely, it turns left. This is the most basic movement method of differential drive.
From this image, you can also see that the key to differential drive is the speed difference of the wheels on both sides. For example, in the case of household vacuum robots, you can see that generally, there is a driving wheel on both sides, totaling two wheels, which can be called two-wheel differential drive. You may have also seen slightly larger vehicles, such as Meituan and JD’s automatic logistics robots, many of which have four driving wheels. The principle is similar to two-wheel differential drive, but the load and obstacle-crossing capabilities are stronger, which is similar to the difference between two-wheel and four-wheel drive in cars; four-wheel drive has stronger power performance.
Omnidirectional Wheel Drive Mode
If we want the robot to move forward, we need to cancel the lateral forces exerted by the left and right wheels. Hence, the two wheels must be symmetrical. If they are not symmetrical, the lateral forces will all act in one direction, causing the robot to veer off course.
If we want the robot to move sideways to the left, we need to cancel out the longitudinal forces, meaning one wheel turns backward while the other turns forward.
If we want the robot to move diagonally, we can simply leave the opposite wheels stationary; the resultant force from the two moving wheels will point diagonally forward at a 45-degree angle.
Thus, the movement of the omni-wheel platform is a contest of forces between the wheels.
Ackermann Drive Mode
This is a diagram of the Ackermann steering principle. If you look closely at the states of the front and rear wheels, they resemble two bicycles riding side by side, right? Yes, we generally simplify the Ackermann model to an equivalent bicycle model; the two models are essentially consistent in terms of movement mechanics. Think about the image of us riding a bicycle; the handlebars control the front wheel’s steering, but there is no power; the pedals transmit power to the rear wheels through a series of gears, driving the bicycle forward. These gears are analogous to the differential.
Drive System Design
Previously, we introduced that the robot’s drive system can be divided into several methods. Think about which ones we need for the intelligent car.
Motor drive is definitely required; we need to make the car’s motors rotate.
Sensing drive is also necessary; the odometer and IMU in the car need to be powered to obtain data.
There is also peripheral drive; the communication between the controller board and the application processor as the lower computer needs to transmit data via serial ports, requiring serial port drivers. We also hope to understand the state of the car, which is generally designed with LEDs or buzzers on the controller board for human-machine interaction, which also requires IO drivers.
It seems that the drive system needs to support many devices. It is the foundational layer of the intelligent car; a strong and stable drive system is a necessary guarantee for the development of upper-layer applications. Please do not overlook this in your design and development.
Sensing System Design
The sensing system is divided into internal and external categories. I believe everyone has understood the sensors in the intelligent car through previous explanations.
Internal sensors mainly include encoders on motors and IMUs on the control board.
External sensors mainly refer to the camera at the front end.
Odometer
The odometer is a commonly used sensor in mobile robots.
It is similar to the odometer in a car that records the distance traveled. It records the distance by counting the number of wheel rotations. Robots typically install a sensor on the wheel or motor to detect the rotation speed of the wheel and integrate over time to obtain the robot’s real-time position and speed. This device is called an odometer, and there are various devices that can achieve this function.
For example, on some cars, you may see an encoder installed next to the motor, which has several openings. The rotation of the motor drives the encoder, and the light emitted by a photodetector passes through the openings at a certain frequency, which is captured by the receiver. By measuring this frequency, we can calculate the rotation speed of the motor and obtain information such as how far the robot has traveled and how many degrees it has rotated.
The intelligent car we designed uses another type of odometer called a Hall sensor, which is installed at the rear of the motor. When the motor rotates, the Hall sensor detects the signal generated by the surrounding magnetic field to measure the rotation speed of the motor, thus obtaining the robot’s state information.
So whether it’s a photodetector encoder or a Hall sensor, they calculate the number of wheel rotations based on the number of pulses generated within a unit time, and then calculate the robot’s speed using the wheel circumference, integrating speed over time to get odometer information. This is the basic principle of an odometer.
However, odometers have a problem: each measurement has an error, and as integration continues, the error will inevitably be amplified, which is commonly referred to as cumulative error in odometers.
Camera Imaging
https://www.guyuehome.com/46197
Control System Design
Hardware Selection
As previously mentioned, the drive system and sensing system will ultimately connect with the control system, the brain of the robot.
Generally, we will complete these functions in the control system, which is also the main battlefield for our robot development. The ROS we will use later is the primary weapon in this battlefield.
In the development of intelligent cars, placing a computer directly on the robot is certainly not appropriate. The common approach is to use smaller embedded application processors, such as the commonly used Raspberry Pi, Jetson Nano, RDK X3, which can meet the development needs of intelligent cars.
Let’s compare the parameters of these three boards. The CPU and memory are similar, but for application development of intelligent cars, we pay more attention to computing power and framework support. Theoretically, the higher the computing power, the smoother the applications we can implement, such as human recognition. RDK X3 has 5T of computing power, which is significantly advantageous compared to other boards. In terms of framework support, all three support ROS, and RDK X3 provides a deeply optimized ROS2 system called TogetheROS, which includes many intelligent application functions.
In summary, we choose RDK X3 as the hardware platform for the control system. Of course, in your intelligent car designs, you can use other platforms as well, as the software is generally universal, though there may be some differences in applications with higher computing power requirements.
How to implement the software department of the control system?
Let’s clarify this with a diagram.
The motion controller is the core of the drive system, responsible for controlling the motors and detecting the robot’s status. The implementation of various functions is part of embedded development, utilizing timers, IO, PWM, PID, and many other concepts and principles.
The control system is the brain of the intelligent car, running functions like autonomous navigation, map construction, and image recognition, while also handling some sensor driver tasks. It collects information from external cameras and radars via USB.
The communication between this control system and the motion controller is completed via serial ports.
To facilitate the robot’s control, we will also use our laptops to connect to the robot for coding and control.
In this entire framework, the application functions within the dashed box are developed and implemented based on ROS2 and TogetheROS, while the functions in the motion controller are implemented based on embedded development. From this diagram, you can better understand the relationship between ROS development and embedded development; both serve distinct roles, one focusing on upper-level applications and the other on lower-level control, together achieving the intelligent functions of robots.
Alright, at this point, I believe everyone has a clear understanding of the design concept for the intelligent car.
Returning to our initial question, how do we design and develop an intelligent car from scratch?
Our goal is to create such an intelligent car, which after disassembly consists of these components, divided into four main parts: actuator, drive system, sensing system, and control system. In future courses, we will continue along this line of thought, detailing the design and implementation of each part.
Click “Read Original” to view this week’s recommended courses