Jousting Robots – Wiring and LabVIEW Code

In preparation for NI week, Josh and I decided to create jousting robots! We used LabVIEW, chipKIT WF32, LabVIEW MakerHub LINX, a force sensor, a PmodACL to read acceleration values, a PmodJSTK to control the angle of the mini servo, a mini servo that holds the lance, and two continuous servos for the wheels.  The general idea for this project was to create a robot that could be controlled over WiFi and send data back to LabVIEW.  The LabVIEW Physical Computing Kit which includes LabVIEW Home Bundle and chipKIT WF32 can be used for this project.  Behold our brave knight:



I created an Instructable on wiring all of the parts of the robot and an Instructable that provides in-depth LabVIEW code walk-through while Josh created an Instructable on assembling the different parts of the robots.


In my wiring guide, I go over how I received an analog reading from the force sensor using a voltage divider, how I wired I2C communication between the PmodACL and the WF32, how I wired SPI communication between the PmodJSTK and the WF32, and how I wired all of the different servos to the WF32.  Once everything is connected, the robot looks like this:



My other Instructable is a step-by-step explanation of my LabVIEW code.  Basically, there is a setup state where you set the angle of the “lance” mounted on the mini servo using the Pmod Joystick. Once a button on the PmodJSTK was pushed, the robot enters a running state. In this state the servo motors run until a force is sensed or if the robot is picked up. Once the robot is picked up, the state resets back to the setup state unless there have been 3 jousting rounds, in which case, the jousting session ends.


Each robot has three hit-points to start with and each time during the running state if the force goes over a certain value, the hit-points decrease by one. If the hit-points decrease to zero, the jousting session will end.  Below is a picture of my completed LabVIEW code.  Check out the Instructable to see how the other states are coded.



Interested in our jousting robots? Check out all three of our Instructables (1, 2, 3) to see how to assemble the parts, wire the robots, and control them with the LabVIEW code given in my coding Instructable.  Feel free to explore what other functionalities you can add by adding to the LabVIEW code and/or adding more Pmods.


Be the 1st to vote.

Leave a Reply

Your email address will not be published. Required fields are marked *