Sciborg: Day 3/4 -- Feedback and Control (Cont.)
For our third day of working with the Sciborgs, we explored a new system of feedback and control (F&B): proportional control. In the first assignments, we dealt with bang-bang F&B systems, where power was fully on or off throughout the programs, e.g. thermostat, conventional oven. Proportional control is a more efficient way of executing tasks while conserving energy, based on another variable.
Part A: Fixed Distance
For our first program, we needed to tell Aurora to go 10 feet, by writing an equation for the power supplied to be the product of a constant gain factor and the average of the shaft-encoders: P = Gain x Difference. We were able to write a program (Dist.Pro), where the power decreased as it came closer to the limit (or max number of paces). The second part of Part A required us to add a "Nudge," which means that we set the max paces lower than 10 feet and add a small amount of power for a short period of time to help Aurora reach within 1 cm of 10 feet.
However, once we figured out the necessary bounds for 10 ft on the lab floor, we had to adjust considerably for an inclined path. It required more nudges or a larger maximum of paces -- and one set of procedures didn't fit the two different tracks.
Part B: Conga Line
Using an ultrasonic sensor, my partner and I designed a program which would allow Aurora to follow a car or object, e.g. piece of paper, in front of her, and, when the car in front stopped or reversed, to drive backwards. Conga.PC worked beautifully: with a larger separation between the objects, Aurora traveled at a higher speed and, with a smaller separation between the objects, Aurora moved at a slower speed. When we tested out the procedures, Aurora was able to follow all the other cars but, as we set our speed limit higher than the others, she quickly gained on the others' tails and did a lot of go-reverse-go-reverse. Eventually, every cricket was out of sync and ran in their own directions.
Part C: Line Following
In the previous assignment, Tiffany and I became very familiar with the line following program and adapted the bang-bang procedures to proportional control. However, we did have to play around with the brightness sensor: the brighter the light, the lower the sensor number and the faster the speed of the cricket. That said, we had trouble finding a low enough speed (or high number) for Aurora not to overshoot the line when turning around corners. We were finally able to get it to work after a lot of trial-and-error.
Part A: Fixed Distance
For our first program, we needed to tell Aurora to go 10 feet, by writing an equation for the power supplied to be the product of a constant gain factor and the average of the shaft-encoders: P = Gain x Difference. We were able to write a program (Dist.Pro), where the power decreased as it came closer to the limit (or max number of paces). The second part of Part A required us to add a "Nudge," which means that we set the max paces lower than 10 feet and add a small amount of power for a short period of time to help Aurora reach within 1 cm of 10 feet.
However, once we figured out the necessary bounds for 10 ft on the lab floor, we had to adjust considerably for an inclined path. It required more nudges or a larger maximum of paces -- and one set of procedures didn't fit the two different tracks.
Part B: Conga Line
Using an ultrasonic sensor, my partner and I designed a program which would allow Aurora to follow a car or object, e.g. piece of paper, in front of her, and, when the car in front stopped or reversed, to drive backwards. Conga.PC worked beautifully: with a larger separation between the objects, Aurora traveled at a higher speed and, with a smaller separation between the objects, Aurora moved at a slower speed. When we tested out the procedures, Aurora was able to follow all the other cars but, as we set our speed limit higher than the others, she quickly gained on the others' tails and did a lot of go-reverse-go-reverse. Eventually, every cricket was out of sync and ran in their own directions.
Part C: Line Following
In the previous assignment, Tiffany and I became very familiar with the line following program and adapted the bang-bang procedures to proportional control. However, we did have to play around with the brightness sensor: the brighter the light, the lower the sensor number and the faster the speed of the cricket. That said, we had trouble finding a low enough speed (or high number) for Aurora not to overshoot the line when turning around corners. We were finally able to get it to work after a lot of trial-and-error.
Overall, it was challenging to ensure that miniscule details were placed where they needed to be as well as proof and troubleshoot the code when we were confused on misfunctions. Yet, I think we're getting the hang of the language, able to more quickly apply concepts we've learned.
Hey Christina! I had a hard time understanding how your Conga.Eq code worked at first, but now I think I see. That was really clever of you to combine the power equation for both motors instead of figuring it out the hard way (like Michelle and I did). It's really cool!
ReplyDelete