modelRRMotor1
Extends from Modelica.Icons.Example (Icon for runnable examples), Servomechanisms.Examples.RRServomechanism.Data (RR Servomechanism Data).
Information
General
With this example the user can characterize the motor for a selected joint by its transfer function assuming a first order transfer function. With the transfer function obtained a proportional gain is then calculated for a proportional control.
Implementation
The system is interconnected using the SignalDCMotor for one joint and a Position source for the other joint (to maintain it at its initial position).Once simulated, the values of tau (time constant T) and K (gain k) are obtain for the equivalent first order transfer function with the relations:
K = gain of system for steady state/ reference value tau = time to reach ~ 0.63K
Then the proportional gain is calculated for a maximum overshot (O) requirement using the following equation:

Note that O is the overshot value (for example 0.1) not a porcentual overshoot PO (for example 10%).
Notes
- The PID block controller type must be .Modelica.Blocks.Types.SimpleController.P for proportional control.
- At the moment the K and tau values are obtain after simulating and observing speed responce of motor.
- At the moment the kp value should be calculated externally, although it could be implemented using a modelica function
Example
Results:


Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Real | l1 (from Data) | 0.2 | |
| Real | w1 (from Data) | 0.02 | |
| Real | h1 (from Data) | 0.005 | |
| Real | d1 (from Data) | 400 | |
| Real | min1 (from Data) | 0 | |
| Real | max1 (from Data) | pi/2 | |
| Real | l2 (from Data) | 0.1 | |
| Real | w2 (from Data) | 0.02 | |
| Real | h2 (from Data) | 0.005 | |
| Real | d2 (from Data) | 400 | |
| Real | min2 (from Data) | -pi/2 | |
| Real | max2 (from Data) | pi/2 | |
| Real | r (from Data) | 0.03 | |
| Real | xc (from Data) | 0.25 | |
| Real | yc (from Data) | 0.075 | |
| Real | ratio1 (from Data) | 10 | |
| Real | ratio2 (from Data) | 5 | |
| Real | period (from Data) | 8 | |
| Real | R (from Data) | 0.101 | |
| Real | L (from Data) | 0.0000266 | |
| Real | k (from Data) | 0.0115 | |
| Real | J (from Data) | 0.0000119 | |
| Real | Voltage (from Data) | 12 | |
| Real | kp2 (from Data) | 4.423 | |
| Real | kp1 (from Data) | 7.1543 |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Blocks.Sources.Step | step1 | ||
| Servomechanisms.Electrical.SignalDCMotor | signaldcmotor2 | ||
| Modelica.Mechanics.Rotational.Components.IdealGear | idealgear2 | ||
| Modelica.Mechanics.Rotational.Sources.Position | position1 | ||
| Modelica.Blocks.Sources.Step | step2 | ||
| Modelica.Blocks.Continuous.FirstOrder | firstorder1 | ||
| Servomechanisms.Mechanism.RR | rr1 | ||
| Modelica.Mechanics.Rotational.Sensors.SpeedSensor | speedsensor1 | ||
| Modelica.Blocks.Continuous.FirstOrder | firstorder2 | ||
| Modelica.Blocks.Continuous.Integrator | integrator1 | ||
| Modelica.Blocks.Sources.Step | step3 | ||
| Modelica.Blocks.Continuous.LimPID | PID |