None Lab_7

Challenge

You will design a controller for motor position using your complete toolkit of root locus analysis tools. You will develop a plant transfer function for the MOTOR-SHAFT-LOAD configuration to try achieve $\zeta = 0.1$ $\omega_n = 25 rad/s$ for the dominant eigenvalue pair. If you aren't sure why we are using such a LOW damping ratio, ask your instructor for clarification!

Workstation Configuration

For this lab, you will be using the motor connected to the load inertia via a RIGID shaft by using the brass coupler INSTEAD of the spring.

image-3.png

Model Development: Plant Model

Begin by developing a plant model for velocity for the motor-rigid shaft-load configuration in the code block below. Include in your OUTPUT a graph of your fit to data and display the plant transfer function.

As with lab 6, use the FSMMotor2 class to send commands to the motor. If you haven't already, follow the procedure in section 2.3 of Lab 4 to upload the new library and access the updated documentation.

In [1]:
% YOUR CODE HERE
error('No Answer Given!')
error: No Answer Given!

Controller Design: PD Control of Position

Although you previously developed a plant transfer function with angular velocity as the output, you can modify the velocity transfer function so that it outputs position simply by adding an integrator in series. The block diagram for PD control of your velocity transfer function modified with an integrator is shown below.

Notice that $H = 1$ in the diagram. This implies you will be able to directly measure the position of the motor shaft. The method to accomplish this is described below.

image.png

Controller Design: Angle Deficiency Method

Using the angle deficiency method, design a PD controller for position that has the characterstics listed in the Challenge. You may assume that the summing gain, $K_{sum}$, that is often included in a root-locus based control design, is $1$. This way, if you implement a summing gain in your controller, you'll have the freedom to use it to "walk around" the root locus from your original design goal if needed.

The damping ratio is VERY low. If you cannot achieve a feasible design at $\zeta = 0.1$ you can increase the damping ratio. You should be able to achieve $\zeta < 0.15$

Perform the entire calculation in the code block below. Include in your output

  • A root locus plot
  • On the root locus a symbol at the eigenvalue location proving the root locus passes throught that point
  • Dislay in the code output the gain, $K$, from the root locus plot
  • Calculate and output your controller gains $k_p$, $k_d$, and $k_{sum}$
  • Plot the step response of your closed loop controller system. </font>
In [2]:
% YOUR CODE HERE
error('No Answer Given!')
error: No Answer Given!

Controller Validation: Adding Derivative Control to Arduino Code

You will need to add the derivative of the error to your control law to implement PD control

$ u=k_{sum}(k_p e+k_d \frac{de}{dt})$

Like you did with the integrator, you will need to determine a numerical approximation of the derivative of error that gets updated each time through the void loop() function of your Arduino code. To achieve this you can use the same type of Euler approximation you have been using to calculate the angular velocity of the motor!

You will also need to update the code to reflect your closed loop system now that you are using angular position as an input and output.

  • Update the initial input and step input to reflect that you are asking for a position in radians
  • Update the calculation of system output to reflect it is now angular position in radians

Include in the cell below a copy of your completed Arduino code. Make sure to include the backticks with the c ( ```c ) so the text will be properly color coded

YOUR ANSWER HERE

Controller Validation: PD Control of Motor-Shaft-Load

  • After modifying the arduino code and inputting your calculated gains, run the motor with the rigid shaft and load.
  • Set the position step such that the pwm output signal is ALWAYS LESS THAN 255 counts. If this maximum is reached then the system will have non-linear characteristics that are not included in your model.
  • Record the response to your step input by outputting the position and other relevant paremeters to the serial monitor. By cutting and pasting from the serial monitor or using realterm, save the data to a .txt file.

In the MATLAB cell below, compare the data to the predicted response for the following quantities:

  • Proportional control signal
  • Derivative control signal
  • Total control signal
  • Angular position
In [3]:
% YOUR CODE HERE
error('No Answer Given!')
error: No Answer Given!

In the cell below, summarize the comparison of simulation and data. Considering the behaviors you have seen with this electromechanical system and tried to model, describe any discrepencies and your best understanding of their source OR questions you have about them.

YOUR ANSWER HERE