Lesson 5
Date: 10/06 2014
Duration of activity: 10.15 - 13.30
Group members participating: Pætur Askildsen, Søren Ditlev and Alexander Rasmussen
Goal
Finish the code for the remote controller
Rebuild the remote controller to be more sturdy.
Make the car inside the tube four-wheel driven.
Plan
Figure out why the remote controlled car only drives forwards even though it is supposed to drive backwards and fix it.
The original remote controller was just a quick mock-up and we want to build a rigid remote control.
During last lesson we experienced that the car inside the tube had difficulties moving when turning upside down. The reason for this is that the car was rear-wheel driven. Therefore we plan to rebuild the car to make it four-wheel driven by adding gears.
Results
Fix the code of the remote controlled car
The problem regarding the remote controller that the NXT started ticking and the program would not start was quickly fixed. The problem was that some variables that should be turned from integers to floats were still integers and was therefore causing problems.
When this problem was fixed the program would run again, but the car would still only drive forwards. This problem was also easily fixed.
Figure 1: Code snippet of if-statement in RCCMain.
The if-statement in figure 1 is the reason why the car would only drive forwards. The problem with the if-statement is that when the speed value is positive the method Car.forward() is called with a positive value and therefore it drives forwards. But if the speed value is negative the method Car.backward() is called with a negative value, this results in a negative speed backwards which is the same as positive speed forwards. This was the reason why the car could only drive forwards. To resolve this the if-statement was removed and replaced with the code snippet i figure 2.
Figure 2: Code snippet of fixed code in RCCMain.
Rebuilding the remote controller and the BT controlled car
After fixing the code we were able to rebuild the BT controlled car so that it is now four wheel driven instead of only rear wheel driven. The four-wheel drive was built using three gears in each side of the car to connect the wheels to each other as it can be seen in figure 3. This gearing made the car able to drive even though it is upside down as the video shows [1]. Meanwhile we rebuilt the remote controlled car, we also rebuilt the remote controller to make it more sturdy. The redesigned remote controller can be seen in figure 4.
Figure 3: The gearing to make the remote controlled car four wheel driven.
Figure 4: The rebuilt remote controller.
Conclusion
We have fixed the problem with the remote controlled car only driving forwards, which now makes it capable of driving both forwards and backwards. The remote controlled car has also been rebuilt, so that it now has four-wheel drive, this is due to the robot not being able keep traction when driving with only front-wheel drive.The remote controller has also been rebuilt.
Plan for next session(s)
Get readings from the gyro and accelerometer. Combine the readings into a complementary filter to conquer the gyro drift.
References
Ingen kommentarer:
Send en kommentar