PDA

View Full Version : HB-25s and the wheel kit



shobley
06-03-2009, 12:40 PM
Hi,

I posted this in the parallax forum as well, but I wanted to ask here as there might be someone who understands how all this stuff works...

I just bought a the 6" wheel / encoder kit and 2 HB-25s to control them.

I'm struggling to grasp how all this stuff is hooked up. I want to connect the two controllers and motors in a single pin fashion so I have direction control from 1 line. There don't seem to be enough connectors to hook up the dual motors *and* the rotation encoders all at the same time.

..or maybe I'm just reading the docs wrong.

Is there a resource somewhere that includes all of this? So far I'm bouncing between the two user manuals and scratching my head.

Steve

P.S. Can HB-25s be controlled via RC receivers, or just from a microcontroller?

lnxfergy
06-03-2009, 02:18 PM
I don't think you can connect the encoders to the HB-25.. it's just a motor driver. You need to connect the encoders to a microcontroller and then count pulses and adjust the output to the HB-25 as needed (look up PID control, or closed loop feedback).

It would appear that the HB-25 could be controlled from a RC receiver, since it just uses an RC-style pulse for setting the speed. You would have to put each HB-25 on a different channel though, and you couldn't use the encoders with it without inserting a microcontroller (RC reciever->microcontroller->hb_25)

-Fergs

DresnerRobotics
06-03-2009, 03:14 PM
Fergs said it well. The encoders are intended to connect to a microcontroller via UART, the HB-25 is just a motor controller, and can indeed be controlled by a PWM signal via R/C receiver.

shobley
06-03-2009, 10:20 PM
The instructions for the wheel kit say that the encoder output can be connected to an HB-25 directly. They are labelled "To HB-25" on the silk screen.

It may well be that you can't do both - single line connection, and feedback from the encoders.

The manual talks about the HB-25 reading the signal from the encoder and adjusting power output if the speed is too high or slow - giving smooth control over slopes.

I was hoping to be able to control these wheels from one RC stick - but it looks like it might have to be 2 sticks - like a tank. The Sabertooth does this much better, in retrospect maybe I should have bought one of those instead.

Inxfergy - Funnily enough these wheels are being installed in a K9 replica...

Steve

UPDATE: I just downloaded the latest instructions.

I think this is a case of RT*M. You connect to the *encoder* not the HB-25, then there is a serial command set to operate the wheels. The encoder communicates with the HB-25 and tells it how to spin the motors.

Now I get it...

DresnerRobotics
06-03-2009, 11:41 PM
The instructions for the wheel kit say that the encoder output can be connected to an HB-25 directly. They are labelled "To HB-25" on the silk screen.

It may well be that you can't do both - single line connection, and feedback from the encoders.

The manual talks about the HB-25 reading the signal from the encoder and adjusting power output if the speed is too high or slow - giving smooth control over slopes.

I was hoping to be able to control these wheels from one RC stick - but it looks like it might have to be 2 sticks - like a tank. The Sabertooth does this much better, in retrospect maybe I should have bought one of those instead.

Inxfergy - Funnily enough these wheels are being installed in a K9 replica...

Steve

UPDATE: I just downloaded the latest instructions.

I think this is a case of RT*M. You connect to the *encoder* not the HB-25, then there is a serial command set to operate the wheels. The encoder communicates with the HB-25 and tells it how to spin the motors.

Now I get it...

Funny, because this is how I thought they worked originally, then upon further reading the manual I somehow convinced myself otherwise. Guess I needed to actually read it, rather than skim it :p

lnxfergy
06-04-2009, 12:13 AM
Glad to see that you got it working... I had only looked in the HB-25 manual, not the encoder manual (doh!).


Inxfergy - Funnily enough these wheels are being installed in a K9 replica...

Do post pictures when you get it put together!

-Fergs

shobley
06-17-2009, 08:14 PM
I finally got the wheels and HB-25s hooked up, but I seem to have a problem.

Forwards motion is fine, but any backwards rotation results in the wheels spinning forever. I've been talking to the Parallax tech support but so far they've not been able to find the cause.

I understand that this kind of thing happens when the wrong motor is reversed, or the wiring is wrong to the HB-25, but I've gone over the wiring again and again, and nothing seems to be set up incorrectly.

The only unfortunate thing about the controllers is that RX and TX both occur down the same wire, so I wired a 10K resistor between my TX and RX pins and connected the controllers to the other side of that.

Not sure what to do next, these things were really expensive and I seem to be no better off than when I hooked up two $20 wiper motors and a sabertooth.

Anyone got any insight into getting these things to behave?

Steve

shobley
06-19-2009, 08:04 AM
I found the problem...

I wasn't formatting negative numbers correctly. Once I got that straightened out the wheels move like they should do.

I seem to be developing a reputation for messing up data formats...
:)

Steve

ScuD
06-19-2009, 08:38 AM
Well, lemme help you out there!

+ Rep! (not for the messing up data formats but for stating the answer after having solved it yourself, which a lot of people forget, thus leaving others with the same questions in the cold)

shobley
06-19-2009, 08:54 AM
Thanks - let me explain the solution in more detail then:

The negative number format used by the wheels is two's complement which is described here:

http://en.wikipedia.org/wiki/Twos_complement.

One easy way to flip back and forth between positive and 2's complement negative is to write out all the bits in binary, then invert the bits and add 1. So... if you want -12, start with the binary version of +12:
0x000C = 0000 0000 0000 1100
invert all the bits
1111 1111 1111 0011
then add +1
1111 1111 1111 0100 = 0xFFF4 = -12

Sending 0x20 0xFF 0xF4 will turn both wheels backwards by 12 position units.

...and not by 30,000+ units as I was doing. :wink:

Thanks to Kevin at Parallax for pointing me in the right direction.

I attached some pictures showing the mounting, ID assignment and the wiring to the HB-25s just in case anyone else gets stuck.

jes1510
06-19-2009, 10:08 AM
Yep! The programatic solution would be:

int x = 2;

int inverted = 0;

inverted = (~ x ) + 1;

The tilda (~) does a bitwise inversion. Also note that you can't declare the variable to be an unsigned as that will trip you up as well.

G Nag
03-23-2012, 05:27 PM
Hello,
I am trying to do the exact thing but i got confused by the RC receiver, I do not what is it.
can you please specify which one did you use?
just a check up, the RC receiver was used to connect your PC to the position controller, correct?