Servo Drive with Optimum Braking
Overview
This demonstration illustrates a servo drive application, combining the PLECS electrical, control and mechanical domains. The system includes an inverter with field-oriented control that supplies a servomotor coupled to a ball screw gear. The output of the gear is attached to a slide, which holds the part that is being position-controlled for manufacturing (e.g. milling) operations.
Power circuit
The inverter circuit is modeled as an ideal three-legged bridge with stiff DC supply. Space vector pulse-width modulation (SVPWM) is used to control the output voltage of the inverter. The three phase currents are being measured for closed-loop control.
Mechanical
The actuator consists of a synchronous machine with surface-mounted magnets (PMSM). Its output is coupled by means of a compliant shaft to the ball screw gear. The coupling between those two elements is modeled by an inertia and backlash component. The gear translates the rotational motion to a linear motion, which then moves a part along a slide. At the end of the slide is a hard stop with which the part will collide if not properly controlled.
Control
An advanced high-bandwidth state-space control is implemented for the positioning of the slide. The controller is realized in a per-unit (pu) system and regulates both slide position and motor speed using internal state limiters and anti-windup mechanisms. Two choices are provided for limiting the motor speed: i) a fixed limit set to 1 pu and ii) an optimum limit that is dynamically adjusted based on actual deviation from the target position. For large setpoint changes use of optimum speed limiting is necessary to avoid limit cycles.
The output of the state-space controller consists of a torque setpoint for the electric machine. It is translated into an equivalent quadrature current setpoint (iq*) that is controlled by a digital synchronous frame regulator. This regulator is numerically decoupled based on motor speed and also includes state-limiting and anti-windup mechanisms.
Simulation
We recommend that this model be explored by following these steps:
Begin with the “Fixed Speed Limit” (double-click on “State-Space Controller” block and select from drop-down list) and configure the position-step (“Pos*” block) to a small value, for example one millimeter (0.001).

Observe how the part reaches the target position in a nicely damped fashion with a very small amount of overshoot. Notice how the motor torque is being limited to a maximum of 6 Nm (1 pu) at the beginning of the acceleration and deceleration phases.
Now use the “zoom” features of the scope to examine the waveforms more closely after the setpoint has been reached. You will notice the drive never comes to a complete stop. Instead it exhibits a sustained oscillation around the setpoint. This “hunting” is caused by the backlash of the ball screw gear. Reduce the value of P.bl in the initialization script and observe how the oscillation can be reduced and, ultimately, eliminated.
At this point, increase the position step to 5 cm (0.05) and re-run the simulation, making sure you capture at least 1.2 seconds of simulation time.

As can be seen from the simulation run, the position control is very poor. There is a large initial overshoot resulting in the slide hitting the hard stop followed by a second large oscillation until the setpoint is reached. This phenomenon is a limit cycle caused by the electric machine not having sufficient torque to slow the slide before it is already far past its setpoint. As a consequence, the torque setpoint varies in a square-wave fashion between full throttle acceleration and deceleration.
To eliminate this behavior the Optimum Speed Limit must be enabled (double-click on “State-Space Controller” block and select from drop-down list).

Rerunning the simulation demonstrates the effectiveness of such an advanced speed-limiting algorithm. The position setpoint is now reached with a minimal amount of overshoot, settling in the shortest possible amount of time.
References
H. Bühler, Réglage de systèmes d’électronique de puissance, vol 1: Théorie, Presses Polytechniques et universitaires romandes, Lausanne, 1997.
H. Bühler, Réglage de systèmes d’électronique de puissance, vol 2: Entraînements réglés, Presses Polytechniques et universitaires romandes, Lausanne, 1997.