tirsdag den 11. marts 2014

Date: 11/03-14
Duration of activity: 8 hrs
Group members participating: Alexander Rasmussen 20103865 Søren Ditlev 20116323


Lesson 5

Goal:

To make a self balancing system using the color sensor and a PID controller.

Plan:

We plan to use the model suggested by Phillippe Hurbain[1] to construct the physical system and the java code presented by Brian Bagnall[2] as base software.
In order to make the system balance, it was advised to implement a way of being able to tweak the system while running. Therefore we plan to set up a bluetooth connection between a PC and the system. In order to do so we will install the PCcarController.java[3] on a PC and BTcontrolledCar.java[4] on the system.  We will thereby be able to tweak the PID controller using a GUI on the PC and adjust the values on the system to match the unique condition of each run.       
Last lesson[5] we found out that the colour sensor is a more precise sensor, therefore we have made the decision to use the color sensor instead of the light sensor, which means that in the example code we have replaced the light sensor readings with the colour sensors normalized light values.

Picture the of the system

Results:

To implement the bluetooth connection, we used the BTcontrolledCar.java and modified it to read the values from the PCcarController.java and change them in the Sejway.java class. The Sejway.java class was modified with get and setter methods for all the constants.

In the test we were able to get the robot standing still by correcting the offset to a point where it almost were able to keep its balance, after that we tweaked the pid values.
We ended up getting the robot to stand still with little oscillations, but remaining on the same spot. We tried to push it a little which resulted in the robot driving off, and not being able to correct itself to a stand still without help, but if it was forced back by pushing it the opposite direction, we were able to get it back to a standstill.  

Pid Values table

KP
35
KI
7
KD
40



A video of the robot in action can be seen here[7]:

Conclusion:


We found that by changing the wheels to a larger size we gave the system more time to react, and thereby made it more stabil. Furthermore it was evident that the color sensor was very sensible therefore very small changes in the environment, forintance light and surface, will affect the system. Therefore it is very important to keep the environment as steady as possible so that you do not disturb the system.   

References:

[1] http://www.philohome.com/nxtway/nxtway.htm
[2] http://variantpress.com/books/maximum-lego-nxt/
[3] http://legolab.cs.au.dk/DigitalControl.dir/NXT/Lesson5.dir/PCcarController.java
[4] http://legolab.cs.au.dk/DigitalControl.dir/NXT/Lesson5.dir/BTcontrolledCar.java
[5] http://surdejspianisterne.blogspot.dk/

[6] https://www.youtube.com/watch?v=tuuO2egOp1w&feature=youtu.be

Ingen kommentarer:

Send en kommentar