How to Control a BLDC Motor with RS485, I/O, and PWM Duty Cycle?

PWM duty cycle, RS485 communication, and I/O switching work together to control a brushless DC (BLDC) motor's speed, direction, and operating state.

This tutorial demonstrates how to set up the system using an external PWM signal generator, a rocker switch, and a PC connected through RS485. Unlike the PWM frequency control method covered in our previous tutorial, this setup uses the PWM duty cycle to adjust motor speed.

For a practical demonstration of the wiring, software configuration, and motor operation, watch the video: BLDC Motor Control via PWM Duty Cycle + RS485 + I/O Switch Setup.

Components Required

Prepare the following components before starting:

Make sure the BLDC motor, controller, and power supply are compatible. The terminal assignments, parameter numbers, and settings described below apply to the controller used in the video.

BLDC components for PWM duty cycle control

How Does This BLDC Motor Control System Work?

This setup combines three control methods, each with a specific function:

  • PWM duty cycle: Controls motor speed through an external PWM signal generator.
  • I/O switching: Uses a rocker switch to enable or stop the motor and select its rotation direction.
  • RS485 communication: Connects the controller to a PC for parameter configuration and monitoring.

With this arrangement, you can adjust speed by changing the PWM duty cycle, control the motor's operating state through the rocker switch, and access controller parameters through the software.

BLDC motor component block diagram

Step 1: Connect the Power Supply and BLDC Motor

Connect the 24V DC power supply to the controller's power input terminals.

Next, connect the motor's three-phase wires to the controller terminals marked U, V, and W. If the motor uses Hall sensors, connect the Hall sensor wires to the designated terminals according to the controller's wiring diagram.

Disconnect the power supply before making or changing wiring connections. Check the connections before powering up the system.

Step 2: Connect the PWM Signal Generator

The PWM signal generator provides the speed command for the brushless DC motor.

  1. Connect the signal generator's power terminals, V+ and V−, to a suitable DC supply as shown in the video.
  2. Connect PWM+ to the controller's PWM input (terminal 21 in the video).
  3. Connect PWM− to the controller's GND terminal (terminal 22 in the video).

The terminal numbers shown above apply to the controller used in the demonstration. Check your motor controller's wiring diagram and the signal generator's output specifications before making connections.

In this configuration, the motor controller uses PWM duty cycle, rather than PWM frequency, as the motor speed command.

Step 3: Wire the Rocker Switch for I/O Control

Connect the rocker switch to the motor controller's X1, X2, and COM terminals as shown in the video.

For the controller used in this tutorial:

  • X1: Motor enable control
  • X2: Forward/reverse direction control
  • COM: Common terminal for the I/O control signals

The rocker switch connects COM to the corresponding input to issue an enable or direction command. The exact switch connections and input logic depend on the motor controller model, so refer to its wiring diagram before connecting the switch.

Step 4: Connect the Controller to the PC through RS485

Use a USB-to-RS485 converter to connect the BLDC motor driver to the PC.

Connect the converter's T/R+ and T/R− terminals to the corresponding RS485 communication terminals on the controller. Follow the wiring diagrams for both devices to verify signal polarity, as A/B labeling may vary between manufacturers. Then connect the converter to the PC's USB port.

Once communication is established, you can use the BLDC control software to configure controller parameters and monitor operating information.

Step 5: Set the RV Potentiometer and DIP Switches

Before configuring the system, turn the built-in RV potentiometer fully counterclockwise (CCW). Set DIP switches SW1 and SW2 to OFF, following the configuration shown in the demonstration.

These settings apply to the controller used in the video. Check the user manual for your specific controller before changing the RV potentiometer or DIP switch positions.

Step 6: Configure the BLDC Controller Parameters

Power up the system and open the BLDC control software on your PC.

Go to COM Setting, select the COM port assigned to the USB-to-RS485 converter, and click Connect. Once communication is established, open Parameter Settings.

Configure the following parameters for the controller used in the video.

Parameter Setting Function
PN14 4 Selects PWM duty cycle as the speed input source
PN15 1 Selects I/O switching as the control source
PN30 0 Assigns X1 to motor enable control
PN31 1 Assigns X2 to forward/reverse control
PN32 2 (optional) Configures X3 for brake control
PN33 3 (optional) Configures X4 for error clearing/reset

Enter the required values and write them to the controller using the software.

According to the video, PN14 and PN15 require a controller reboot to take effect, while PN30 through PN33 take effect immediately under this configuration. After writing the parameters, reboot the motor controller to apply PN14 and PN15 before testing the motor.

The X3 and X4 functions are optional. Configure them only if your application requires these additional control functions and the corresponding inputs are wired correctly.

Step 7: Test PWM Duty Cycle Speed Control

After checking the wiring and parameter settings, test the motor's operation.

Enable the motor

Move the rocker switch to position I to enable the electric motor. Activate the PWM output on the signal generator by pressing its knob, as demonstrated in the video. In the demonstration, the motor starts rotating clockwise with the PWM duty cycle set to approximately 70%.

Adjust the motor speed

Turn the signal generator's knob to change the PWM duty cycle. The motor controller uses the duty cycle as the speed command, allowing you to adjust motor speed without changing the PWM frequency. The motor controller used in the video supports PWM duty cycles from 0% to 100% at frequencies between 100 Hz and 1000 Hz. Keep the input signal within this range. Motor enable and stop commands are handled separately through the I/O inputs in this setup.

At 100% duty cycle, the speed command corresponds to the maximum speed configured in PN02. In the demonstration, PN02 is set to 3000 rpm. The actual motor speed depends on the controller configuration and operating conditions.

Monitor the motor speed

Open the System Information tab in the control software to monitor the following parameters:

  • Pn136: PWM input information
  • Pn137: Motor speed information

These monitoring parameters are specific to the motor driver used in the video. Refer to its parameter table for the exact definitions and units.

Stop the motor and reverse its direction

Move the rocker switch to position 0 to stop the motor. In the demonstration, moving the switch to position II commands reverse rotation, while the PWM duty cycle continues to control the speed.

Follow the motor controller's instructions for direction changes, particularly when the motor is already running. Some controllers may require the motor to stop before the direction command is changed.

Controlling BLDC motor using PWM duty cycle

Conclusion

Combining PWM duty cycle control, RS485 communication, and I/O switching allows you to adjust BLDC motor speed, command direction changes, and configure the controller through a PC.

The main difference between PWM duty cycle control and PWM frequency control is which PWM signal characteristic the controller uses as the speed command. For the frequency-based method, see our guide to controlling a BLDC motor using PWM frequency, RS485, and I/O switching.

Before implementing the setup, verify the wiring, supported PWM signal range, and parameter settings in the user manual for your controller model.

Leave your comment
*
Only registered users can leave comments.