This example shows how to simulate systems that span electrical and mechanical domains. You learn how to model physical components with Simscape™ blocks, connect them into a realistic model, use Simulink® blocks as well, and then simulate and modify a motor model.
The model is based on a Faulhaber Series 0615 DC-Micromotor. The model uses equivalent circuit parameters for the 1.5V motor to verify manufacturer-quoted no-load speed, no-load current, and stall torque. You can use the model to assess motor performance in a given application by adding the requisite mechanical load model.
|On this page…|
Explore the Model
Main Model Window
The main model window contains a DC Motor subsystem with two electrical and two mechanical rotational ports.
The electrical ports connect to the electrical circuit, which consists of an Electrical Reference block, representing an electrical ground, a 1.5 V DC voltage source, and a current sensor. The current sensor connects, through a PS-Simulink Converter block, to a Simulink scope labeled Motor Current.
On the mechanical side, a Mechanical Rotational Reference block represents a reference point for the other elements. An ideal rotational motion sensor connects, through a PS-Simulink Converter block, to a Simulink scope labeled RPM.
The motor load is represented by an Ideal Torque Source block, which on one side connects to a Mechanical Rotational Reference block, and on the other side to the motor shaft. A regular Simulink Step source provides the control signal. A Simulink-PS Converter block converts the control signal into a physical signal and applies it to the control port of the Ideal Torque Source block.
The diagram also contains a Solver Configuration block, which is required in any Simscape model. It contains parameters relevant to numerical algorithms for Simscape simulations.
Double-click the DC Motor subsystem to open it.
DC Motor Subsystem
The motor consists of an electrical circuit and a mechanical circuit, connected by the Rotational Electromechanical Converter block. The electrical circuit consists of a Rotor Resistance block and an Inductance block L. It contains two electrical ports, corresponding to the V+ and V- electric terminals of the motor. The mechanical circuit contains a Rotational Friction block, Motor Inertia J, and two mechanical rotational ports, C and R, corresponding to the motor case and rotor, respectively. Notice how the C and R ports of the Friction block and the Rotational Electromechanical Converter block are connected to the C and R ports of the motor, to preserve the correct direction of variables in the Physical Network.
Run the Model
Double-click the Motor Current and RPM scopes to open them. During simulation, these windows display the motor current and shaft speed, respectively, as functions of time.
In the toolbar of the model window, click to start the simulation. The Simscape solver evaluates the model, calculates the initial conditions, and runs the simulation. This process might take a few seconds. The message in the bottom-left corner of the model window provides the status.
Examine the simulation results in the Motor Current and RPM scope windows.
For the first 0.1 seconds, the motor has no external load, and the speed builds up to the no-load value. Then at 0.1 seconds, the stall torque is applied as a load to the motor shaft. Zooming in on the RPM and Motor Current scopes shows that the model matches the manufacturer parameters for no-load speed, no-load current, and stall torque.
Change the Supply Voltage
Reduce the supply voltage to 1.25 volts (to simulate the battery running down) and vary the load torque to find the maximum torque at this reduced voltage.
Double-click the 1.5V DC Voltage Source block. Set Constant voltage to 1.25 V.
Run the simulation. Note the effect of reduced voltage on the no-load speed.
Try varying the load torque to find the maximum torque at this reduced voltage. Double-click the Step source block, enter different final values for the input signal, and rerun the simulation.
The next illustration shows the simulation results for Final value set to -0.2e-3, which corresponds to (1.25/1.5)*0.24mNm, as the magnitude of the torque-speed curve is proportional to voltage for a DC motor.
Change the Motor Load
Replace the torque source with a simple mechanical load, for example, a fan, for which the torque is defined by alpha*speed^2, where alpha is -1e-10 Nm/(rad/s)^2.
Delete the Step source and the Simulink-PS Converter block from the model.
In the Simscape block library, open Foundation Library > Physical Signals > Functions.
Drag the PS Product block and the PS Gain block to the model window.
Connect the blocks as shown in the following illustration. To rotate a block, select it and press Ctrl+R.
Double-click the Gain block to open its dialog box. Enter Gain value of -1e-10 and click OK.
Run the simulation and assess motor performance with the new load.