Spinning DC motors with current control using real-time embedded software Altair Embed® and STMicro
Spinning DC motors with current control using real-time embedded software Altair Embed® and STMicro
Prof. Dr. Ir. Duco W. J. Pulle
Chief electrical drive consultant for Altair
Introduction
DC motors, of the type shown below, use permanent magnets to generate the flux as shown by a vector. The armature makes use of a brush/commutator discussed in our book, Advanced Electrical Drives, to generate a stationary current distribution shown as a current vector that is orthogonal to the flux vector. The torque, in this case, is simply the product of flux and current; hence current control is required to achieve torque control.
The electrical drive shown below is normally used for three-phase machines, but in this case configured for a DC machine. The converter consists of three half-bridges, of which two are used to form an H-bridge used to control the armature current. The controller module generates the modulation index references for the PWM drives that control the two half-bridges. The inputs to this module are the reference and measured armature current. Both are used by a model-based current controller algorithm executed by the processor. A DC adapter module generates the measured armature current and armature voltage from the half-bridge converter. The latter also makes use of low-pass filters that remove the PWM component from the converter voltages .
DC drive
Application example
A practical embodiment of the DC drive is shown below for the ST-Micro application and consists of a brushed DC motor and a STEVAL-ESC001V1 11-22V/30A electronic speed controller. This controller is a controller designed for three-phase machines; however, in this case the controller algorithm is configured for DC motor control using two of the three converter outputs as shown below. Real-time embedded control from Embed is used to fully control the electrical drive.
ST-Micro ESC001v1 controller with DC motor attached
The motor parameters are: , which together with the 10kHz control sampling frequency define the gain and bandwidth of the current controller (see our book Applied Control of Electrical Drives).
Shown below is the Embed debug diagram that makes use of the compiled OUT file generated by a compile file as discussed in the video. The current reference is set to 2A and the linear servo motor is at its mechanical limit, which implies that the DC rotor is locked. The current controller sets the armature voltage accordingly and, in this case, it matches the voltage drop across the armature resistance. The two traces shown in the ‘DC drive:Run file’ are the LPF half-bridge voltages (scale 0.1 =4.8V) . The difference between these two voltages is the armature voltage is also displayed together with the measured current, DC bus voltage, and controller temperature.
The “CPU time” is the percentage of the sample time used by the processor to run the OUT file.
Embed debug diagram: DC drive RUN file
The experimental DC drive setup shown below shows the STEVAL-ESC001V1 module, which is connected to the ST-link that interfaces to the laptop that runs the Embed diagram shown above.
A current probe is used to show the measured armature current on the scope. The drive is operating precisely under the same conditions shown in the debug diagram. A voltage probe is connected to one of the half-bridge outputs and shows the 40kHz PWM signal. If the current is zero the duty cycle of said signal would be 50%, which corresponds to an average voltage of 6V. In this case the controller operates with a 2A current and the armature voltage is 3.23V, which implies that each half of the H-bridge provides average voltages of 6+3.23/2V, 6-3.23/2 V respectively. This average voltage difference is reflected by the difference in duty cycles of the half-bridges.
The Embed files required to build your own drive, based on this presentation are DC motor control Embed files-ST-F303RE, which included in the attachments below. Hence these can be adapted to your own DC machine.
Experimental DC drive setup
Learn more about Embed through the comprehensive help guide: Embed Help
About the author
Prof. Dr. Ir. Duco W. J. Pulle
Forty years of experience in electrical drives, including 25 as a professor at various European Universities, including RWTH-ISEA, Germany, the world leader in electrical drives. Author/co-author of three books and numerous conference/journal papers.
Over the past 15 years, I have been working as a consultant in the field of sensorless electrical drives with a wide range of machine types and power.
My vision and passion are to promote the use of real-time embedded control for electrical drive applications using Altair Embed. For this reason, a wide range of application examples have been developed that covers all machine types and control algorithms.
Educational background: Aviation College, B.Sc., M.Sc., Ph.D., flight engineer, and aviator.