HB-25 always max output except 1500 microsec
Fosamax
Posts: 4
Hello,
i try to get a HB-25 motor controller connected with an arduino.
If i write 1500 microseconds the output of the motor controller is 0V like it should be. Writing 1000 microseconds should give -12V and 2000 microseconds should give an output of 12V.
The problem is that the output is -12/12 V even if i write 1525 microseconds.
Does anybody kbow wha the problem could be?
Thank you
#include <Servo.h>
Servo myservo; // create servo object to control a servo
void setup() {
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop() {
myservo.writeMicroseconds(1525); // sets the servo position according to the scaled value
delay(2000); // waits for the servo to get there
myservo.writeMicroseconds(1500);
delay(2000);
}
i try to get a HB-25 motor controller connected with an arduino.
If i write 1500 microseconds the output of the motor controller is 0V like it should be. Writing 1000 microseconds should give -12V and 2000 microseconds should give an output of 12V.
The problem is that the output is -12/12 V even if i write 1525 microseconds.
Does anybody kbow wha the problem could be?
Thank you
#include <Servo.h>
Servo myservo; // create servo object to control a servo
void setup() {
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop() {
myservo.writeMicroseconds(1525); // sets the servo position according to the scaled value
delay(2000); // waits for the servo to get there
myservo.writeMicroseconds(1500);
delay(2000);
}
Comments
Does anybody have a idea why i only get -12 or 0 or 12 V?
Thanks
1) Hook up a known good servo tester ($2 on Ebay) to your HB25s to test them. Doubtful that you have two bad units.
2) Hook up a standard servo or better, a continuous rotation servo to your Arduino output and test your code for smooth operation.
I hooked up a standard servo, an this works. I dont think that both of the HB25s are damaged because the worked fine in other projects.
Connection:
White cable to the arduino digital 9 pin
Black cable is connected with ground. Datasheet says servo ground. What does it mean? Grund of the system? My DC motor has no ground.
The red cabel is not connected,
+ and - are connected the right way and the dc motor too.
Any more ideas?
Could one of you please write where to connect the three wires red/white/black.
Thank you
The signal from the Arduino connects to the pin next to the "W" (white). There also needs to be a ground connection between the Arduino and the "B" pin (black). I don't think the "R" (red) pin is connected to anything internally.
What sort of motor are you using? Do you have a link to it?
If you post your code between code tags, we could take a look at it (I'll even try it on my Arduino and HB-25).
To post code start with [noparse] [/noparse].
This way code written:
[noparse] [/noparse]
Will show up as:
yes the jumper is in place. Single mode. "W" is connected with Pin 9 of the arduino. "B" is connected with the ground of the arduino. "R" is not conected.
For 1525 microseconds the output of the hb25 is 12V and for 1500 it is 0.
I was wondering the same thing.
DMM aren't always good at measuring voltages produced by PWM.
Have you tried running the motor at a low speed setting and a high speed setting?
I'll get my Arduino out of the basement and test the code.
I just tried this with one of my HB-25 controllers and found the output from the HB-25 varied between three extremes. The output was 0V when the servo tester knob was centered and either -12V or +12V on all other positions of the servo tester.
Apparently the HB-25 doesn't make a good voltage regulator. Add a motor and it does fine.
I do not own a HB-25. or an Arduino.
Wrong test. You can't look at voltage alone from a meter. You need to look at duty cycle, and a basic volt meter isn't going to get you here.
The HB25 converts standard pulse duration servo signals to duty cycle PWM. You can verify its operation in either of two ways:
1. With a motor attached, as others have noted.
2. With an oscilloscope, where you can visually see the duration of the PWM signal produced at the output of the HB25.
Your meter is likely registering the 12V or -12V when it gets a duty cycle pulse exceeding some percentage. Most motors won't even turn unless duty cycle is at least 50%, and that is apparently enough to fool your meter into thinking it's getting steady DC at that voltage.
To put this another way, it only *looks* like the HB25 (or any electronic speed controller) is varying the voltage to the motor. It doesn't work this way in real life. The motor is simply getting the full voltage for a longer or shorter period of time.
-Phil