tirsdag den 19. august 2014

Final Project - Lesson 8

Session 8

Date: 13/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

  • Make the car on top of the tube balance more steadily.
  • Reinforce the chassis of the balancing car.
  • Reduce the speed of the car inside the tube.

Plan

The lever handle on the remote controller was not sufficient and therefore we plan to Improve its design.
We plan to rebuild the car inside the tube so that it cannot tilt around.
We plan to reduce the speed of the car inside the tube so the balancing robot can keep up.
We plan to fine-tune the PID parameters.

Results

Reducing the speed of the remote controlled car

The balancing robot had difficulties keeping up with the remote controlled car that is inside the tube and constantly fell off the tube. The remote controlled car had a maximum speed of 100 both forwards and backwards and this had to be reduced, so that the balancing car could keep up with it.

The task to reduce the speed of the car inside the tube was not as easy as presumed. The first solution was to change the values of the field variables SpeedControlMax and SpeedControlMin from 100 and -100 to 75 and -75 respectively. We thought that this would reduce the max speed in both directions to 75 but it made no difference at all. The reason that this did not work is because these two variables in fact does not have anything to do with the speed of the car; they are only used to store tacho counter values during calibration of the remote controller.

Another way to fix this was to make a method called reduceSpeed() that can be seen in figure 1. This method guarantees that the maximum and minimum speed sent from the remote controller to the car inside the tube does not exceed the desired maximum and minimum value. However this method removes the proportional relationship between the minimum/maximum speed and tacho counter of the motor.

Figure 1: Code snippet of the method reduceSpeed()

Because the two other methods did not solve the problem satisfactorily we decided to rethink the way the tacho counter is mapped to speed. Figure 2 shows the old method and the new method to map the tacho counter to speed. Rethinking this mapping was not an easy task because we did not have a proper understanding of the original method to calculate the speed. In the first calculation of the return value (which is the speed) is made into span between 0 and 1 by dividing the speedValue with SpeedControlMax. This span  (0;1) has to be transformed into the span (-maxSpeed; maxSpeed). This generic span makes it possible to easily set the maximum speed of the remote controlled car, which is needed because we do not know what the optimal maxSpeed is for the balancing robot to keep up.
Figure 2: Code snippet of old and new method to calculate speed
from tacho counter of the motor.

The calculations in this new method is first to divide the span (0;1) into two spans (0.0;0.5) and (0.5;1.0), and then to transformate the span the two spans as follows

(0.0;0.5) → (-maxSpeed; 0) and  (0.5;1.0) → (0;maxSpeed)

The first transformation uses the formula:
returnVal = -maxSpeed+maxSpeed*returnVal0.5

While the latter uses the formula:
returnVal =returnVal -0.5(0.5maxSpeed)

In these two formulas the returnVal is the calculated speed. This new method makes it possible to just set a maximum speed and then the remote controlled car will drive with a speed in the range (-maxSpeed;maxSpeed).

While finishing the report we found an easier method to map the values from the tacho counter to speed. This method is a result of wanting to commenting the original method to calculate the speed, which lead to better understanding of it and made it possible to use the same idea. The idea is to multiply the span (0;1) with 200 which results in the span (0;200) and then move the span to (-100;100) by subtracting 100 from both sides of the span. Figure 3 shows the code snippet of an improved version of the original method.

Figure 3: Code snippet of improved version of the original method

In figure 3 the maximum speed is 100, which can be replaced with the variable maxSpeed. The number 200 is twice of 100, which was replaced with maxSpeed, and therefore 200 can be replaced with 2*maxSpeed. When the numbers 100 and 200 are replaced with variables it results in the general method shown in figure 4.

Figure 4: Final method to calculate the speed

Work on the design of the remote control

Before we had the remote controller seen in session 5 figure 4. This remote had a very simple handle and today we tried several designs for handles using different lego bricks.

We finally built the handle in figure 4. This remote has affordance that you are controlling the speed of a wheeled vehicle.

Figure 4: Final design of the remote control

Work on reinforcing the chassis of the balancing car

The balancing car kept falling apart each time it smashed to the ground. To avoid the car falling apart all the time we used some time to reinforce the chassis and exterior of the car.
Figure 5: The chassis of the car has been slightly reinforced to resist all the falling downs from the tube during testing

Fix the design of the car inside the tube so that it cannot tilt around

The remote controlled car was firstly built to drive even though it was upside down. But we experienced that when the car flipped upside down or back again it produced a bump that disturbed the balancing car. This disturbance was too big for the balancing car to keep balancing. Therefore we chose to rebuild the remote controlled car, so that it cannot turn over. Figure 6 below shows on the left the original design of the remote controlled car and on the right the final design where gearing and four extra wheels are added to the car. The gears was added to make the car four wheel driven so it could drive even though it was upside down, this is now redundant since we realized that the car must not flip upside down, and added the the four extra wheels to stop this.

Figure 6: First (to the left) and final design (to the right) of the remote controlled car

Conclusion

We have have successfully managed to reduce the speed of the remote controlled car, even though it took some time. We rebuilt the remote controlled car so that it cannot flip and get the robot on top out of balance. We have also reinforced the chassis off the balancing car, so that it does not fall apart when it smashes to the ground.

Plan for next time


Maybe fine-tune PID parameters even more, perhaps using Ziegler–Nichols method

Ingen kommentarer:

Send en kommentar