Design a PD controller for a set point control to steer a cart to a desired point (MATLAB)

This essay is missing various diagrams but may be useful to students in seeing how to structure their paper.

1.Introduction

Control systems have many uses in real life, one such use of control systems could be to allow autonomous robots to sense distance and stop at discrete points. A closed loop control system allows for feedback to control the process; one such control loop feedback mechanism is the PID (proportional-integral-derivative) controller.

The purpose of this MATLAB exercise is to design a PD controller for a set point control to steer a cart to a desired point xd with certain requirements that have to be met. These requirements have to be met in the following performance measures:

• Rise time, which is defined the time taken for an output to rise from 10% to 90% of its final value, hence in this case; the time taken for the cart to go from 0.1xd to 0.9d.
• Percentage overshoot, which is defined as the ratio of the percentages of the maximum deviation from the desired point after its first pass, and the final desired point xd.
• Settling time, which is defined as the time it takes the cart to settle within 2% of the desired point xd

More specifically:

• The rise time must not exceed 5 seconds
• The percentage overshoot cannot be larger than 5%
• The settling time must be under 5 seconds.

Figure 1: Effect of parameters on PD performance measures

The remaining sections of this report will look at the design of the PD controller, the design of a notch filter, the derivation of equations necessary for these designs and a final discussion and conclusion. The latter two sections will review the effectiveness of the PD controller and notch filter and also the usefulness of MATLAB.

2. Design of PD controller

2.1 Description of Considered Systems

Before designing any control, the systems that the exercise will focus on need to be considered.

Figure 2: Rotational System, Free Body Diagram [Source: Huijberts.H, 2013]

Figure 2 shows a simple positioning mechanism that is a rotational system, with a main rotating shaft S, load L and motor M.

Figure 3:Translational System, Free Body Diagram [Source: Huijberts.H, 2013]

Figure 3 shows the translational equivalent of the rotations system seen in Figure 2. The cart has a mass m, moves due to force u at a distance of x from the wall (origin). There is no friction acting upon the system.

Figure 4: Rotational system with Flexibility [Source: Huijberts.H, 2013]

Figure 4 is a similar system to the one seen in Figure 2 but with additional flexibility in the shaft of the positioning mechanism. This flexibility will cause vibrations in the mechanism and is modeled so that the shaft is split into two interconnected parts; one with a spring (with constant k) and the other with a damper (with constant c).

Figure 5: Translational System with Flexibilty [Source: Huijberts.H, 2013]

The system in Figure 5 is the translational equivalent of the system in Figure 4. The cart on the right represents the load and shaft on the right attached to the damper. The cart on the left represents the shaft on the left attached to the motor and the spring.

2.2 Overview of PD design

A PID controller has three modes as opposed to two in a PD controller. The mode that is removed is the Integral mode. This mode integrates error with respect to time and will keep increasing because the error is negative despite decreasing distance to the set point, this will reduce the error by incrementing the controller’s output. The output of the integral control is directly proportional to the integral of the errors multiplied by the integral gain KD. The integral mode accelerates the system towards the setpoint thus reducing the steady state error but increases the magnitude which can cause it to overshoot. Hence, the integral term is removed in order to increase the stability of the system.

3. Derivation of Equations

3.1 Transfer Function of Translational System

The equation of motion of the translational system seen in Figure 3 is in the form f = ma:

By taking the laplace transforms of equation (1):

Since:

Equation (2) can be written as:

3.2 Initial Closed Loop System Transfer Function

Figure 6

The error of the system is the desired output, xd minus the actual output, x(t):

Hence taking the laplace transform of equation (4) and multiplying it by the proportional and derivative gain will provide the output of the PD Controller:

By bringing back equation (3):

Rearranging equation (6) to provide the output = actual/desired:

3.3 Closed Loop Transfer Function with Flexibility

Figure 7

This system is seen in Figure 5, where C(s) denotes the 1kg cart with respect to x and the H(s) cart denotes the 0.1kg cart with respect to y. The spring constant k is assumed to be 20N/m and the damping constant c is assumed to be 5Ns/m. The systems equations of motion are:

Taking the Laplace transform of (8) and (9):

Two simultaneous equations are obtained and thus solving:

(11) can be placed back into (10) to find the output y transfer function for the feedback path:

This process can be repeated to find the output x transfer function for the forward path by substituting (12) into (11):

By evaluating (12) and (13):

The systems transfer function including feedback is characterized as:

The feedback path transfer function is characterized as:

3.4 Notch Filter Properties

The properties of a general Notch Filter must be derived to verify values for zeta:

Second property:

4. Design of Notch Filter

4.1 Overview of Notch Filter

A Notch filter (also known as Band-Stop filters) is a type of band filter that attenuates a narrow band of frequency but allows most other frequencies on the spectrum to pass through. Notch filters can improve performance of a system such as removing interference from telephone lines or reducing static in radios. In the case of this exercise, a Notch filter is added to remove the resonance and improve the performance of the closed loop feedback system.

