Hello -
Am trying to use a Parallax HB-25 Motor Controller. it is being used in this project - http://www.vishtauroborg.blogspot.com/
(i should add that i'm not being paid for this work, i'm the sound designer in the project and the robotics work turned into a collaboration, now i'm learning how to program on the fly)
Here is it's documentation -
http://www.parallax.com/Portals/0/Downloads/docs/prod/motors/HB-25MotorController-V1.2.pdf
i've got it moving, the problem is it is inconsistent in how far it turns, and doesn't respond to certain pulse patterns.
for example - it needs a pulse of 1.0 ms to go foward, 1.5ms to stop, and 2.0ms to go in reverse.
The problem is, when i give it code like this -
void loop()
{ digitalWrite(PulsePort, HIGH);
delay(0.5); // forward, for some reason it responds to 0.5 better than 1.0)
digitalWrite(PulsePort, LOW);
delay(200);
digitalWrite(PulsePort, HIGH);
delay(1.5); // STOP
digitalWrite(PulsePort, LOW);
delay(20);
digitalWrite(PulsePort, HIGH);
delay(2.0); // reverse
digitalWrite(PulsePort, LOW);
delay(200);
digitalWrite(PulsePort, HIGH);
delay(1.5); // STOP
digitalWrite(PulsePort, LOW);
delay(20);
}
it just goes one direction.
Then, if i take out that last stop command, like this -
void loop()
{ digitalWrite(PulsePort, HIGH);
delay(0.5); // forward, for some reason it responds to 0.5 better than 1.0)
digitalWrite(PulsePort, LOW);
delay(200);
digitalWrite(PulsePort, HIGH);
delay(1.5); // STOP
digitalWrite(PulsePort, LOW);
delay(20);
digitalWrite(PulsePort, HIGH);
delay(2.0); // reverse
digitalWrite(PulsePort, LOW);
delay(200);
}
it does go back and forth between directions, but goes one way a little bit longer than the other, so it ends up rotating all the
way around eventually (which can't happen, it would rip out my air tubes).
there are a bunch of other weird things happening too, like when i change the delay at the end of the stop command to 200, it just goes one direction.
am i missing something here? has anyone used this controller before? can i take a glimpse at your code?
here is my FULL code -
#define PulsePort 18
void setup() {
pinMode(PulsePort, OUTPUT);
}
void loop()
{ digitalWrite(PulsePort, HIGH);
delay(0.5);
digitalWrite(PulsePort, LOW);
delay(200);
digitalWrite(PulsePort, HIGH);
delay(1.5);
digitalWrite(PulsePort, LOW);
delay(20);
digitalWrite(PulsePort, HIGH);
delay(2);
digitalWrite(PulsePort, LOW);
delay(200);
}