Example Code

Simulated PID Control of Robotic Arm

Code and Documents

Attachment

Download All

Description:

This example demonstrates how to use the LabVIEW Robotics Module and Control Design and Simulation Module 2011 to simulate the dynamics of a PUMA 560 Robot and a PID control scheme used to achieve setpoint control.

Instructions:

1. Download the attached files, "Puma_PID_CD&Sim.vi" (top-level) and "FWD_DYN.vi" (SubVI) and place them in the same folder

2. Open the front panel of the top-level VI and change the "Target Setpoint" input to non-zero values which represent the desired joint positions in radians

3. Run the top-level VI


Block Diagram Steps:

Top-level VI

1) Initialize the simulated Puma 560 robot arm

a) The "Create Puma 560" SubVI in the Robotics Module loads the DH Parameters of the Puma 560 as well as the dynamic paramaters such as joint mass, centre of gravity, friction parameters, etc.

b) Set the initial position of the robot arm joints to zero

c) Initialize the graphcs and draw the initial position of the arm

FWD_DYN SubVI:

2) Simulate the forward dynamics of the arm (calculate the acceleration given the torque input) using the Control and Simulation loop

a) Call the "Calculate Joint Acceleration" VI to determine the acceleration of each of the joints based on the current joint position and velocity vectors, as well as the input torque at each joint (which is determined by the PID control scheme)

b) Integrate the joint acceleration to obtain joint velocity, assuming that the initial joint velocity (at time zero) is zero

c) Integrate the newly obtained joint velocity to obtain joint positions, taking into account the initial position of the arm (at time zero) as the initial condition for integration

Top-level VI:

3) Determine the torque by implementing a PID control scheme on the position error and feed this torque to the forward dynamics block in the next timestep

Puma_PID_Setpoint.png

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
Not applicable
on

whwere are the instructions, where are the files?

thank you

manolo

jamezMattauz
Member
Member
on

How could implement this behaviour to an arduino?

Contributors