Machine control design
Objective
We had a goal to build an automated guided vehicle for an assembly plant that has the ability to drive back and forth in a straight line and deliver batches of parts. We were supposed to use a closed loop in our programming to get the vehicle to have this back and forth motion. The vehicle is to start when an attached button is pressed and is to stop when a button is pressed again.
BRAINSTORMING
Our brainstorming process consisted of two parts; a mechanical design portion and a programming portion. We started with generating ideas for what we wanted in our code so we would know how we would need to design the mechanical part of the vehicle.
Programming
We had to create a code for two bump switches and an untrasonic sensor. When the first button is pushed, the motors move the vehicle forward until the ultrasonic sensor senses an object five centimeters ahead of it. When something is sensed, the motors will turn in the opposite direction and the vehicle will move backwards until something is sensed 40 centimeters ahead of it. When this object is sensed, the loop will end, but the cycle will start over again because the loop is a while loop. The process will continue until the second button is pressed and the machine turns off.
Results
Our vehicle worked rather well. Our only problems where that the off button had to be held down for a few seconds to shut off the machine instead of simply pressing it. We also had a problem with our programming in our code. Our ultrasonic sensor wouldn't sense anything at first but we soon figured out the problem and got it to where it would work perfectly. In the end, we had ourselves a working machine and some great new experience.