Blog 5 - PWM and Sensors
For these last 2 weeks we have been working on the breadboards to get the different PWM outputs from the state machine that Jason gave us. As we can see in the images below when we cycled through the states we get a different pulse width which relates to different speeds for the motor. 2ms is full speed forward. 1.5ms is stop. and 1ms is reverse. We also had a 0.5ms which is outside of the range so the motor might not pick it up if we hooked it up to the breadboard.
2ms pulse (forward):
1ms pulse (reverse):
1.5ms pulse (stop):
We also we given the sumo bots that previous students have worked on previoulsy. Our job was to look at the infa red sensors mounted at the front of the bots. These sensors were the SHARP 2Y0A02. They have a range from 20cm to 150cm based on the data sheets and our own results. Shown below is the diagram supplied by the datasheet to tell us the relative voltage for each distance from which we cross compared:
As we can see from the sheet above we now have the relative voltage for each distance. I recorded the following with my classmates.
- 30cm is 2V
- 70cm is 0.9V roughly
- 150cm is roughly 0.4V
150cm measurement:
70cm measurement:
30cm measurement:
As we can see the results were as expected. Initially we read the results in AC mode which was giving us the wrong outputs which we spent far too long doing, but it was a funny mistake and a mistake we all learned from.
Also done was working on the Sumo bots from which we got the Gun and the beaken light mounted on the bots. We are currently working on the motor driver to get that working but its proving to be harder than we thought due to the wiring of the bots creating extra work as we need to trace back the wires. A fuse was blown on one of the bots causing it not to work but we caught onto that relatively quick.
Comments
Post a Comment