Sunday, April 15, 2012

Modelling Actuator Dynamics

In order to determine gains for the control that will work with the real plant, we will need to take into account some of the actuator dynamics. Unlike in mathematical models, these motors are real, tangible electronics with real world limitations. If we don't take into account the dynamics, the control may not function appropriately, and the robot will not balance.

There are many different dynamics that could be considered to completely model the actuators, in this case, the motors. Internal electronics dynamics, backlash from the transmission, quantization error, and drift all could be included, but for this study, the most restrictive is the motors' maximum velocity and maximum acceleration. If the actuator model includes the saturation effect of these maximums when we use our evolutionary algorithm, the control of the balance will be much more efficient.

Motor Test Model


This past week I was able to put together a simulink model that sampled and recorded the characteristics of one of the motors. Here is that model.

The motor test model, colored for sample rate

This model is colored by sample time. The black is continuous, and the red is 0.01 seconds. Yellow is not applicable. The model is run for 10 seconds.

The current time of the simulation coming from the Clock block is a signal to the If block. The If Action blocks are configured such that the output of the Merge block will be either full forward (100), full reverse (-100) or stopped (0). The If block is configured to snap the motor on port A to full speed in the forward and reverse direction for two seconds each, twice.

At the same time, the signal from the Encoder block for the same motor is read. This block reports the total angle in degrees. Running this signal through a Difference block and a Gain block adjusting for the sample time provides the angular velocity. Doing the same once more provides the angular velocity. These three signals are routed to a Mux block and a To Workspace block to save the information in a workspace variable, "data".

Motor Test Simulation Data


Simulating the model generates the following data points.

The motor test model's simulated data points

In this plot, the rotation (blue), angular velocity (green), and angular acceleration (red) are plotted against time in seconds. Interesting points are labeled with tool tips. The position curve appears smooth as it ramps up and down through the two cycles, but the velocity and acceleration curves amplify the inherent noise. Disregarding filtering, the sampled maximum angular velocity is 900 degrees per second and the sampled maximum angular acceleration 200 degrees per second squared.

No comments: