Fall Biped 2016- Software Structure
By: Alan Valles (Electronics and Control)
Approved By: Ijya Karki (Project Manager)
Table of Contents
Introduction
The purpose of this document is to demonstrate software logic behind the Biped.
Analysis
The Fall 2016 Biped had a requirement which stated that the Biped had to be controlled using RC mode in the Arxterra App. The main feature of the app is a directional pad which is controlled by the Move Command. There is also a capability of adding Custom Commands. Electronics and System Engineers had several ideas and thought about the best way to utilize these. However, the backbone of our software and electronics subsystem design is a rotary position sensor. The selected rotary position sensor is the Bourns 3382. The rotary position sensor is a potentiometer that can spin forward up to 100000 cycles.[1]This means the inner rotor can be spinning freely.[1] All of the logic to be implemented is dependent on the readings of this value. As shown in the diagram below. The unsigned integer values between 0 and 1642. This value can be changed by setting the gain of the ADS1015 A2D converter in the set up loop. Therefore, logic can be implemented to control the robot in 330/360 of its walking motion.
Figure 1. Encoder Value
Thus, as the encoder value increases or decreases we continue to check to position and move the arms to the side of the foot that is planted. Ain0 shown in the picture above correlate to the variable adc0.
Poll a2d converter after every loop.
Based on position of walking motion i.e. shaft position, adjust arms accordingly.
Essentially when the user presses forward on rc mode in the move command, the robot will move and if the robot is on its left foot, the arms will move to left side and if on right foot, the arms will move to right side.
Also, the servohandler custom command was overridden to read color sensor and display LED using sx1509 gpio library. The final design was meant to use millis function inside loop as shown in reference [2]. It was commented out in the code that is uploaded to the zip file.
Conclusion
In conclusion, these are some of the code snippets for the Biped Group Design. Please see the Zip file for more information or our previous software blog post for library information.[3]