Skip to content

Simulation of a Robotic arm and its position control system.

Notifications You must be signed in to change notification settings

JalalSayed1/Robotic-arm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Robotic Arm

Overview

Prosthetic Arm Elbow Motion Schematic Diagram

  • Robotic arms are used extensively in several industries. They are electro-mechanical systems that replicate the articulated motion of human arms. The one developed here is for limb replacement. The movement of the 2 linked parts (upper arm and forearm) is predominantly through the actuated elbow joint. A DC motor controller in this project will drive this.
  • The actuator is connected to the upper arm. For this project, we assumed the upper arm is fixed at a specific angle (5°). The actuator rotates the forearm employing a set of gears.

Geometry of rotating motion

  • The motion of the arm is regulated by an automatic control system that determines the necessary rotational deflection of the forearm. To achieve this, the arm must be equipped with the necessary system to ensure its automatic movement within its operating environment. The general principle of automated actuator systems is to feed information from joint rotation sensors to the arm’s control system.
  • This system changes the voltage applied to the elbow actuator to produce the required rotational motion and thus change the deflection angle of the forearm.
  • The elbow control system produces the required actuator rotation to move the forearm to a reference angle. It achieves this by comparing the actuator deflection angle θM (radians) with the reference angle θFref (radians). This indirectly controls the forearm’s deflection angle θF (radians).
  • The Elbow control system uses the error difference between the reference deflection angle and the actuator’s deflection angle. In this case, the value for $\theta$Fref (reference angle) is 55°. The reference deflection passes through the Reference Amp, represented by a simple gain KR. Also, the motor deflection is measured by the Actuator Sensor, which is represented by a simple gain KS.
  • The compensated voltage, VA, is used to control the elbow actuator to drive the gears and thus indirectly generate an appropriate forearm deflection $\theta$F. It achieved this using a proportional gain GC and an integral term with gain K1 (assumed to be z in the initial stages of the project). These gains determine the performance of the control system.
  • A key part of the overall Elbow Control System is the arm’s interaction with the actuator and gears. The actuator voltage is used to drive the actuator (i.e DC motor) to deflection θM (radians) using its generated torque TM (Nm). The drive shaft of the actuator is connected to Gear 1 (radius r1 meters), which acts as a load on the motor. As Gear 1 rotates, it transfers torque TF (Nm) to Gear 2 (radius r2 meters), which rotates the forearm to the desired deflection angle. This results in a gear ratio GR = r2/r1 and the torque TF = GRxTM.

States and State Derivatives

States State Derivatives Description
$x$1 = i $\dot{x}$1 = 1/L * (Va-R * x1 - Ke * x3); Current equation
$x$2 = θM $\dot{x}$2 = x3 Angle of the motor
$x$3 = θMdot $\dot{x}$3 = 1/Jm * (Ktx1-Bsm(x3-x5)) Speed of the motor
$x$4 = θG1 $\dot{x}$4 = x5 Angle of grear 1
$x$5 = θG1dot $\dot{x}$5 = 1/Jgear1 * (Bsm*(x3-x5)) Speed of gear 1
$x$6 = θF $\dot{x}$6 = x7 Angle of forearm/gear 2
$x$7 = θFdot $\dot{x}$7 = 1/Jf * ((GR * Kf * x4) - (Bsf * x7) - ((Mf * Lf * g * sin(theta_U + x6)) / 2)); Speed of forearm

Constants

Constant Value Unit Description
Bsm 0.01 Nm/rad/s Damping coefficient for the motor
Bsf 1.5 Nm/rad/s Damping coefficient for the forearm
Jm 0.002 kgm2 Moment of inertia for the motor armature
Jgear1 0.001 kgm2 Moment of inertia for gear 1
Jf 0.0204 kgm2 Total moment inertia of the forearm and hand
Gc 9.95 N/A Elbow controller gain
GR 1.7 N/A Ratio between radius of gear 1 and gear 2
Ke 0.35 V/rad/s Back emf constant
Kf 0.5 N/A Torque gain
Kg 2.0 N/A Gear compensator gain
Kr 0.9 N/A Reference amp gain
Ks 0.9 N/A Motor deflection actuator sensor gain
Kt 0.35 Nm/A Torque constant
L 0.1 H Inductance
Lf 0.35 m Length of forearm
Mf 0.5 kg Mass of forearm
R 4 Resistance
G 9.81 m/s2 Acceleration of gravity

Initial Conditions, Numerical Integration Solver & Step-Size Selection

  • Initial conditions: angle of forearm = theta F = -9°.
  • Numerical Integration Solver: Runge-Kutta 4th order:
    • This provides us with sufficient accuracy and computation time for this application. Runge-Kutta 4th order has a truncation error of the 5th term of the Taylor series. The 5th term of the Taylor series of almost any system will be very close to zero, resulting in an accurate numerical integration solver.
  • Step size = 0.001s:
    • After calculating the time constant of the system, I found out that any step-size less than 0.0025 will be sufficient. Therefore, 0.001 has been selected for more accurate measurements.

Block diagram

  1. Overview: image
  2. All system: image
  3. Actuator: image
  4. Gear system: 4.1. Overview: image 4.2. Implementation: image
  5. Forearm dynamic: image

System Response #1

  1. MATLAB reponse: MATLAB reponse

  2. Simulink block diagram response: Simulink block diagram response


  • The responses show how the motor angle, arm position and speed are related together. Initially, the motor changes its angle fast because its sensor shows that the arm is positioned at -9°. Therefore, the forearm’s speed and the angle changed quickly. Then, as the motor slows down, the speed and angle of the forearm slow down too until reaching a steady state at around 55° (i.e. the reference angle) and speed of 0.

Better controller

  • Previous results shows how wasn't really good for this system (i.e. very oscillatory). The reason for this was that the design of the controller was not suitable.
  • key parameter is the upper arm deflection angle, $θ$U. This deflection represents the motion of the upper arm and the variation in this value represents approximate changes in the dynamics of the upper arm.
  • In this part, the variation in values is achieved by interpolating data points that represent the upper angle deflection at specific time points.
  • Therefore, Ve equation will be changed:
    • From simple Gain $Ve = Gc * \Deltaθ$
    • To $Ve = Gc*(1+Ki/s) \Deltaθ$ ; where 1/s is the Laplace operator and Ki is the integral gain.

Using the mentioned equation, we will be varying two variables: Gc (the compensator gain) and Ki (the integral gain) and investigate how changing these two parameters can improve the performance of our system.

Then, to vary the upper arm angle over time, we will use the Quadratic Splines interpolation method to estimate its value using lab data obtained over short time intervals:

Time (s) 0 3.5 7.5 16.5 21.5 25
$\theta$u 5.0 10.5 24.5 27.5 35.5 45.5

Gc Control Gain Variation Results & Analysis

image

KI Control Gain Variation Results & Analysis

As we found previously that Gc = 0.5 will produce the best results, we will fix this value here. Now, by varying Ki from 0 to 5, we will notice that above 4, the graph will start to wobble. This means that the value of Ki = 4 is better than any of the values above this one. Adding the integrator gain leads to some initial damping (i.e., around 0.6s). However, it makes the system reaches a steady-state much faster than without it. For instance, with Ki = 0 (i.e. no integrator gain), the system reaches steady-state at about 1.8s. Adding the integrator gain value of 4 leads the system to reach this steady state at about 1s.

image

About

Simulation of a Robotic arm and its position control system.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages