Autonomous Robot Part 3 – Watchdog

Group members: Daniel Hua and Jesse Klein


For the third iteration of this project, we focused on giving the robot a more fluid motion, as well as a more well-defined behavior. We moved the sensors farther away from each other in order to get a more noticeble difference between the two sensor readings.

In order to reduce noise in the readings, we average the past samples up to a point, and use those values instead of the raw sensor output. We take the difference between these values to get the average difference between the two sensors. Since we’re averaging past values, there is a noticeable delay in the numbers; it takes a second before moving in front of the sensor before the numbers reflect that change. To counter this, we set the speed of the motor instead of the position directly. To calculate the speed, we take the derivative of the difference, which is then mapped to a motor speed and sent to the Arduino.

The resulting behavior is less predictable than before, but transitions between different states are much smoother in this iteration. Some physical limitations of the motor and gears also contribute to the behavior of the robot.


Technical Notes

The hardware remains largely the same as in the last iteration, but the software has undergone significant change. The data from the sonar sensors is now sent via the Arduino to a Pure Data patch running on a laptop, which interprets it and maps it to motor speed. This data is sent back to the Arduino, which controls the stepper motor with an EasyDriver shield.