Hello everyone,
I’m currently working on a project using an Arduino to control a BLDC motor with a Chinese motor controller similar to the BLC-302 or BLC-91. I’m facing an issue where the motor runs, but I cannot control its speed. I’ve tried several approaches, but nothing seems to work.
Here are the details:
- Hardware:
- Arduino board: Arduino Uno
- Motor controller: I'm using a Chinese in-wheel BLDC motor controller similar to the BLC-91 or BLC-302.
- Motor: BLDC MOTOR
- Connections:
- Left motor pin connected to Arduino pin 10
- Right motor pin connected to Arduino pin 11
- Power supply: The motor's main power and controller power are controlled at 24V and the throttle signal is controlled at 5V.
Code:
#include <TimerOne.h>
#define LEFT_MOTOR_PIN 10
#define RIGHT_MOTOR_PIN 11
void setup() {
Timer1.initialize(250); // 4kHz frequency
Timer1.pwm(LEFT_MOTOR_PIN, 0); // initial value 0
Timer1.pwm(RIGHT_MOTOR_PIN, 0); // initial value 0
Serial.begin(9600);
}
void loop() {
for (int speed = 0; speed <= 255; speed += 5) {
Timer1.pwm(LEFT_MOTOR_PIN, speed);
Timer1.pwm(RIGHT_MOTOR_PIN, speed);
Serial.print("Motor Speed: ");
Serial.println(speed);
delay(500);
}
delay(1000);
}
What I have tried:
- I have tested different PWM frequencies (1kHz, 4kHz).
- Verified the PWM signal with a multimeter.
- Increased the motor speed values (50, 120, 255).
- Checked all connections and power supply.
Problem:
Despite trying the above methods, the motor speed does not change. It always runs at the same speed regardless of the PWM value.
Questions:
- Is there something I might be missing in the setup?
- Are there specific settings required for the BLC-91 controller?
- Any suggestions on how to troubleshoot this issue?
Thank you in advance for your help
I'm a Korean student who is not good at English, so I wrote the question with the help of CHAT GPT and translator. Sorry if it's inconvenient.