Introducing Spam Musubot, brought to you by L&L Hawaiian Barbeque: L&L, where two L's make a W*.
This autonomous and duron-omous piece of Spam was created for Stanford ME218B. It is capable of playing a complete game of 218 Space Jam.
Description of Function SpamMusubot implements a simple game strategy designed to win based on reliability and simplicity of implementation.
Face Off After starting in a given corner and facing towards the main diagonal portion of the center line, Spam races straight forward towards the line at Face Off. Wire Following With two wire sensors underneath the front of the bot, the bot will detect the magnetic field produced by the current carrying wire underneath the line when the front of the bot has just reached the line. The bot will then slow down and keep driving forward for a short amount of time before stopping, so that its center of rotation is over the line. It will then turn clockwise in place until the symmetric wire sensors at the bottom of the bot are straddling either side of the current line. The bot will then wire follow until a limit switch on the front of the bot detects the wall. The bot wire follows using bang bang control, where the bot turns clockwise and counterclockwise while driving forward depending on which wire sensor detects that the bot is closer to the line. For example, if the left wire sensor detects that it is closer to the line than the right wire sensor, the right motor will increase speed and the left motor will decrease speed in order to turn the bot accordingly. The goal during wire following is for the bot to be centered on the line such that the symmetric wire sensors evenly straddle the line. Once the bot hits the wall, the limit switches are pressed. At that time, the bot will back up slightly to release the limit switches.
Reloading The bot will then look for an IR "handshake" signal from the Reload station. The Reload station has an IR emitter that emits a PWM signal of a certain, unknown period. In order for the bot to reload a ball from the station, it must detect this period and send back an IR signal with a period of half the detected period. If enough time passes without the bot reading a handshake signal, the bot will reverse and refollow the line to the reload station as another handshake attempt. Once an IR signal is successfully detected, the bot will emit a corresponding IR signal of half the detected period. The bot will then wait for a ball to drop from the Reload station into the bot's ball chute.
Shooting A proximity sensor at the top of the ball chute detects if a ball has been dispensed. Once the ball successfully dispenses into the ball chute, the bot will travel quickly in reverse across a majority of the field, then stop once in position to shoot. It will then rotate counter clockwise until it sees the target goal IR beacon. Each of the goals emits an IR signal with a unique period in a given range. Once the bot detects the target goal IR beacon, it will stop rotating. The flywheel motor starts up and the servo inside the ball chute releases the ball to the flywheel. The ball then hits the flywheel, which shoots the ball from the front of the bot towards the target goal. If the ball enters the goal, possession of the ball immediately switches to the other team. Defense Regardless of if the shot was made or not, the bot will wait until possession has changed to the other team's possession. At which time, the bot will back up slightly into a defensive position between the opponent's Reload station and their target goal. Once possession has switched back to SpamMusubot, it will advance forward until the line is sensed again, and the bot will repeat the strategy above to reload and shoot the ball.
*We are not affiliated, associated, authorized, endorsed by, or in any way officially connected with L&L Hawaiian Barbeque, or any of its subsidiaries or its affiliates. The official L&L website can be found athttps://www.hawaiianbarbecue.com/ The name “L&L” as well as related names, marks, emblems and images are registered trademarks of L&L Hawaiian Barbeque. We therefore aren't actually brought to you by L&L... but we went a few times during the project. The slogan "L&L, where two L's make a W" is in fact totally made up but it kinda makes sense right?