Monday, April 25, 2011

Matlab Plots

The following is a plot of how the joint angles varied over time. The angles of Link 1 are in the top plot, link 2 in the second plot, and so on.


Also, shown below is a plot of the xyz-coordinates of the end effector as they change over time,

This leads to the creation of the desired shape, shown below plotted in xy-coordinates,

Lastly, shown below is a figure of the actual voltage command (0 to 255) that is actually sent to the arduino for each motor,

Monday, April 18, 2011

First Run



Here is a video clip of the robot painting the letter "M" after we initially created a working MATLAB script.

Discussion Question - Edited

Construct the D-H table based on diagram of a four link manipulator, as shown in the previous post. For your convenience, a new diagram has been attached below in Figure 1. Figure 2 shows the robot in its home configuration. Please note that Link 4 is a "virtual link" representing the distance from the end of L3 to the end effector (brush). Thus, Theta 4 represents the angle between L4 and L3. Also create the homogeneous transform matrix, T0_4. You may leave it as a multiplication of up to four matrices. (The initial angle between L3 and L4 may be labeled as Theta40).

Figure1. Create the DH table of this robot

Figure2. The home configuration of the robot

SOLUTION


Project Summary

Cyberdyne (in training)
Kshitij Agarwal, Steven Christ, and Jeevan Nalli


Description of Project

The team decided to use the toy robot to draw letters. In order to accomplish this, we will interface the toy robot with an Arduino Uno microcontroller and program it using Matlab. The robot will be given a paintbrush to use as the end-effector, and will draw the letter ‘M’ on a sheet of paper.

Objectives
1. Remove the pendant controller that comes standard with t
he robot 2. re-route control of the robot through the Arduino controller 3. Interface the Arduino to Matlab 4. Define the desired trajectory. 5. Implement a control law that enables the manipulator to follow the desired trajectory 6. Characterize input responses of the DC motors 7. Verify the success of the control script

Photos

the completed robot, armed with a paintbrush and learning self-expression

Many of the connections are done through this intermediary board. The robot connects to the H-bridges (upper right) which connects to the arduino (lower right). The arduino is then connected via USB to the computer. 5V power is also supplied from a power source to this board.


Model

Our robot is essentially a four link manipulator with four revolute joints. Four DC motors are used as actuators; one at each joint. The fifth motot is used to actuate the gripper, which holds the brush in place.

Here, l1 = 6.5cm l2 = 9.0cm l3 = 12.0cm l4 = 17.9cm

The following Denavit Hartenberg Table can be obtained for this particular manipulator
Block Diagram

Controller Design

The controller for the robot was developed after considerable testing of the robot itself. The toy robot does not natively have sensors that can feed position or velocity information back to the controller, so it became important that the model of the robot be accurate enough so that it may be controlled open loop. The arduino interface allows for a value of 0 through 255 to be sent as velocity commands to the motors on each link. Knowing this, the team began extensive testing of each numeric value corresponded to the link movement speed. Using a for-loop in MATLAB, the team could send a signal to the robot for a set amount of time. Then, by using a protractor the team could measure the change in angle that link underwent. By performing this process for several controller inputs and several time spans, the team eventually created a scaling factor that a desired q_dot would be multiplied by to become the signal that is sent to the arduino. In essence, the controller for the robot was an open loop, proportional control.

Implementation Notes

The physical control of the robot was performed by interfacing MATLAB with the arduino Uno, then connecting the arduino to the H-bridges, and finally the H-bridges connected to the DC motors of the robot. By flashing the arduino uno with the adiosrv.pde file, the arduino can be set to listen for commands in MATLAB. The team then created a vector of joint angles for the trajectory using the differential kinematics method. The result of this was a vector of q_dot values at each timestep. These values were then passed to the arduino (after being scaled by the controller) using a for loop. The arduino would then send a PWM and direction command to the H-bridges. The direction command would trigger the H-bridge to send positive or negative current to the motor (depending on the sign of the q_dot while the PWM signal would modulate the current to be greater or smaller depending on scaled signal from the controller. Lastly, these electric signals were then passed from the H-bridge to the robot arm, which created the physical motion of each link.