A system with a feedback controller will attempt to drive the system to a state described by the desired input, such as a velocity. In earlier chapters we simply chose step inputs, ramp inputs and other simple inputs to determine the system response. In practical applications this setpoint needs to be generated automatically. A simple motion control system is used to generate setpoints over time.
An example of a motion control system is shown in Figure 17.1 A motion controller. The motion controller will accept commands or other inputs to generate a motion profile using parameters such as distance to move, maximum acceleration and maximum velocity. The motion profile is then used to generate a set of setpoints, and times they should be output. The setpoint scheduler will then use a real-time clock to output these setpoints to the motor drive.
Figure 17.1 A motion controller
The combination of a motion controller, drive and actuator is called an axis. When there is more than one drive and actuator the system is said to have multiple axes. Complex motion control systems such as computer controlled milling machines (CNC) and robots have 3 to 6 axes which must be moved in coordination.
A simple example of a velocity profile for a point-to-point motion is shown in Figure 17.2 An example of a desired motion (position). In this example the motion starts at 20 deg and ends at 100 deg. (Note: in motion controllers it is more common to used encoder pulses, instead of degrees, for positions velocities, etc.) For position control we want a motion that has a velocity of zero at the start and end of the motion, and accelerates and decelerates smoothly.
Figure 17.2 An example of a desired motion (position)
A trapezoidal velocity profile is shown in Figure 17.3 An example of a velocity profile. The area under the curve is the total distance moved. The slope of the initial and final ramp are the maximum acceleration and deceleration. The top level of the trapezoid is the maximum velocity. Some controllers allow the user to use the acceleration and deceleration times instead of the maximum acceleration and deceleration. This profile gives a continuous acceleration, but there will be a jerk (third order derivative) at the four sharp corners.
Figure 17.3 An example of a velocity profile
The basic relationships for these variables are shown in Figure 17.4 Velocity profile basic relationships. The equations can be used to find the acceleration and deceleration times. These equations can also be used to find the time at the maximum velocity. If this time is negative it indicates that the axis will not reach the maximum velocity, and the acceleration and deceleration times must be decreased. The resulting velocity profile will be a triangle.
Figure 17.4 Velocity profile basic relationships
For the example in Figure 17.5 Velocity profile example the move starts at 100deg and ends at 20 deg. The acceleration and decelerations are completed in half a second. The system moves for 7.5 seconds at the maximum velocity.
Figure 17.5 Velocity profile example
The motion example in Figure 17.6 Velocity profile example without reaching maximum velocity is so short the axis never reaches the maximum velocity. This is made obvious by the negative time at maximum velocity. In place of this the acceleration and deceleration times can be calculated by using the basic acceleration position relationship. The result in this example is a motion that accelerates for 0.316s and then decelerates for the same time.
Figure 17.6 Velocity profile example without reaching maximum velocity
Given the parameters calculated for the motion, the setpoints for motion can be calculated with the equations in Figure 17.7 Generating points given motion parameters.
Figure 17.7 Generating points given motion parameters
A subroutine that implements these is shown in Figure 17.8 Subroutine for calculating motion setpoints. In this subroutine the time is looped with fixed time steps. The position setpoint values are put into the setpoint array, which will then be used elsewhere to guide the mechanism.
Figure 17.8 Subroutine for calculating motion setpoints
In some cases the jerk should be minimized. This can be achieved by replacing the acceleration ramps with a smooth polynomial, as shown in Figure 17.9 A smooth velocity profile. In this case two quadratic polynomials will be used for the acceleration, and another two for the deceleration.
Figure 17.9 A smooth velocity profile
An example of calculating the polynomial coefficients is given in Figure 17.10 A smooth velocity profile example. The curve found is for the first half of the acceleration. It can then be used for the three other required curves.
Figure 17.10 A smooth velocity profile example
Figure 17.11 A smooth velocity profile example (cont'd)
Controllers use a variety of motion profiles. The trapezoidal and quadratic equations presented previously can be used in simpler systems. Other motion profiles are possible for some or all of the curves, as shown in Figure 17.12 Profile Types.
Figure 17.12 Profile Types
A motion can be described using position points along a path. These methods are normally used when a controller does not have any velocity or acceleration limits. The method shown in Figure 17.13 Generating smooth motion paths controls motion using a parametric function 'p(u)'. The function value varies from 0 to 1 as the parameter 'u' varies from 0 to 1. However, the parameters of the function are selected so that the motion starts and stops with a velocity of zero. In this case the final polynomial equation, (3), is fairly simple. This equation can then be used in equation (1) to generate a smooth motion path between any arbitrary start and end point, with arbitrary start and end times.
Figure 17.13 Generating smooth motion paths
The example in Figure 17.14 Generating smooth motion paths shows the use of a trigonometric function, instead of a polynomial. This function was used to generate the points in the following sample program in Figure 17.15 Subroutines for motion profile generation and use.
Figure 17.14 Generating smooth motion paths
The program in Figure 17.15 Subroutines for motion profile generation and use generates a motion table that can then be used to update setpoints. The function 'table_init()' must be called once when the program starts to set up global time and table values. When a new target position has been specified the 'table_generate()' function is called to generate the setpoint table. The 'table_update()' function is called once every interrupt scan to check the setpoint table, and update the global setpoint variable, 'point_current' at scheduled times. This function also includes a simple clock to keep track of the system time.
Figure 17.15 Subroutines for motion profile generation and use
In a machine with multiple axes the motions of individual axes must often be coordinated. A simple example would be a robot that needs to move two joints to reach a new position. We could extend the motion of the slower joints so that the motion of each joint would begin and end together.
When the individual axis of a machine are not coordinated this is known as slew motion. Each of the axes will start moving at the same time, but finish at separate times. Consider the example in Figure 17.16 Multi-axis slew motion. A three axis motion is required from the starting angles of (40, 80, -40)deg, and must end at (120, 0, 0)deg. The maximum absolute accelerations and decelerations are (50, 100, 150) degrees/sec/sec, and the maximum velocities are (20, 40, 50) degrees/sec.
Figure 17.16 Multi-axis slew motion
The calculations for the motion parameters are shown in Figure 17.17 Calculated times for the slew motion. These are done in vector format for simplicity. All of the joints reach the maximum acceleration. The fastest motion is complete in 1.13s, while the longest motion takes 4.4s.
Figure 17.17 Calculated times for the slew motion
17.3.1.1 - Interpolated Motion
In interpolated motion the faster joints are slowed so that they finish in coordination with the slowest. This is essential in devices such as CNC milling machines. If this did not occur a straight line cut in the x-y plane would actually be two straight lines. The slew motion example can be extended to be slew motion where all joints finish their motion at 4.4s. This can be done by accelerating at the maximum acceleration, but setting a new maximum velocity. This is shown in the example in Figure 17.18 Interpolated motion based upon Figure 17.17 using the results from the example in Figure 17.17 Calculated times for the slew motion.
Figure 17.18 Interpolated motion based upon Figure 17.17 Calculated times for the slew motion
After the setpoint schedule has been developed, it is executed by the setpoint scheduler. The setpoint scheduler will use a clock to determine when an output setpoint should be updated. A diagram of a scheduler is shown in Figure 17.19 A setpoint scheduler. In this system the setpoint scheduler is an interrupt driven subroutine that compares the system clock to the total motion time. When enough time has elapsed the routine will move to the next value in the setpoint table. The frequency of the interrupt clock should be smaller than or equal to the time steps used to calculate the setpoints. The servo drive is implemented with an algorithm such a PID control.
Figure 17.19 A setpoint scheduler
The output from the scheduler updates every time step. This then leads to a situation where the axis is always chasing the target value. This leads to small errors, as shown in Figure 17.20 Errors in path following.
Figure 17.20 Errors in path following
· When we have simple features, paths are easy to generate. These features include,
- steps
- pockets
- holes
- etc.
· Typically paths for these will repeat as shown below,
· For complex surfaces we want to contour appropriately. These surfaces will almost always be represented with spline patches.
· Recall that a spline patch can be represented parametrically
· A simple algorithm to cut the surface is shown below.
- the controller described in the block diagram below uses a model for a DC permanent magnet DC motor to estimate a voltage based upon a predicted velocity and position.
- the desired position and velocity are given in figure xxx based upon the motion position control derived in the earlier section
Figure 17.21 Motion position control equation
- the controller that uses the desired position and velocity is shown in figure xxxx
Figure 17.22 Feedforward trajectory controller
· Axis limits can be used to calculate motion profiles.
· Trapezoidal and smooth motion profiles were presented.
· Motion profiles can be used to generate setpoint tables.
· Values from the setpoints can then be output by a scheduler to drive an axis.
1. a) Develop a motion profile for a joint that moves from -100 degrees to 100 degrees with a maximum velocity of 20 deg/s and a maximum acceleration of 100deg/s/s. b) Develop a setpoint table that has values for positions every 0.5 seconds for the entire motion.
2. Consider a basic servo controller with encoder feedback. The motor will start at a position count of 100, and end the motion at a count of 3000. The motion is to have a maximum acceleration of 300 counts/s/s, and a maximum velocity of 100 counts/s. Find a motion profile that satisfies these constraints. Generate a table of setpoints for the desired position every 2 seconds.
1. Find a smooth path for a robot joint that will turn from θ= 75° to θ = -35° in 10 seconds. Do this by developing an equation then calculating points every 1.0 seconds along the path for a total motion time of 10 seconds. Do not assume a maximum velocity.
2. Paths are to be planned for a three axis motion controller. Each of the joints has a maximum velocity of 20 deg/s, and a maximum acceleration of 30 deg/s/s. Assuming all of the joints start at an angle of 0 degrees. Joints 1, 2 and 3 move to 40 deg, 100deg and -50deg respectively. Develop the motion profiles assuming,
a) slew motion
b) interpolated motion
3. Develop a smooth velocity profile for moving a cutting tool that starts at 1000 inches and moves to -1000 inches. The maximum velocity is 100 in/s and the maximum acceleration is 50in/s/s.
4. An axis has a maximum velocity of 2.0 rad/s and a maximum acceleration/deceleration of 0.5 rad/s^2. Sketch a trapezoidal motion profile and find the motion time for a -4.0 rad motion.
5. An axis has a maximum velocity of 5m/s and an acceleration/deceleration time of 1s. Sketch a trapezoidal motion profile and find the motion time for a 25m motion.
6. Develop a smooth velocity profile for moving a cutting tool that starts at 1000 inches and moves to -1000 inches. The maximum velocity is 100 in/s and the maximum acceleration is 50in/s/s.