Robotics have been used in outer space explorations, military applications, intelligent home applications and industrial automation. Industrial control, communications, machine vision, machine learning, human-machine interfaces, cybersecurity and safety can be key technology considerations when building robots. Xilinx SoCs, FPGAs, and Versal ACAPs enable a modular approach to robotics by providing a common embedded hardware and software platform.
Adam Taylor, an expert in design and development of embedded systems, creates FPGA controlled robotic arm.
Adam uses six servos under the control of Digilent Cora Z7, Zynq SoC development platform and servo shield. It will be controllable using either a simple software interface or using two Digilent Pmod JTSK2, two-axis joystick, to enable the direct control.
How to Build the Robotic Arm
The first thing you need to do is work out how you are going to control the Servo Position. Most Servos uses a 60Hz PWM waveform. In the 16.66 ms period of the 60Hz waveform, the signal will be high between 0.5 ms and 2.5 ms. The duration of the "high" signal will drive the servo in a range of motion between 0 and 180 degrees. Driving a 0.5 ms pulse drives the 0-degree position while 2.5 ms will result in 180 degrees. 90 Degrees, therefore, is maintained by driving the signal high for 1.5 ms. Therefore increasing or decreasing the pulse width by 13.9 us moves the servo by 1 degree. The PWM Shield supplies 6v power and performs the level conversion on the PWM signal.
Now, we need a hardware design to interface Pmod JSTK2 and the PWM shield with Cora Z7. This can be done in Xilinx Vivado. The design contains the following IP blocks
- Zynq PS - This is the Zynq Processing System
- Pmod Joystick 2 - Interface to the Pmod
- AXI IIC - I2C interface implemented in the PL
A modular approach software application is created so that the user can use this robotic arm in several modes and upgrade it in the future.
Adam develops a function for each joint that can be called and used as desired. Each joint is capable of taking in an unsigned 8-bit value, this 8-bit value is then either added or subtracted from a 90 degree (1.5 ms) pulse width to obtain the angle desired. He also makes sure that the movement of two Pmod JSTKs and the robotic arm are aligned.
The remainder of the software application structure is:
- Initialize the PWM shield and Pmod joysticks.
- Perform a self-test of the Arm and position all servos at 90 degrees.
- Enter a look to receive commands via RS232 or commands from the joystick.
User can control it however desired within the envelope of movement