The SCARA manipulator is the project of my graduate course "Fundamental of Robotics." SCARA Manipulator (Selective Compliance Assembly Robot Arm) is a widely used industrial robot, known for its simplicity in handling tasks like assembly and pick-and-place.Â
As the picture shown, there are 4 degrees of freedom, controlled by joint J1-4. Joint 1, 2 and 4 are rotational joint, and joint 3 is displacement joint alone Z axis of world frame. For my project, I built a simulator of SCARA using MATLAB and Simulink. Below is the outlook of SCARA in simulation:
Users can specify how our manipulator move, by giving a series of points that describe the motion. A trajectory will be generated based on those critical points, (x,y,z) in space alone time, and loaded into the workspace.
More specifically, we adapt the trapezoidal velocity profile. To reach point A to B, the manipulator will accelerate, then move in constant velocity, then decelerate. Below is the graph and mathematical demonstration. (This equation is from the famous robotic text book "Modeling, Planning and Control."
q is the displacement from one point to another. We see that to model the trajectory, we only need initial, final position, as well as acceleration, qc_dot_dot.
Many times, the position of robot driven by its motor, or joints, might be slightly off then what we expect it to be. We want to have a feedback system that reduces the error. We utilize the idea of Lyapunov that describes the system's stability. Here is the requirement for such stable system in the text book:
Here is my Simulink block code that utilize this model and first order error feedback:
This feedback look at the error of only position and feed it back to the inverse dynamic. Inverse dynamics is a way to calculate how should I move each joint of the robot given the desire movement of the end effector, while knowing the full configuration of the robot.
We can also take into account of the acceleration and velocity error in feedback system, here is a Simulink sample:
I graph the error, which is the difference between the desire position and the actual position as shown:
We can see that the X, Y, Z, and orientation theta all has error around 10^-4, meaning such control system perform really well in reducing the inverse error.
Here is the video of manipulator performing a motion of picking up and placing an object.
Our robot not only move alone the desire path, but it can also do secondary task if we relax a degree of freedom. For example, if I don't care how robot move in Z direction, but I care about it not touching an obstacle, our robot can exploit the redundancy and perform that task.
The manipulator achieve this by modeling the tasking in mathematical equations, then updates the partial differentiation into the error. Here is the mathematical model of obstacle avoidance.
Here is a simple demonstration comparing similar time step. The left one is with secondary task, and the right one is without. We can see that the left one stretch further down in z direction to keep more distance from the ball.
Of course, the manipulator's end effector should be able to carry weights. We need to calculate the joints value that counteract the torque from the end effector as well as any forces and energy that arises from the manipulator's structure and movement. This is the dynamics problem. We model the dynamics using the concept of Lagrangian.
To take into account of dynamics while model our manipulator alone the desire trajectory, we use centralized control and inverse dynamic system. The joints values of dynamics are calculated in a loop decoupled from the loop that reduce movement error like what we just shown. Here is the framework instructed in the text book:
For my Simulink implementation, here is the total system:
The second order system block is the same as before, it's just we connect it with the inverse dynamics control. Here is the detail inside the block:
With this scheme, we can control the manipulator to take into account of its dynamic and allow from weight carrying, while keeping its trajectory. Here is the positional error:
We see that they are all being reducing to 0, meaning that our positional accuracy is not effected by weights at the end effector.
Here is the GitHub link to all the MATLAB and Simulink code of my manipulator: