... | ... | @@ -33,6 +33,28 @@ The filter have the form: |
|
|
The filtered gyro data is shown in the lower part of the figure below.
|
|
|
![Upper part: Gyro measurements with both motors turned on at full power. The car was places on the back and did not move. Lower part: Filtered gyro measurements with an exponential filter.](https://gitlab.au.dk/rene2014/lego/raw/master/Lesson8/Images/GyroDataNoMove.png)
|
|
|
|
|
|
The filtered data does not have the same spikes as the raw data, but it have a smaller amplitude. The `alpha` value used here is 0.85.
|
|
|
|
|
|
## Gyro measurements on a plateau
|
|
|
|
|
|
### Setup
|
|
|
In order to use the gyro sensor to detect when the car is entering a plateau, a test is conducted. The car is placed on the ramp and both motors are set to full power. During the run raw gyro sensor data is logged using a datalogger.
|
|
|
|
|
|
### Results
|
|
|
In the figure below the raw and filtered gyro data are shown. In the beginning of the run the wheels slipped, which caused oscillations in the gyro data. This is seen from 0-1 seconds. After one second the car gained grip on caused a increase in the gyro data. At 1.7 seconds the car entered the plateau, which caused a dip followed by a rise in gyro measurements. This is characteristic and can be detected using an algorithm.
|
|
|
In the filtered data, the measurements is below 550 in 100 ms and above 640 in 130 ms. We have chosen to let the algorithm work the following way:
|
|
|
A plateau is entered if:
|
|
|
- the data is below 550 in 50-150 ms
|
|
|
- followed by a rise above 640 in 60- 170 ms.
|
|
|
[INSERT code snippet of algorithm]
|
|
|
|
|
|
|
|
|
![Upper part: Gyro measurements with both motors turned on at full power. The car was on the first ramp on the Alishan track, and stopped on the first plateau. Lower part: Filtered gyro measurements with an exponential filter.](https://gitlab.au.dk/rene2014/lego/raw/master/Lesson8/Images/GyroBadVejgrebFirstPlat.png)
|
|
|
|
|
|
Note that this test might only be valid for entering a plateau from below.
|
|
|
TODO add data for entering a plateau from above.
|
|
|
|
|
|
|
|
|
|
|
|
## Conclusion
|
|
|
|
... | ... | |