Spinning DC motors with current control using real-time embedded software Altair Embed®

Mayank_21559
Mayank_21559 New Altair Community Member
edited December 2021 in Altair HyperWorks

Spinning DC motors with current control using real-time embedded software Altair Embed®

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.

image

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 image 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‌ image.

image
DC drive


Application example 1

A practical embodiment of the DC drive mentioned above is shown below and consists of a DC servo unit and a Texas Instruments F28069M Launchpad with a DRV 8301, 6-24V/10A boosterpack. Real-time embedded control from Embed is used to fully control the electrical drive.

image
DC servo drive setup

 You can review the video DC motor control to learn more about this drive application. The Embed files required to build your own drive, based on this presentation are DC motor control Embed files - F28069M, which are also attached below. Hence these can be adapted to your own DC machine.


Application example 2

A practical embodiment of the DC drive mentioned above is shown below for the ST-Micro application and consists of a brushed DC motor (as discussed in the previous example) 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.

 image
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 image used by the processor to run the OUT file.

image
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.

 image
Experimental DC drive setup



About the author


 image             image
   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.

Tagged:

Comments

  • Ric_22025
    Ric_22025
    Altair Employee
    edited February 2021

    Nice Job

     

  • Nyam Jargalsaikhan
    Nyam Jargalsaikhan New Altair Community Member
    edited December 2022

    @Mayank 

    Thank you for sharing this wonderful work with us. 

    I am new to this kind of system. In this work, STM32DSP.DLL file is required. But I do not know what to do about it. 

    Could you please share this DLL file or tell me what to do on this matter?