Hello, I am trying to control a brushed 750w motor. I have a OSMC (Open Source Motor Controller) controlled by PWM on the Arduino. I've hooked everything up and at first it seemed to work. However when I start from 0 power and jump it up high (say 100/255) the motor starts to move then makes a grinding noise then stops. Also when slowly raise the power (0..1..2..) it makes it farther, but then at about 160 it makes the grinding noise then stops, even if I then lower the power back down (to say 50) the motor still will not move until I reset the Arduino. I've been fooling with it for days but cannot figure out why? ![]()
Does anyone have any idea why it would do it?
Here's some code:
int motor1_BHI = 12;
int motor1_DIS = 11;
int motor1_BLI = 10;
int motor1_ALI = 9;
int motor1_AHI = 8;
int PWM_1 = 100;
void setup() {
TCCR1B = TCCR1B & 0b11111000 | 0x01; // set PWM frequency on pins 9 & 10 to 32kHz
Serial.begin(9600);
pinMode(motor1_ALI, OUTPUT);
pinMode(motor1_AHI, OUTPUT);
pinMode(motor1_BLI, OUTPUT);
pinMode(motor1_BHI, OUTPUT);
pinMode(motor1_DIS, OUTPUT);
}
void loop() {
digitalWrite(motor1_DIS, LOW);
digitalWrite(motor1_AHI, HIGH);
digitalWrite(motor1_ALI, LOW);
digitalWrite(motor1_BHI, HIGH);
analogWrite(motor1_BLI, PWM_1);
Serial.print("PWM value: ");
Serial.print(PWM_1);
Serial.println(" ");
}
Thanks!
Tyler