Siege Tank is an autonomous robot navigating through a landscape with sensor systems. It is designed and built by Jiajie He, Chi Zhang, Timothy Lee and Zhengrong Shang. This is also a team mechatronics project for Smart Product Design Applications (ME218B) course at Stanford University, Winter 2017.
In Siege Tank's brain, there is a hierarchical state machine (HSM) supported by 8 services. The HSM posts/receives events to/from the services for different functionalities.
Lets the master device (Tiva) write and read bytes from the slave device (LOC) to get information on game status, target staging areas, target buckets, and report captured magnetic field frequencies.
Provides functions that generate PWM of desired frequency and duty cycle, and switch rotation direction. PI velocity control is implemented here.
Runs the flywheel motor stably with PI control.
Controls the 4 servos for shooter gate, side supporting arms, and sensor arm.
Sends IR pulses of 10 ms ON time and 30 ms OFF time to the supply depot to refill balls.
Selects one of the two sensors based on the position of the target staging area. Averages received magnetic field pulses and returns a valid frequency.
Triggers the ultrasonic distance sensor and receives the echo pulse. Then interprets distance from the echo pulse length.
Indicates game color (red or green), and blinks during the process of supplementing COWs.
The state chart is shown below.