4.2 Design of Notch Filter in presence of flexibility

The transfer function of the Notch filter is given as:

The values of zeta 1, 2 and n are chosen to satisfy the properties that were derived in section 3.4:

The values were found to be 1, 2 and 1.34 for 1, 2 and n respectively. n was found by analyzing the graph at its peak Bode magnitude. These values satisfied the properties.

5. Results

5.1 Tuning of the PD Controller

The values of KP and KD are chosen to meet the performance requirements. They had to be in the following range:

• 0 < KP < 1.5
• 0 < KD < 4.4

Figure 8: Graph of PD Controller Step Responses
Figure 8 shows the testing of various KP and KD values in order to find the optimum values for the PD Controller. Graph (a) has KP and KD values which are quite similar to one another and appears to be critically damped since there is only one peak. Graph (b) is an underdamped response with the largest peak response of 1.65 and the largest overshoot of 65.2%, this system will overshoot due to the because of the long settling time of 16.7s. Graph (c) is similar to graph (b) in that the peak response is quite high but has a much smaller settling time of 6.82s which means it has more damping on the system. Graph (d) has the only KP and KD values which are in the following range and satisfy the performance measures. The peak response is very small compared to the other graphs and also settles very quickly after just 3.63s. Therefore, the values of 4.41 and 1.163 were used for the controller.

5.2 Closed Loop System Analysis

A feedback path was added to the closed loop system to observe the effects it has on it (see Appendix 1.3). Ideally, the feedback would allow the error to be reduced, thus decreasing overshoot.

Figure 9: Graph of Closed Loop Feedback System
There was not much of a positive effect on the system, there was a small decrease on settling time (0.02s) and a small decrease in rise time (0.024s). Unexpectedly, there was a large increase in percentage overshoot (4.98% to 11.2%), which places the value outside the required performance measures.

Figure 10: Bode Magnitude graph of Closed Loop Feedback
Using the Bode magnitude graph of the Closed Loop Feedback system, the resonance frequency r and the magnitude Mr of the resonance peak can be found. These values are used to help design the notch filter for the system with r = 1.24 and Mr = 0.694.

5.3 Notch Filter Analysis

Figure 11: Comparison of Notch Filters
Figure 11 shows the step response of a general Notch Filter and the Notch Filter tuned for the Closed Loop System. There is a large difference in the minimum peak of the magnitude, with the general Notch Filter having a much smaller minimum peak (0.564) compared to the tunnel Notch Filter (0.933).

Figure 12: Comparison of Control System with/without Notch Filter
Once the Notch Filter was designed, it was attached to the Closed Loop Feedback System and the effect was analyzed. It can be seen that after the Notch Filter was added, the system was further damped, improving the performance measures by reducing the overshoot.

6. Discussion

The proportional gain KP represents the present error and is multiplied by the error term that is proportional to the error value in the system. Increasing KP will increase the speed of the response time of the system. Hence, the settling time and rise time should decrease. However, a high KP may cause the system to overshoot. The derivative gain KD is bases on the rate of change of the signal and produces a counteracting signal to correct it. A high KD should better the settling time and stability of the system.

Analyzing Figure 8, graph (a) has KP and KD that are similar to each other, producing a relatively low settling time and rise time but with quite a large percentage overshoot that indicates that it could be dampened more. Graph (b) has a low KD but a KP that is roughly in the middle of the required range. The low KD value means that the system is not very stable and this can be seen in the large percentage overshoot of 65.2% and the long settling time of 16.7%. Graph (c) has a high KP value causing a high overshoot but is slightly balanced out by a low KD value keeping the settling time and rise time low. The best combination was found to be with a high KD and a low KP which allowed the PD controller to meet the performance requirements.

Once the Notch Filter was designed, it was attached to the Closed Loop Feedback System and compared with the initial system (which had no Notch Filter). The overshoot of the system decreased after the Notch Filter was added but the rise time increased by 0.024s. The system did improve after the attachment of the Notch Filter and it shows that a systems stability can be improved by adding Band filter to filter oscillations caused by flexibility in the system.

7. Conclusion

In conclusion the addition of a Notch Filter to a Closed Loop Feedback system does have a overall positive effect of reducing overshoot and settling time but at a risk of increasing the rise time. The exercise could be improved by testing different types of controllers such as PI, PID and P Controllers to see if the error from the feedback can be reduced.

Overall the use of MATLAB was very effective. If these transfer functions and graphs were created by hand it would be very time consuming. MATLAB also allows many functions to run in its software and tools such as LTIView are very effective at analyzing graphs. The system is fairly easy to learn and there are many resources online which are of great assistance.

Leave a Comment

Time limit is exhausted. Please reload the CAPTCHA.