Main Content

PYNQ rocks! Using widgets and AsyncIO we can control complex hardware very easily. Let’s use a robot arm to demonstrate.

One of the first projects we did here on Hackster was to create a bare metal robot arm which could be positioned using Pmod Joysticks. It was a great project to create and demonstrated well how to control servos and and interface to the joysticks to create a fun solution.

However, I wanted to come back to the robot arm and redesign it, work from PYNQ. There are several reasons behind this update

PYNQ provides the ability to control remotely the robot arm - The arm is something I want to show at conferences and presentations so the distance means the attendees cannot hurt themselves if they drive it.
PYNQ has some really great advanced features such as the ability to create widgets and asynchronous tasks. Creating a notebook which drives the arm will demonstrate how we can use these features very well.
Hardware Design
One of the first things we need to do to get started is create a new PYNQ overlay which enables us to drive the Adafriut PWM / Servo Shield. driving the shield is pretty straight forward, we connect to the AdaFruit shield using I2C. We then write in the command for the correct servo position for a desired servo to the shield and the arm will move.

All the shield is doing is generating a PWM waveform, we could do this easily from the PYNQ board. However, interfacing and supplying the power as the servos want 6V, would also be a challenge in that case, as such Adafruit Shield offers the best system level approach.”

Link to article