This robot was created as a project to explore wireless remote control of a robot with mechanical grabber arm functionalities. The information provided in this hackster.io page is not enough to fully replicate this project; however, the key parts are explained and higher level code (without library/sdk code or RTOS code) is provided for joystick, wheel, arm, and wifi functions. The page was designed to explain the process of developing code for such a robot and explain key areas.
Use the below link to view a demo of the robot.
https://drive.google.com/file/d/1pxEh5eV6AysNjS5M0PX_UKbb4YLNRabb/view?usp=sharing
1.Goals and Overview
Create a robot with mechanical arm that can be controlled wirelessly via a joystick board. The robot demonstrates wireless capability using MSP432 microcontrollers and CC3100 WIFI boosterpacks from Texas Instruments. The robot can move and use its mounted arm to grab/place objects. Most of the code used is developed from scratch; however, some parts are adapted from an online repository for the RSLK robot. https://github.com/VivekAdra31/TI-Robotic-Systems-Learning-Kit
The code also utilizes a real time operating system (RTOS). The RTOS used for the development of the robot can be replaced by any RTOS of your choice. The threads and periods will be provided in this hackster.io page, but the RTOS will not.
2. RSLK WheelsThe wheels of the robot are driven by two motors that can be controlled using a joystick board. The joystick board used for the development of the robot can be replaced by any generic joystick connected to an MSP432 microcontroller with CC3100 boosterpack. The basic structure of the code is simple, translate the joystick x, y coordinates to duty cycles that can be sent to the motors on the RSLK via WiFi. Saving the WiFi part for later, the code can be more challenging than it appears. Normally, remote controlled vehicles use two joysticks, one for the x direction and one for the y direction. However, here only one joystick is used. To do this, an algorithm is implemented that can be found here https://home.kendra.com/mauser/joystick.html
The algorithm allows one joystick to control the robot in a "tank drive" fashion. A bit of manipulation is needed to ensure the robot moves in proper directions for all possible x, y combinations, this is seen in the provided code.
3. MeArmThe MeArm mounted to the robot is driven by 4 servo motors. The directions of movement are left/right rotate, forward/backward extension, up/down movement, and claw open/close movement. The 4 servo motors on the MeArm are controlled by pwm signals from the MSP432 of the RSLK robot. The pwm signals are generated via Timer A1 and output from pins 7.4 - 7.7. The MeArm also requires connections to VCC and GND. All signals to the MeArm must be based on a 5V operating voltage (the RSLK allows this by using its batteries for power).
The configuration of Timer A1 needed to produce pwm signals is shown in the code section. The duty cycle controls the position for these specific servo motors. The PWM signals stay active during operation of the robot but the duty cycle of the timer can be adjusted to move the arm in various directions. A MeArm motor that isn't moving will simply maintain a constant duty cycle, keeping that motor in the same position. The duty cycles for the arm motors are held in a global array, one index for each motor (uint16_t servoDuty[4]).
There exists two different modes for operating the MeArm, one mode controls the rotation and forward/backward motors while the other mode controls the up/down and claw motors. The modes are toggled by pressing a button, the button for the specific board used here is the B1 button on the right.
Datasheet for MeArm servo motors: https://www.electronicoscaldas.com/datasheet/MG90S_Tower-Pro.pdf
4. WiFiWiFi is used in this design to communicate between the joystick board and the RSLK. The joystick board needs a way to wirelessly send data to the RSLK, in order for the joystick to control the behavior of the robot. To implement this, the CC3100 WiFi boosterpack from TI was used along with the SDK provided for it. There are many ways to implement the WiFi functionality, but here, a UDP protocol was used. In the code for this robot, both the CC3100 boosterpacks are initialized as clients and are automatically assigned an IP address. They then send and receive data between each other to acknowledge this connection. The functions used from the CC3100 SDK library code are in the code section.
The duty cycles for the arm and wheels are calculated on the MSP432 from the joystick board and then sent via WiFi to the MSP432 on the RSLK. The joystick board sends this data in the form of a struct object. The struct contains the duty cycles for each motor as well as variables used for the WiFi such as IP address.
The sending and receiving of data as well as the timing of all the function calls is controlled by the RTOS. The general RTOS structure used for this robot was a priority scheduler with 3 threads for the joystick board and 4 threads for the RSLK. The joystick board has a ReadJoy thread to calculate duty cycles from joystick coordinates, a HostSend thread to send data from the joystick board to the RSLK via WiFi, and an idle thread with a lower priority. The RSLK has a Wheels thread to move the wheels based on the received duty cycles, a Servo thread to move the arm based on the received duty cycles, a ClientReceive thread to receive data from the joystick board via WiFi, and an idle thread with a lower priority. Since these are threads in an RTOS, the periods of each can be adjusted to change the frequency at which certain things happen. For example, the MeArm should be controlled so that it can move at a reasonable speed in response to joystick movements. Since the Servo thread moves the MeArm by updating the corresponding duty cycles, how frequent that thread is run controls how fast the MeArm can move. The same applies to the Wheel thread. The code for the threads and the periods for each are provided in the code section.
6.Operation
In the provided code, the robot must follow a specific programming procedure. First, program the RSLK with the main_test_client() function from the RSLKThreads.c file (comment out the main_test_host() function call in main.c). Turn the RSLK on by flipping the on/off switch or pressing the power button. Next, program the joystick board with the main_test_host() function from the RSLKThreads.c file (comment out the main_test_client() function call in main.c). Both the RSLK and the joystick board should now be running and the WiFi should connect automatically. To operate the robot, the controls are in wheel movement mode by default, this means that you are able to control where the robot goes using the joystick. To switch to arm control mode, press the B0 button on the specific board used here (this can be replaced by another button on a different board). Then, the arm control mode has two submodes. By default, it is in rotate and forward/backward mode. Press button B1 to toggle to up/down and claw mode.
MSP432
CC3100
RSLK
Comments