The right sensor is chosen to better solve the robot's movement

In order to complete a specific task, the robot must have some action. At this time, it is necessary to know how to control the robot to go straight and curve, so that the robot can move to the place where we want to do the task.

The robot is going straight, is it difficult?

We have seen some advanced robots that are very stable on the road. They will not only wrestle on the ground, but also maintain a good balance in the potholes.

However, there are other robots who walk and twist, and they can fall on the ground because they don't know their balance, step by step, step by step.

Look at RoboMaster's robot game. Although the robot has four wheels, it is not easy to fall, but you need to control your balance well if you want to run straight and turn drift as you like.

Red square robot flexible position

Because the robot's control system has errors, suppose you let the wheel turn 5 turns, and maybe one wheel only turns 4 turns. There are also mechanical installation errors, as well as wheel wear that causes different friction forces, which can cause the robot to run more and more.

In the article of PID Science, we learned feedback control: "What is PID control in robot games? 》. The benefit of feedback control is that, assuming a sensor to measure the actual data, there is a way to eliminate the error and stabilize the actual data on the desired data.

Therefore, the robot must only detect the error and eliminate the error in time to run as desired. How do you find the error?

Suppose the goal is to get the robot out of a straight line. The robot is twisted and twisted because various disturbances cause it to rotate about a direction perpendicular to the ground, that is, the direction of the head swings left and right. Therefore, look for a sensor to measure the amount of rotation of the robot perpendicular to the ground and then eliminate this rotation.

The right sensor is chosen to better solve the robot's movement

Produce rotation

Find the right sensor

In general, looking for sensors will be based on physical principles. High school physics is divided into force, heat, sound, light, electricity and magnetism. First look at mechanics, the object will have a centripetal force F when it spins, the formula of centripetal force is:

The right sensor is chosen to better solve the robot's movement

It can be seen that although F and ω (angular velocity) are related, it seems that ω can be obtained by F, but F is also related to r (radius of rotation), and this r cannot be measured, so the idea of ​​centripetal force does not work.

In addition to centripetal force, there is another force called Coriolis force. If a rotating object has a linear motion due to inertia, an offset occurs with respect to the rotating object, and this force is generated. Its formula is:

The right sensor is chosen to better solve the robot's movement

v is a measurable vibration generated internally. Coriolis force is different from centripetal force, it has nothing to do with the radius of rotation, so this idea is feasible.

In reality, there is a sensor that uses this principle to measure angular velocity. This sensor is called a MEMS gyroscope (micromachined gyroscope). After the MEMS gyroscope measures the angular velocity, the angular velocity is integrated to obtain the relative angle (the reference system is a certain state of itself, such as the state immediately after starting), and finally the angle is corrected by the PID to achieve a straight-through effect.

Gyro

We all know that there will always be errors in the measurement. The angle obtained by the integral is reliable in a certain period of time, and the integral will accumulate the error. After a period of time, the angle will become more and more inaccurate. The length is basically related to the price of the device.

The right sensor is chosen to better solve the robot's movement

A similar principle is also used for mechanical gyroscopes and fiber optic gyroscopes. The mechanical gyroscope is the only sensor that really has a spinning top. In optics, it is generally a gyro based on the Sagnac effect.

Mechanical gyroscope

In fact, the more accurate name for these sensors should be: angular velocity sensor. But for various reasons, it is now called a gyroscope. In combination with cost and measurement methods, MEMS gyroscopes are generally used.

Get the angle of rotation

Take the ADIS16470 gyroscope as an example to explain how the gyroscope gets the angle.

The right sensor is chosen to better solve the robot's movement

ADIS16470 gyroscope

The gyroscope can measure the angular velocity and integrate the angular velocity to obtain the angle. If you want to get a real-time angle, you need to know the time interval of each measurement, and use the time and angular velocity to re-integrate, you can get the real-time angle.

There are two ways to get the time interval:

1

Install a timer

The timer calculates the time interval and then informs the gyroscope. But there will be a time delay.

The right sensor is chosen to better solve the robot's movement

2

Gyro self timing

The ADIS16470 gyroscope has a timing function and reports time to itself without delay errors.

The right sensor is chosen to better solve the robot's movement

Gyro error

There is always an error in the measurement, and the gyroscope error is caused by various external force disturbances and temperature changes. The error will cause the robot modified by the gyroscope to swing from side to side, not to get a smooth line, or to spin slowly when it is stationary. This phenomenon is called drift.

Left and right jitter

This error may have little impact on the ground robot, but for drones or other robots with extremely high precision requirements, a slight deviation is fatal.

How to eliminate the error

Temperature factor error

The temperature-induced drift is referred to as temperature drift. The main reason is that the internal measuring device changes with temperature. There are generally two ways to solve it:

1

Hardware type

Add a large resistance to the gyroscope to heat it, and force the gyroscope to reach a certain temperature to maintain a constant temperature;

2

Software type

First measure the temperature drift at different temperatures, then perform fitting and compensation, that is, temperature drift calibration, so that the gyroscope has different fitting and compensation at different temperatures.

Error of other factors

In addition to measuring the relative angle, there are sensors that measure the absolute angle (the reference system is the geodetic coordinate system). The angle can be corrected by complementing the absolute angle and the relative angle.

Another type of sensor is called a geomagnetic meter, which is equivalent to an electronic compass that can indicate the direction of the earth's magnetic field. This sensor measures the angle of itself and the Earth's magnetic field, which is the absolute angle.

The right sensor is chosen to better solve the robot's movement

Since the magnetic field environment is very sensitive, the rotation of the motor and the steel structure of the house will affect the magnetic field, so the angle of the magnetic field is generally inaccurate, but it is stable in the same environment.

It can be known that the gyroscope is suitable for short-term and dynamic, and there will be drift under a long time; the magnetometer is suitable for long-term and static, and there will be errors under dynamic conditions. Take each leader, combine the two data, and use the appropriate filtering and algorithm fusion means to get the accurate angle value. This process is also the attitude solution.

The right sensor is chosen to better solve the robot's movement

Data Fusion

The Kalman filter is generally used for solving. In addition to the Kalman filter algorithm, there are other fusion algorithms, such as first-order complementary filtering, second-order complementary filtering, and weight parameter adaptive complementary filtering. Their complexity is different, and the appropriate algorithm should be selected according to actual needs.

Kalman filter

For the solution of the angle value, a sensor is often powerless and requires multiple sensors to complement each other. Gyro data is the core part, and other sensors are basically used to suppress the drift of the gyroscope.

In actual engineering, measuring the attitude of an object is a very common requirement, so many products will integrate a variety of sensors such as gyroscopes, accelerometers, electronic compasses, etc. into one module, no need to install one by one, is it not? Convenient and considerate.

Module with multiple sensors

Through the above series of methods, we obtain the angle of an object relative to the starting position, and then use the PID feedback control to let the robot run as desired.

It is also possible to mount such a set of sensors on a gimbal to treat the movement of the chassis as a disturbance. When the chassis is shaking back and forth, the gimbal will remain stationary with the ground as the reference system, and the pan/tilt can be controlled separately.

The gimbal is still, the body is twisted

All in all, the robot goes straight or twists like the picture above. It looks like a very simple thing, but there are many influencing factors. The implementation of each step needs to be fully considered. Only by selecting the right sensor can it be better solved. problem.

Ultra-Fast Scanning External Cavity Tunable Laser

Ultra-Fast Scanning External Cavity Tunable Laser,Tunable Diode Laser Analyzer,Applications Tunable Laser,Tunable O-Band Laser

AcePhotonics Co.,Ltd. , https://www.acephotonics.com