State machine architecture
The software architecture of the system is illustrated in figure 2. The software is implemented as a state machine. The processor has three states :-
1. WAIT: When the system is switched on the microprocessor is in the WAIT state. The XBee and the “Idle” LED on the system are ON in this state. It continuously waits for input signals from the wireless controller. If the waiting time passes a threshold, the system goes into sleep mode. Else, the system switches to the CHARGE state. The microprocessor stops accepting received data from the XBee in the wireless controller.
2. CHARGE: If the system is in this state, the “Jump” LED is ON. The microprocessor actuates the DC motor to compress the fiberglass spring to store a desired amount energy corresponding to the jumping power set by the user. When the flex sensor mounted on the fiberglass spring reaches the bending target, The DC motor stops and the system enters the RELEASE state. If the bending target is not reached within the safety limit reading of the rotary encoder, the system enters error mode.
3. RELEASE: The “Jump” LED remains ON and the servo motor pushes the release arm of the clutch. This releases the compressed spring and the system goes for a flight. As soon as the flex sensor returns a value of the restoration target, the system goes back to the WAIT state and the “Idle” LED is on. If the flex sensor doesn’t return to the restoration target within safety time, the system enter error mode.
Figure 1: Software architecture
(Click to view a larger image)
Perception algorithm
The team came up with Perception algorithm for the RooBot system. Figure 2 below describes the implementation method of the perception algorithm for the system.
Figure 2: Perception algorithm in Software model
The microprocessor (Arduino Fio v3) mounted with an XBee processes the user commands and sensor data to actuate the motors accordingly.The jumping system can be categorized into two major subsystems: the wireless controller and the jumping system. Listed below are the set of sensors or input methods being used in the system:
1. Wireless controller
a. Rotation buttons – “Left” and “Right” buttons on the controller to rotate the toy before issuing launch command.
b. Potentiometer – User can enter the jumping power of the system.
c. Launch button – Issue launch command after setting the jumping power.
2. Jumping system
a. Flex sensor – return acknowledgement of successful launch and landing to the processor.
b. Two rotary encoders (Hall-effect sensors) – Measure rotation of motors for feedback control of the motors (implement PID control for precision).
c. Temperature sensor – Health monitoring of the power subsystem (measures over-heating of the system and acknowledges the health state).
Figure 3: Perception algorithm
(Click to view a larger image)
The flowchart in Figure 3 describes the perception algorithm in detail. The algorithm starts with the user turning the toy using rotation buttons on the tele-operated controller which will actuate the rotation motor to desired position. The toy now faces the desired direction in which the user wants to launch the robot. The user then rotates the potentiometer to set the jumping power and presses the Jump button.
These inputs from the controller actuate the spring motor. This motor is PID-controlled and once the system reaches the desired value for jumping, the clutch releases and the robot is launched. The flex sensor, mounted on the spring, returns a value of force applied on the resistor. If the flex sensor passes the target restoration value, the jump flag is set to TRUE acknowledging a valid jump. If the sensor does not return the desired value to set the jump flag to TRUE, the algorithm enters the health monitoring module and halts any movement. It then acknowledges the user of launch failure. If the system executed a successful jump, the algorithm can be repeated after the system returns acknowledgement to the user of the jump execution.