Session 7
Date: 12/06 2014
Duration of activity: 9.15 - 15.00
Group members participating: Pætur Askildsen, Christian Jegstrup Hansen, Søren Gregersen, Søren Ditlev and Alexander Rasmussen
Goal
Fine-tune the PID-values of the balancing car.
Plan
- Use the Bluetooth connection made in the last lesson to easily update the parameters in the PID-controller while the system is running.
- Log the gyroscope and accelerometer reading for data analyzation.
Results
Fine-tuning the PID parameters
We changed the PID to only take gyroAngle into account, not the angleVelocity. This proved much better. Before doing too much work on the fine-tuning of the PID-parameters, we need to find a method to prevent gyro drift. The tuning of the parameters is therefore just a rough sketch.
Tube-balancing robot
During the tests we ran into a problem, which made our calibrated gyro angle drift uncontrollably, even though the robot was not moving. We were able to get rid of this problem by adding a simple if-statement, surrounding the update statement of the gyro angle. The if-statement sorts out small angle changes which is caused by the inaccuracy of the gyro sensor. The statement looks as follows:
We later found out that they in the comments to the lejos GyroSensor class also advise to do something very similar to this :
“When integrating for a heading, values less than 1.0 can be ignored to minimize perceived drift since the resolution of the Gyroscope sensor is 1 deg/sec.”[1]
The PID-parameters were now fine tuned, and it turned out that one of the reasons that the car had troubles staying on the tube was not only because of a lagging algorithm, but also because the traction between the wheels and the tube was not too good. We tested a few solutions including shifting wheels to enhance the friction between the tires and the polystyrene of the tube. But it turned out that the biggest problem was that we only had one motor on the car making it only rear-wheel driven. So as with the remote controlled car, we decided to make the self-balancing robot four wheel driven because we assumed, that it would help to improve the traction.
By adding another motor at the front of the car, we made the car four-wheel driven which enhanced the traction significantly and made it easier for the car to fight its way back up on the top of the tube when falling down.
Figure 1: The car with two motors and the gyroscope lowered and secured
We also changed the wheels with bigger ones because they will make the car react faster on changes in motor speed.
In figure 1 it can be seen that we have moved the gyroscope down compared to earlier where it was placed in a small tower on top of the car. This has been done to prevent the gyroscope from vibrating, which we experienced a few times when the gyroscope was mounted in the tower.
Conclusion
Our plan was to use the bluetooth connection to change the PID values of the system. But when we started working, a few other problems arose and was so predominant that these problems had to be fixed before we could move on to adjusting more on the PID. We did determine some initial PID values, but these might have to be revised at a later stage when the systems runs smoother with less gyro drift. We made the following modifications to the system: bigger wheels for higher speeds, extra motor for more power, traction and equilibrium for the robot, and an if statement sorting out the small changes in the gyro.
Plan for next session(s)
Fix gyro drift by working more on the complementary filter.
Ingen kommentarer:
Send en kommentar