By Jefferson Fuentes – MST
The Spring 2017 Spiderbot project, S-17 Spider, shall provide a live aerial video footage for end of semester game. In addition, S-17 Spider, shall incorporate a grappling mechanism to elevate itself from the ground level.
The S-17 Spider features the ability to elevate itself off the ground through use of a grapple and winch system. The purpose of this post is to provide an explanation of the Spring 2017 Spiderbot project, S-17 Spider, custom commands utilized in controlling project functions via the ArxRobot App. The software block diagram (fig. 1) shows a layout of all functions used for control of project.
Figure 1 – Software Block Diagram
The MOVE command is utilized to control the projects directional functions. By sending individual commands to the two connected DC motors, each motor can spin clockwise or counterclockwise, allowing for desired direction.
The LATCH command serves to control the single servo connected to 3DoT. The servo is sent a signal to spin its full 180 degrees and release the grapple, hence the function name.
The WINCH command serves to control a single DC motor connected to the custom PCB via I2C. Similar to the move command, a signal is sent to the DC motor to spin it clockwise or counterclockwise. The motor serves to power a winch, which allows the project to elevate itself higher or lower.
The code for the custom commands is shown below. The first step is initialization of the code (fig. 2), which includes all necessary files to run all functions denoted by #include <>. The custom commands are then defined, #define, and given their address, 0xXX. In S-17 Spider, we are using 3 custom commands which also needs to be declared in the following line. The last few lines are the handlers. Their purpose is to direct the incoming command to the appropriate function (custom command).
Figure 2- Code Initialization
The parameter for all functions is 0 to 255, a byte. This works wells with the MOVE command, which moves clockwise and counterclockwise. The LATCH command controls the servo, which can only rotate 180 degrees. To accommodate, 0-255 must be converted to 0-180.
The s-17 Spider uses the provided ArxRobot app for wireless control, via Bluetooth, of the project. The three main function of the project are included (fig. 3) in the app layout. For the S-17 Spider project all functions are in Boolean, meaning that either function is either on or off. The winch function uses two Booleans to control the direction the motor spins. The latch function controls the servo which turns the full 180 degrees one way or the other.
Figure 3 – ArxRobot Layout