• DC Motor Speed PI Control Exercise | ACE-Lab

    DC Motor Speed PI Control

    This exercise demonstrates discrete-time PI control for DC motor speed regulation using Arduino, Simulink, and encoder feedback. The controller regulates the motor to a 30 RPM reference, with performance assessed using settling time, overshoot, steady-state error, and disturbance rejection when a load is applied.

    Introduction video for the DC Motor Speed PI Control exercise.

    1. Learning Outcomes

    After completing this exercise, learners should be able to configure the motor hardware, explain PI speed control, implement the controller in Simulink, and evaluate the closed-loop response.

    Configure the DC motor control circuit

    Use an Arduino Uno, Maker Drive motor driver, external power supply, and encoder feedback to prepare the speed control hardware.

    Explain PI speed regulation

    Describe how a proportional-integral controller can regulate DC motor speed against a target reference.

    Implement a discrete-time PI controller

    Configure gain values, sample time, integral implementation method, and explain why PI control is suitable for speed regulation.

    Evaluate speed-control performance

    Assess settling time, overshoot, steady-state error, and load disturbance rejection.

    2. Hardware Set-Up

    This exercise builds on the encoder speed-measurement hardware. The arrangement is repeated here because the PI controller uses measured encoder speed as feedback for closed-loop motor speed control.

    Required hardware:

    • Arduino Uno
    • Maker Drive motor driver board
    • DC motor with encoder feedback
    • 9V battery and clip
    • Breadboard
    • Breadboard wires, various
    • USB cable

    Set-up guidance

    Connect the motor to the Maker Drive output terminals and connect the 9V battery to the motor power input. Add the Arduino control wires to the Maker Drive input pins so that the Arduino can set motor direction and apply PWM for speed control. Keep the Arduino and Maker Drive connected to a shared ground reference.

    Figure 1: Hardware set-up for DC Motor Speed Measurement using Encoder, reused for the PI control exercise.
    Figure 1: Hardware set-up for DC Motor Speed Measurement using Encoder, reused for the PI control exercise.
    1

    Connect the DC motor wires to the Maker Drive motor output terminals. Use one motor channel, such as M1A and M1B.

    2

    Connect the 9V battery positive wire to the Maker Drive motor power input, usually labelled VIN, VM, or +.

    3

    Connect the 9V battery negative wire to the Maker Drive GND terminal.

    4

    Connect a GND pin on the Arduino to the Maker Drive GND so both boards share the same reference voltage.

    5

    Connect the Arduino 5V pin to the Maker Drive logic supply pin if required by the board.

    6

    Use the breadboard to organise shared 5V and GND connections if needed.

    7

    Connect the Arduino control pins to the Maker Drive input pins for direction and speed control.

    8

    Connect the Maker Drive motor input pins for the selected motor channel to suitable Arduino digital or PWM pins.

    9

    Check that the motor is connected only to the Maker Drive output terminals and not directly to the Arduino.

    10

    Connect the Arduino to the computer using the USB cable.

    4. Performance Evaluation

    The initial control requirements are used to judge whether the motor speed response meets the expected closed-loop behaviour.

    Requirement 1: settling time of less than 2 seconds.
    Requirement 2: no overshoot.
    Requirement 3: zero steady-state error.
    Figure 4: PI Control Algorithm Design Outputs.
    Figure 4: PI Control Algorithm Design Outputs.

    Ramp improvement

    A ramp could be applied initially to prevent the maximum control output from being applied immediately. Matching the ramp duration to the initial low-pass filter delay, just under 2 seconds, would reduce the initial power surge.

    Load disturbance test

    A load is applied to the DC motor for a period to test disturbance rejection. Visual inspection shows that the PI controller maintains the 30 RPM reference well, with only a slight drop in speed while the load is applied.

    Figure 5: PID Control Algorithm Design Reference and Measured Output when a load is applied to the DC motor.
    Figure 5: PID Control Algorithm Design Reference and Measured Output when a load is applied to the DC motor.
    Testing video for the DC Motor Speed PI Control exercise.

    5. Concluding Remarks

    This exercise demonstrated the implementation of a PI controller for DC motor speed control using Arduino, Simulink, and encoder feedback. The controller was configured to regulate the motor speed to a reference value of 30 RPM while meeting the required performance criteria, including no overshoot and zero steady-state error.

    The effect of applying a load to the motor was also examined, showing how feedback control helps maintain the desired speed under disturbance conditions.