UC Davis IEL Lab Uses LabVIEW and myRIO to Program Modular Robots

Author(s): Nathan Wong

Product(s) Used: 

  • Ni MyRIO with LabVIEW Software
  • Barobo Linkbots
  • Analog Temperature Sensor

Industry: Robotics and programming

Application Area: Controlling modular robotics

The Challenge: To add new capability to a modular robot for research and educational purposes

The Solution: Used LabVIEW and NI myRIO hardware to interface with the modular robot, allowing for users to easily add input/output hardware and create new possibilities for controlling and programming the robots

Introduction

The Integrated Engineering Laboratory at UC Davis uses Barobo, Inc. Linkbots to help facilitate the research, design, and control of modular robots. For this project, we teamed up with Barobo, Inc. to study adding enhanced capabilities to the Linkbots by incorporating Ni myRIO hardware. With the NI myRIO, we can control the robots using LabVIEW, add sensors to control the robot’s outputs, or use the robot’s sensors to gather information. We created a simple demonstration program by using myRIO to gather data from a temperature sensor and control a Linkbot motor acting as a fan.

Barobo Linkbots

Barobo Linkbots are complete modular robots, designed for research and education. Each robot has a 3-axis accelerometer, two motor joints with absolute position encoders, a buzzer capable of 100 to 10,000 Hz, a multi-color LED, an on-board Li-Ion battery, an I2C port, and a ZigBee radio for wireless communication. The modular Linkbots can be attached to each other in various configurations using 3D-printed snap connectors, and many more 3D-printed accessories are available to demonstrate the robots’ versatility.

Using myRIO, we can communicate with Linkbots through the Linkbot I2C port to send and receive messages. I2C is a master-slave oriented communication protocol that uses two lines, the Serial Data Line (SDA) and the Serial Clock Line (SCL). With I2C protocol, the Linkbot can act as both a master and a slave. We designed the myRIO Linkbot firmware to receive commands in byte strings. Each byte string starts with the command byte and is followed by the size byte, the data bytes, and the terminal byte in that order. The Linkbot responds with a response byte string that starts with 0x10, and is followed by a size byte, data bytes, and then a terminal byte. If there is an error, the response is 0xff 0x03 0x11.

MyRIO/LabVIEW
 

We chose seven commands from the list of robot commands in our myRIO Linkbot firmware to demonstrate using myRIO. The commands demonstrated are setMotorAngles, setMotorStates, setMotorPower, MoveMotors, setLED, setBuzzerFrequency, and getMotorAngles. Here are their functions:

setMotorAngles
sets the robot’s motors to specified absolute angles
setMotorStates
sets the robot’s motors to either on/off at a specified speed (degrees/sec)
setMotorPower
sets the robot’s motor power (-255 to 255)
moveMotors
moves the robot’s motors an angle relative to its current position
setLED
sets the robot’s LED color
setBuzzerFrequency
plays the buzzer at a specified frequency
getMotorAngles
obtains the absolute angles of the robot’s motors

Each command function was programmed in a LabVIEW VI using the I2C Express VI offered in the myRIO palette to send the byte string commands as described above. Each VI can be used as part of a larger LabVIEW VI to program the robots. These VIs are shown in the figures below.

Demo Program

Once we generated the VIs responsible for sending specific commands to the Linkbot, we created a simple project to demonstrate added capability with the myRIO hardware. We used an analog temperature sensor wired to the AI0 terminal of the myRIO board. From there we were able to process the voltage input from the temperature sensor, convert the data into degrees Celsius, and compare the average temperature to a user specified thermostat value in LabVIEW. If the average temperature reading is above the thermostat value, the myRIO sends a setMotorPower command to the motor joint with an attached fan accessory. The motor power is set based on how high the average temperature is above the thermostat value. The hotter it is, the faster the fan motor will spin. Once the room cools down again, the fan will stop. Pictures of the LabVIEW program and hardware for this demonstration are shown below.

Conclusion

The combination of myRIO and LabVIEW with Barobo Linkbots creates a world of new possibilities. With myRIO, educators, students, and researchers can use LabVIEW’s graphical programming as an alternative method of controlling Linkbots. myRIO also gives users the capability of adding inputs or outputs to the system to work in tandem with the Linkbots. The Linkbots can be used with myRIO for educational purposes or for research purposes to study robotics and modular robotics programming.

Contact Information: 

Graham Ryland – gryland@barobo.com, http://www.barobo.com/

Figures:

Figure 1: setMotorPower VI


SetMotorPower_BlockDia

Figure 2: moveMotors VI


moveMotors_BlockDia

Figure 3: setBuzzerFrequency VI


setBuzzerFrequency_BlockDia

Figure 4: setLED VI


setLED_BlockDia

Figure 5: getMotorAngles VI


getMotorAngles_BlockDia

Figure 6: setMotorAngles VI


SetMotorAngles_BlockDia

Figure 7: setMotorStates VI


SetMotorStates_BlockDia

Figure 8: Fan Demo Setup


IMAG0570

IMAG0568

Figure 9: Fan Demo Front Panel


FanDemo_FrontPanel2

Figure 10: Fan Demo Block Diagram


FanDemo_setMotorPower_IEL_BlockDia2