Friday, February 28, 2014

SciBorg Day 1

We began Tuesday's class by taking about different feedback and control mechanisms. The most well known example of a feedback and control mechanism is the thermostat, which uses the bang-bang control and simply turns on/off the heater at full blast until the room temperature reaches the desired temperature. There are other feedback and control mechanisms that have more subtle controls and can be applied to different devices (such as the Google car).

Our SciBorg is a car-like device that is powered by the PicoCricket and can be programmed using the PicoBlocks to perform different tasks.

We started out by trying out different PicoBlock commands and playing around with different functions of the SciBorg. We made the SciBorg play sounds through the speaker, display different colored lights, and move back and forth. 


As part of the official assignment, we made custom PicoBlocks that controlled the movement of the SciBorg. (Part a)

1. Forward


To make the SciBorg go foward, we simply use the motor on block and the power is set to 100 by default (which is full power)


2. Backward
Backward is pretty much the same as the forward with the exception of the reverse block added on before the motor on block


3. Brake
 Stopping the SciBorg movement is also simple. It just requires a motor off block.


4. Spin-Right
In order to make the SciBorg Spin Right (clockwise), we set the power of motor b to a 100 and set the power of motor a to a 100 but in the reverse direction and turn on all of the motors



5. Spin-Left


 Spinning left is very similar to spinning right, but with motor a going forward at full power and motor b going backwards at full power.



6. Bear-Right
To make the SciBorg bear right, we need to make the left motor (which is motor B in this case) go forward at full speed while the right motor is set at a smaller power. After we set the power levels, we turned on all of the motors and the car moved towards the right as it was moving forward. 
Depending on the power level of motor a, we could control the amount it bears to the right. If we had a value closer to a 100, the car would only slightly bear to the right, and if we had a value that was closer to zero, it would almost turn to the right.


7. Bear-Left
 For the bear-left block, we made the same sequence of blocks, but with the motor b set to a lower power than motor a.


For part b of the assignment, we tested out the shaft encoder. The shaft encoder uses a rotating plate and light to measure how much the wheel has spun and thus how much the device moves.

To start off, we programmed the SciBorg so that it would go forward until the counta for the encoder (starting at zero) is at 1000 and go backwards until the counta goes back down to zero

We started out by resetting counta just to make sure it is at zero. Then turned on the motor to allow the SciBorg to go forward and used the 'wait until' command to allow the counta to reach 1000. Then we braked the SciBorg and allowed it to move backwards and used the 'wait until' command to allow the counta to reach back to zero. 
We used the reverse block at the end just so the SciBorg goes forward when we repeat the process.


For countb, we basically used the same blocks as counta



Using both the counta and countb command, we measured the difference between the starting point and the end point of the SciBorg's movement. I expected it to go forward and backward at the same distance, but there were some discrepancies. 

For counta, there was a 3 inch difference between the starting point and the end point and for countb, there was a 6 inch difference.
I would think that this difference has to do with the different distances that each 'count' represents for counta and countb. Also, it seems like the forward and backward motion have different mechanisms in the SciBorg, because it moves more in the forward direction than the backward direction even with the same amount of count.

It seems like we are working with the 'control' side of the SciBorg by learning how to program different commands but not so much with the 'feedback' part. It would be interesting to incorporate the feedback mechanisms.  



 

No comments:

Post a Comment