1
\$\begingroup\$

I am making a project to control speed and position of multiple 3 Phase BLDC Motors using a Raspberry Pi 5. I am struggling with the number of PWM channels I will need and the lack thereof on the Pi itself. Through a lot of research, it sounds like PWM directly off the Pi is a bad idea anyways. I understand that the Pi is not the best MCU for this application, but it is what I have and what I want to try to make work. I have an IC that will control the IGBT's and the IC needs 6 PWM channels. This means I need 6 PWM channels per motor and I am starting with 2 motors. I picked the IC and all subsequent components already and have them in hand, they were picked with the foresight to control higher powered motors in the future.

I am planning on using a harmonic drive reducer to increase torque at the sacrifice of speed, which super high speed isn't that critical to me anyways.

All of this is to say, any recommendations on how to get the 6 PWM channels needed per motor out of the RPi5? Even if it means adding another IC between the RPi5 and the DGD2136M, I don't mind. The only ideas I had were this Adafruit PWM board, 16-Channel 12-bit PWM/Servo Driver - I2C interface - PCA9685:

It seems to greatly reduce PWM frequency though, which cuts speed control by alot. Also seems to be more geared towards LED control or Servo motor control.

All help is greatly appreciated.

\$\endgroup\$
3
  • 2
    \$\begingroup\$ How married are you to the idea of rolling your own controller? I.e. why not use a COTS motor controller and have the RPi talk to it through a more richly-featured data bus instead of bit-banging at the transistor level? If you are doing this for experience, that's fine but if you just need something to work, there are existing solutions. \$\endgroup\$ Commented Oct 23 at 17:59
  • \$\begingroup\$ Yes, this is for my own experience and learning. I am doing a project for school that had open ended parameters and I may have gone a bit ambitious going this technical with it. Parameters basically just said to make something with a microcontroller using Python programming language. I've done simpler projects with sensors and LEDs, but I wanted to challenge myself with a bit more circuit design as well as delve into motor control, hence where I have gotten myself into a bit of a pickle here not looking into the integration between the RPi and the IC, I regrettably only designed past the IC. \$\endgroup\$ Commented Oct 23 at 18:12
  • 2
    \$\begingroup\$ The Pi5 is a microprocessor not a microcontroller. Use a microcontroller for the motor control. \$\endgroup\$ Commented Oct 23 at 18:22

1 Answer 1

1
\$\begingroup\$

Driving a 3-phase BLDC with a Raspberry Pi 5 isn’t ideal because each motor needs 6 precise PWM signals, and the Pi can’t generate stable, high-frequency, synchronized PWM for power stages. So, don’t let the Raspberry generate the motor PWMs; instead, let a dedicated controller handle it, and keep the Pi as the “high-level brain” that sends speed/position commands.

Add a microcontroller with hardware motor-control PWM, for example: Arduino Due, STM32, ESP32, or one MCU per motor. The Raspberry Pi can send commands via UART/SPI/I2C, avoiding timing issues.

Use a dedicated BLDC driver with built-in PWM/FOC. A motor-control IC (e.g., TMC, TI DRV, Allegro A4960) handles commutation. The Pi only sets speed and direction.

Avoid the PCA9685, it’s great for servos/LEDs, not BLDC: low PWM frequency and no tight phase timing.

For 2 motors, you need 12 accurate PWMs, so a split architecture is the cleanest path: Raspberry Pi is the brain, MCU is for the real-time control.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.