Chapter 4Trajectory Control 1 @VLC-2015 4.1 Point-to-Point Control Point to point motion is applied for some kinds of robots such as: point welding, packaging,β¦ In this type of motion, we only take into account the position of the beginning, ending points and time of motion. ο Problem: π We have to determine the rule of change of the angular q between the initial position ππ and the finally position ππ in the time interval 0, π‘π . ππ ππ 0 π‘π π‘ Assuming that π½π : inertial moment of motor 2 @VLC-2015 ππ: torque of motor 4.1 Point-to-Point Control Note that the problem has plenty of solutions.2) Then the motion trajectory will be the third order form: π π‘ = π3 π‘ 3 + π2 π‘ 2 + π1 π‘ + π0 3 @VLC-2015 (4. we include an optimal criterion: the least consuming energy ο Mathematic description: π½π π = ππ where π‘π π 0 subjec to: π‘ ππ‘ = ππ β ππ π‘π TM 2ππ‘ 0 (4. Therefore.1) β ππΌπ The general solution has the following form: π π‘ = ππ‘ 2 + ππ‘ + π (4.3) . π2 . π3 .5) We need to determine 4 coefficients: π0 .t.1 Point-to-Point Control The velocity will follow the second order form: π π‘ = 3π3 π‘ 2 + 2π2 π‘ + π1 (4.4. π1 . We have the following equations: π0 = ππ π1 = ππ π3 π‘π 3 + π2 π‘π 2 + π1 π‘π + π0 = ππ 3π3 π‘π 2 + 2π2 π‘π + π1 = ππ 4 @VLC-2015 (4.6) .r.4) And the acceleration changes w. the first order rule π π‘ = 6π3 π‘ + 2π2 (4. when π‘ = 0 πππ π‘ = 1 5 The disadvantage of this rule is the maximum accelerations at the initial and final point. ππ = π. when π‘ = 1/2 And the acceleration gets its the maximum value: ππππ₯ = 6π. the initial and final velocity ππ = ππ = 0 From the above equations.1 Point-to-Point Control For example: ππ = 0. π‘π = 1 . we find the solutions: π0 = π1 = 0 π2 = 3π. @VLC-2015 .4. π3 = β2Ο The velocity gets the its maximum value: ππππ₯ = 3π/2. 4.1 Point-to-Point Control πππ π 3π ππ ππ 0 ππ 0 π πππ/π 0 1 3π/2 π‘π π‘π π‘π 3π/2 ππ πππ/π 2 6π 6 @VLC-2015 β6π 1 π π‘π π‘π ππ π‘π βππ π‘π . the time of acceleration and deceleration is equal. That means: ππ β ππ ππ π‘π = π‘π β π‘π (4. ππ is the position at the time π‘π when the motor accelerates at ππ (πππ/π 2 ) 7 @VLC-2015 . the velocities at the transition points have to be smooth. at π‘π = π‘π /2 (4.1 Point-to-Point Control The famous trajectory that is usually used in most industrial controllers is Blended Polynomial with the trapezoidal velocity. We have: ππ = (ππ βππ )/2.8) where.4.7) In order to guarantee the trajectory is continuous. Assuming that ππ = ππ = 0 . 13) .12) π‘π2 4 ππ βππ π‘π2 . ππ β₯ 4 ππ βππ It is obvious that if ππ = 8 @VLC-2015 (4. finding π‘π β€ π‘π /2. (4.10) ππ π‘π2 β ππ π‘π π‘π + ππ β ππ = 0 Given ππ . we have: π‘π 1 π‘π2 ππ β 4(ππ β ππ ) π‘π = β 2 2 ππ where. ππ .9).9) ππ = ππ + ππ π‘π 2 From Eq. π‘π = π‘π = π‘π 2 (4.8) & (4.11) (4.4. π‘π . we got: (4.1 Point-to-Point Control We have: 1 2 (4. ππ . given ππ .12) we calculate and choose ππ . (4.11). The rated speed is 2000 (RPM).14) π‘π β π‘π β€ π‘ β€ π‘π Example: Determine the Blended Polynomial trajectory in order to control the position of the motor in 20 rounds within 2s.1 Point-to-Point Control Therefore. the trajectory is determined by a piecewise function 1 ππ + ππ π‘ 2 2 π π‘ = ππ + ππ π‘π 0 β€ π‘ β€ π‘π π‘π π‘β 2 1 ππ β ππ π‘π β π‘ 2 π‘π β€ π‘ β€ π‘π β π‘π 2 (4. ππ and π‘π . then calculate π‘π from Eq. 9 @VLC-2015 . from Eq.4. Finally. (4. 4. and speed π are given by 2π πΌ= (πππ) πππ π = ππΌ (πππ) πΌ π= (πππ) ππ where π is the number of pulses (4. pulses must be generated at a steady rate 10 @VLC-2015 .2 Application for Step and DC motors οΆ Step motor The motor step angle: πΌ. position: π.15) ππ is the delay time To rotate a stepper motor at a constant speed. control of the acceleration and deceleration is needed. and the resolution of the time delay between these steps is given by the frequency of the timer.4. Discrete steps control the stepper motor motion. The time delay ππ between the stepper motor pulses controls the speed. These time delays must be calculated in order to make the speed of the stepper motor follow the speed ramp as closely as possible. 11 @VLC-2015 .2 Application for Step and DC motors ο Linear speed ramp To start and stop the stepper motor in a smooth way. speed and position. Figure in previous section shows the relation between acceleration. ππ‘ = (s) ππ‘ 0 ππ0 We have: t1 ππ1 t2 π t3 t4 π2 ππ0 = π0 ππ‘ ππ1 = π1 ππ‘ 12 @VLC-2015 t ππ2 = π2 ππ‘ (4.16) .4.2 Application for Step and DC motors Ο Assuming that the time delay is generated by a timer with a frequency 1 ππ‘ (Hz). 2 Application for Step and DC motors The position at the time π‘ is given by equation: π‘ 1 2 π π‘ = π π ππ = ππ‘ 2 0 Assuming that π π‘ is corresponding to the nβth pulse.18) .4.17) And the time delay between two steps is: 13 @VLC-2015 ππ ππ‘ = π‘π+1 β π‘π = 2πΌ ( π + 1 β π) π (4. then 1 2 π π‘ = ππ‘π = ππΌ 2 β π‘π = 2ππΌ π (4. 4.2 Application for Step and DC motors Finally the expression for the counter delay is found: 1 2πΌ ππ = ( π + 1 β π) ππ‘ π (4. we use the Taylor series approximation 14 @VLC-2015 .19) When π = 0: 1 2πΌ π0 = ππ‘ π (4.20) β ππ = π0 ( π + 1 β π) In order to reduce the burden of calculations. 4.21) This calculation is much faster than the double square root. 2ππβ1 β ππ = ππβ1 β 4π + 1 (4.2 Application for Step and DC motors ππ ππβ1 π0 ( π + 1 β π) 4π β 1 = β π0 ( π β π β 1) 4π + 1 Finally. 15 @VLC-2015 . but introduces an error at n =1.676. A way to compensate for this error is by multiplying π0 with 0. 4. ο§ The velocity trajectory is therefore trapezoidal for a long move and triangular for a short move where maximum velocity was not reached. @VLC-2015 . A linear piecewise velocity trajectory is implemented in this application. ο§ For a position move. the velocity is incremented by a constant acceleration value until a specified maximum velocity is reached.2 Application for Step and DC motors 16 οΆ DC servo motor A trajectory generation algorithm is essential for optimum motion control. ο§ The maximum velocity is maintained for a required amount of time and then decremented by the same acceleration (deceleration) value until zero velocity is attained. 4.2 Application for Step and DC motors velocity velocity limit Slope = Accel. limit short move long move time ο§ The SetMove subroutine is invoked once at the beginning of a move to calculate the trajectory limits. (4.14)) 17 @VLC-2015 . ο§ The DoMove routine is then invoked at every sample time to calculate new βdesiredβ velocity and position values as follows (from Eq. 2 Application for Step and DC motors π£π = π£πβ1 + πππππ.4. and the size of the movement. acceleration. π 2 2 In position mode. the actual shape of the velocity profile depends on the values of velocity. The block diagram of position controller Trajectory Generator Kp PI DC Velocity feedback 18 Position feedback @VLC-2015 1 π . π (4.22) 1 ππ = ππβ1 + π£πβ1 π + πππππ. There are three cases that usually use in trajectory generator: @VLC-2015 .3 Continuous Path Motion In many applications. the servo systems (Robots. π π2 Ξ 1 Ξ 2 π3 Ξ 3 β― π1 = ππ π‘1 = 0 19 β― ππ = ππ π‘2 π‘3 π‘π = π‘π The problem is to determine the trajectory that goes through N path points with the constraint conditions.4. CNC) have to be controlled in a predefined continuous path. in the case of the velocities are predetermined Assuming that the trajectory has N path points. π π‘ . π π‘ . at the path points are predetermined ο§ The velocities.3 Continuous Path Motion ο§ The velocities. π π‘ . at the path points are calculated by a specific criterion.23) . For example. ππ+1 ) . then the third order polynomial is adopted to interpolate two adjacent points ( ππ . ο§ Guarantee the continuity of acceleration.4. Each polynomial has to satisfy the following conditions: Ξ π π‘π = ππ Ξ π π‘π+1 = ππ+1 Ξ π π‘π = ππ 20 @VLC-2015 Ξ π π‘π+1 = ππ+1 (4. at the path points.