Design of gyro inertial navigation for mopping machine

Industry News, Technology Design · 2016/04/26
← Return to technical article

A single-axis gyroscope can be used in a tractor, for example, in Mint5200 to simulate a single-axis gyroscope, but a simulation gyroscope needs to be operated externally and CPU...

A single-axis gyroscope can be used in a tractor, such as the mimint5200 simulation of a single-axis gyroscope, but the simulation of a gyroscope requires off-site operation amplifier and CPU's AD converter for high speed processing. Since the calculation is angular velocity, real-time updating requirements are high. MPU 6050 is a chip that combines a digital 3-axis gyroscope with a 3-axis accelerator sensor, with 16-digital signals. The sale price is not very expensive, and in 2012 the price was about 14 yuan yuan, while the price of the ex 3,500 was about $8, plus the cost of the extra drop-in and extra welder stickers. But using the MPU 6050 performances, the price is much the same.

MPU6050 is a product of invensense in the United States with an agular velocity hologram range of ±250, ±500, ±1000 and ±2000°/sec(dps), which can be accurately measured by fast and slow motion, and can set parameters to allow an acceleration range of ±2g, ±4g(1)(8g) and ±16g.

Reading raw data is not complicated, and there are many programs based on anarduino, and it is not very common to run on STM 32. Operating on STM 32 requires reading internal data through the I2C bus, and then reading through the CPU time-interrupted program, which calculates angular velocity. If the data on a single axis are calculated, an angle can be derived directly from the time-interrupting program, but the experiment found that the right or the right-turn calculation is correct if the tractor is fully horizontal. If you have a tilt angle, the angle of the actual rotation and the angle of the calculation vary, and the difference is influenced by the speed of the rotation and the angle of the angle. The reason is that, if it is not horizontal, the other two axes in the x, y, z axis have a projection amount that directly affects the calculation of the horizontal axis. To solve this problem, it is necessary to use the rotation matrix to calculate the angle of the Ori, or pitch, yaw, roll. But there are limitations to this approach, which tends to be endless at 90 degrees, i.e., one-way locks. So the way to improve is the four-element approach, which, of course, is more complex and involves more knowledge. There is a DMP within PU6050, which can directly output four-element, corner Euratom. But the DPM is not open and needs to contract with invensense. If the DMP does not run, many of the advantages of the PPU 6050 will not work well. If the DMP is not used, the external processor will be required to process the rotation matrix at high speed and to update the matrix calculation every 5 m, and each element of the matrix contains a series of different calculations, thus taking a very large share of the processor resources.

Since there is also a deviation in the data calculated by a separate gyro, in order to minimize the deviation, the acceleration sensor data should be integrated and then given different weights. The integration angle data is eventually calculated.

The data from gyroscopes are noise. For example, microshocks when machines run, because the PWM wave causes electrical interference with chips, and the gyro itself is drifting. If these disturbances are not removed, the final calculation is unreliable, from the point of view of the operation of the tractor, is to adjust instability and is prone to deviation. Reference can be made to the design of the Kalman filter, i.e., through the Kalman filter algorithm, which eventually collects data to the curve that actually works.

Also, the purpose of using gyroscopes on a tractor is to correct the angle of the deviation. But it is difficult to correct a long-term angle. For example, within 10 minutes, the angle is less than two degrees. The change in the angle of the gyro is detectable for a short time, and it is difficult to detect the change over a long time period. First, the gyroscope’s own data drift is eventually reflected in the change of perspective over time. Also received is the maximum output accuracy limit of MEMS itself. MPU 6050 has four ranges of ±250, ±500, ±1000 and ±2000°/sec (dps), with the option of setting it at 250, so that in the case of FS SEL=0, the LSB is 131 (o/s) in the case of AD 16bit. The gyro also has zero drift, and the zero drift is constantly changing. In addition to zero-point drift, its detection has an angular velocity that moves over time and is associated with temperature. These factors need to be analysed in depth, the impact of each interference factor on the overall output is to be calculated very carefully, and the output is to be responded to as closely as possible to the design requirements.

Here's a program for MPU6050 to read raw data, starting with initialization.

Adjusting the gyroscope and acceleration sensors to the most sensitive, i.e. +/- 2g and +/- 250 degrees/sec, at initialization, setting the clock source to X Gyro reference input, which is slightly better than the internal oscillator performance.

voidMPU6050_Initialize()

{

MPU6050_SetClockSource(MPU6050_CLOCK_PLL_ZGYRO);

MPU6050_SetFullScaleGyroRange(MPU6050_GYRO_FS_250);

MPU6050_SetFullScaleAccelRange(MPU6050_ACCEL_FS_2);

MPU6050_SetSleepModeStatus(DISABLE);

}

The MPU 6050 is then tested for normal connection, which is primarily used to detect any problems with the welded paste.

bool MPU6050_TestConnection()

{

if(MPU6050_GetDeviceID() == 0x34) //0b110100; 8-bit representation inhex = 0x34

return TRUE;

else

return FALSE;

}

Then the original output data is read in the time-interrupted program, and the following program reads the acceleration in three directions and the angular velocity data in three directions

void MPU6050_GetRawAccelGyro(s16*AccelGyro)

{

inti;

u8 tmpBuffer[14];

MPU6050_I2C_BufferRead(MPU6050_DEFAULT_ADDRESS,tmpBuffer,MPU6050_RA_ACCEL_XOUT_H, 14);

/* Get acceleration */

for( i=0; i<3; i++)

AccelGyro[i]=((s16)((u16)tmpBuffer[2*i] << 8) + tmpBuffer[2*i+1]);

/*Get Angular rate */

for( i=4; i<7; i++)

AccelGyro[i-1]=((s16)((u16)tmpBuffer[2*i] << 8) +tmpBuffer[2*i+1]);

}

A simple way to do this is to read the data, filter the waves, and get an angle shift when the internal points of the interrupted program are calculated. If a single-axis gyroscope is used, it will not affect performance in a short period of time, and it will not be easy to achieve it if it is required to maintain stability over a long period of time. Because there is a three-dimensional attitude shift in the front-hand angle when the tow machine operates, especially at the turn. There's a DMP inside MPU6050, which is actually a processor for the original data processing. If DMP is used, then the direct output of the calculated data is sufficient, and the external CPU is light, but without the internal DMP, it has to be self-calculated, and it is a considerable burden on software and hardware.

After the gyro gyro debugging is normal, the actual test results show that it is not ideal to keep the direction within acceptable limits within 10 minutes. Thus, the trawler also works with the external infrared method to fix the angle on a regular basis. See the navigation section before this chapter.

The straight-line gyro angle correction is performed in the master control program and, when a deviation of the angle is detected, the velocity of the left and right motors is adjusted to restore the angle to the pre-diversion state.

The angle of the side slide is also measured through gyro data, knowing that the side slide will record the current route, analyze the barrier and decide on the next move.