Freescale Smart Car

Source: Internet
Author: User

This year is to do is photoelectric upright, the program is mainly referred to the official website above the Tsinghua program. The principle of what is not specific research, the scheme and the paper is very detailed.

There are three main parts: 1 angle control, 2 speed control, 3 direction control. It also uses the complementary filter to calculate the angle and use the PID algorithm to control.

The first is the angle control, using the gyroscope integral to calculate the angle, and because the integral will lead to the accumulation of errors, all need to use the accelerometer for correction, here is the use of complementary filtering algorithm. When the accelerometer calculates the angle, we use the method is to obtain an upright time initial value, then let the car model to the left tilt to the level, thought that at this time the accelerometer's numerical A1 corresponding angle is 90° (or -90° also can), after lets the car model to the right tilt to the level, It is assumed that at this point the value of the accelerometer A2 corresponds to an angle of -90° (before-90 degrees corresponds here to 90°). Then using the accelerometer to calculate the angle can be used in the A1-A2/(* * * A3 (A3 is the current accelerometer output) calculation angle (formula here to pay attention to a positive and negative problem, specific can be tested, here is not specifically described), so the calculation angle will have a certain error, However, considering the upright is not a requirement angle is very accurate, all do not study other ways of settlement angle. When calculating the angle, using complementary filtering and angular velocity integration, there are two ways of fusion, one is the acceleration calculation of the angle of direct and gyro integration out of the angle of fusion, is Ratio_accel * angle_accel + ratio_gyro * angle _gyro, here the two scale (ratio) individuals think should be satisfied with the addition and 1, but because there is no attempt,Leave a question here for the moment. The second method is Tsinghua's plan, he is the use of the accelerometer calculation angle, and the previous calculated angle to do poor, and then divide the difference by a time constant ( not quite understand why ) , after processing the deviation directly added to the output of the angular velocity, and then the output of the angular velocity has a proportion, by adjusting the number to complete the fusion, debugging needs to use the upper machine, the proportion of the gyroscope led to the angle calculation is slow, The gyroscope scale is too small (relative to the accelerometer is too large) will result in the calculated angle output is not smooth enough, the final can determine a more appropriate proportion. Then, according to the PID algorithm to control the angle, and directly convert it into a voltage. Here is the PD control, D (differential) corresponds to angular velocity, and here is not a very understanding of the difference between PID,PI,PD etc. Finally, the voltage is converted to the PWM output to the wheel above, you can complete the upright, you can consider adding a bit of dead-zone voltage, because two of the motor is not completely consistent. In the adjustment of PD, the first adjustment of P so that the car can swing around the upright state, but note that the pure p is not allowed to stand upright, and then increase the d,d can suppress jitter, but d over the General Assembly led to the high-frequency vibration of the model. The model can stand upright after adjusting the PD, but because there is no speed of closed-loop control, all will appear in one Direction constant (or a little acceleration) forward this is no problem. After adjusting the speed control behind, it will be able to stand up better.

It's written here, and the rest is written.

Freescale Smart Car

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.