The project task is to design and build a robot that autonomously orients, navigates, and manipulates various elements of a designed game in order to beat an opponent. The theme of this competition is as follows.
The robots were dubbed as SQRLs (System for Quick Removal of Litter). The various elements the SQRL may encounter are ACORNs (A Cylindrical Object Representing a Nut) which are littered through the playing field, referred to as the YARD (Yet Another Region for Dumping). The goal is to have the least amount of ACORNs in your YARD by sliding them under the FENCE (Fortification Ensuring No Crossing, Except for ACORNs) that separates the two YARDs. Additionally, ACORNs can be gathered by your SQRL from two TREEs (Tubular Repository of Excess Eject-ables) located at fixed locations on your side of the FENCE. During play, SQRLs face an opponent on the other side of the FENCE who is also attempting to slide ACORNs out of their YARD.
Diagram of the playing field and tree locations.
The Scrat Pack is an agile mobile robot that features a 32cm x 32cm footprint and two layers dividing the drive and launching subsystems with the beacon detecting subsystem and PCB storage. Once the start button in pressed, a game LED lights up and it immediately scans the field for the game's four IR beacons, continuing to scan until all four frequencies has been confidently found. It then indicates the side of the field it is on and orients itself in-line with the center tape and move forward to the intersection. After orientation, it travels towards the left tree and perform a routine of collecting, reversing, aiming, opening the collector, launching, and reorienting back to the tree until all 5 ACORNs at the tree have been removed. Once this is complete, it reorients itself towards the right tree, travels to the beacon, and completes the same routine until the five ACORNs there have been launched. Once 2 minutes and 18 seconds have expired, the robot turns off it's game indication LED and powers down until the next round.
Two 12V DC motors for wheel drive
Two magnetic encoders for PID control
12V DC motor for snail cam drive
Two 5V servos for claw control
Two IR signal conditioning circuits
Dynamixel servo for IR detector control
Three opto-reflectence sensors
Front bumper limit switch
Indicator Servo, Game LED, Start Button
The team spent a number of hours attempting to integrate a tape following feature to the robot but ultimately failed due to the placement of the three tape sensors on the back end of the robot. Since the wheels were placed directly on the horizontal line going through the COM, the tape sensors on the back were greatly affected by small angles of rotation. This caused the tape sensing algorithm to be inversed from intuition and often caused all three of the tape sensors to sway completely across the entire width of the tape, effectively becoming lost.
More optimal tape sensor placement would have been on the front edge or directly inline with the wheel axis in order to prevent significant traversing movement of the tape sensors with small rotations, and to allow the algorithm to be "forward-thinking."
A surprising challenge that we faced was with the limit switch implementation with our SPI communication. The limit switch was connected to a pin on the follower PIC, causing the need for event triggered by the switch to be sent to the leader PIC for integration into the master state machine. When testing this feature on our test bench, the flow of our tape-sensing, drive, and button event worked perfectly, but suddenly stopped working as expected when we untethered the robot on the field.
Finishing the overall structure of the hierarchical state machine (HSM) was crucial for system integration in the final days of the project. We were able to code the flow of the HSM using keystroke event, in place of triggered events from subsystems, in order to ensure that the code functions exactly how the state charts were designed, then slowly add in the actual subsystems as they were completed. This helped the overall integration go as smoothly as possible, and allowed us to test each system independently after it was incorporated in the HSM.
Our most significant success was getting early versions of each subsystems working independently. We worked quickly on completing working prototypes of the IR detector servo, tape sensing, launcher, and collector so that by the time integration occurred, it was essentially figuring out which actions triggered which event in code. The early work on these subsystems also allowed us to run into and deal with problems that we may have stressed about more later had we not found them at the beginning, such as avoiding the wires from the IR servo wrapping around the motor horn or addressing the friction of the duron-layered spring-loaded launcher.
Start system integration as soon as each sub-system in completed in order to identify unique noise, interference, geometric, and power distribution problems that you would not be able to see otherwise.
Create specific test conditions for each integration checkpoint. Ensure the test conditions consider isolated and game coordinated events with all other prior integrated systems.
Build and test all soldered PCB board's to find and fix any possible problems with soldering, component placement, or noise affecting any sub-systems.
Keep an up-to-date schematic an associated pin mapping table that can be referred to when when coding or if wires come loose from their connections.
Learn and utilize wire management skills to avoid and nest or wires as more systems are integrated.
Invest time into designing a strong but adaptable foundation for your robot layer. Using many holes and gaps to allow for flexible wire management or fixation points will prevent having to cut/print new layers for any small adaptation in design. Using hand tools for small adaptions is encouraged.
Build the skeleton of the HSM early and test the flow with keystroke events. This ensures that you state machine will transition as expected.
Do not leave keystroke event testing nor DBprintf in your code when you approach final iterations. It can create unexpected impacts that are difficult to diagnose.