tirsdag den 19. august 2014

Final Project - Lesson 10

Session 10

Date: 18/06 2014
Duration of activity: 9.15 - 16.00
Group members participating: Pætur Askildsen, Christian Jegstrup Hansen, Søren Gregersen, Søren Ditlev and Alexander Rasmussen


Goal

Test and fine tune the complimentary filter

Plan

Use a data logger to produce logs for the gyro, accelerometer and filter with time stamps. Use Excel to graph the logged data and analyze it.   

Result

Logging the complimentary filter

All test are performed the same way. The car is placed on the tube and held steady by hand. The car is then moved 1x forward, 1x backward, 3x forward, 1x backward and held steady for a few seconds. See picture below:

Figure 1 :  The test setup

Log 1:
Figure 2
As is visible from figure 2  the filter(orange) seems to work. The gyro(blue) drift over time whereas the filter seems to stay roughly around zero. However there are a few things to notice about the accelerometer(purple). It is centered around the middle and fluctuate very little. This is unexpected as accelerometer should be very sensitive. The solution we were able to come up with is that because the accelerometer is moved in a circular motion as opposed to a straight line (see figure 3 ). This drastically reduced the amount of force that affects the accelerometer hence the low fluctuation. This is not a bad thing however since accelerometer reading stay around zero and therefore help keep filter in check ie. not drifting like the gyroscope. We also noticed that the accelerometer offset is slightly off (2 degrees too high) and that the accelerometer readings is actually inverted. This can be seen as the accelerometer goes up when the gyro goes down and vise versa.  

Figure 3: Accelerometer reading -  difference between segway and tube balancer.


Log 2:
Figure 4

Here we made changes to the accelerometer, we inverted the axis to be correct and changed the offset, but since we inverted the axis we accidently moved the offset two degrees the wrong way meaning that it was even more displaced than in iteration 1.

Log 3:
Figure 5

Again a few more corrections. Accelerometer offset is now correct and we have changed the weight of the gyroscope to 99% and the accelerometer to 1%. The reason behind this operation is simple. First of the gyro is accurate in short term. By making the gyro weight more in the equation the filter will more closely resemble the gyro data(see first iteration compared to third) , in the short term (notice how well the filter curves follows the gyro curves early). Second since the accelerometer’s only purpose is to keep the filter from drifting like the gyro (especially in our case where the accelerometer is just centered around zero).  it makes great sense not to rely on it as much. The accelerometer still serves it purpose, preventing drift, as evident by the last red circle.  

Conclusion

We have done extensive testing with the complementary filter, and succeeded in producing very promising results. However when implemented and used on the tube balancing robot it does not work as stable as when running the filter alone. It is definitely possible to get it to work, but will need some more testing and changing of parameters to work better.

Ingen kommentarer:

Send en kommentar