Parallax HB25 with VEX
I have posted this on the VEX forums but I want to know if anyone is familiar with coding and getting the HB25 motor controller to work with the VEX system. If you have gotten the controller to control the motor controller please explain to me what changes in the code you had to make.
Comments
So you don't need the HB25, you can send a signal to the VEX motor directly.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
This required very little work on my part, it worked pretty well "out of the box."· I bought some servo extension cables and cut off the hood on one of the connectors to reveal the male pins that plug into the VEX.· If you do it this way it won't have the key on it so you have to make sure you don't reverse the cable when you plug it in.· The female end plugs into the HB-25's without any trouble.·
The only problem I've had is that for some reason the system seems to stall occasionally.· I haven't figured out if that is because of an electrical problem or a programming problem.· Both motors seem to do it simultaneously, indicating that it's probably a programming error, but it seems to do it less when the system's been running a while and the batteries are presumably drained down a bit.· Possibly indicating an electrical problem.· I used a separate ground for the logic and the power going into the HB-25.· Since the HB-25 doesn't have VCC on the logic circuit I'd assume that a floating ground could cause problems like this.· Perhaps someone can tell me what the best practice is for logic ground / power ground.· I'd prefer to keep my 7.2v logic power separate from my high power 12v system.· I figure that keeps me from accidentally putting 12v into my VEX controller.· However I'm not sure how the HB-25 is going to handle that.·
Andy
What is most likely happening is that randomly a pulse width is being sent outside the range of 1 mS to 2 mS which will cause the motors to shut down until the next valid pulse. To prevent this try not to run the pulse widths at maximum ranges. I seem to recall the VEX stuff wasn’t quite as accurate with servo pulses as typical systems so this is highly likely. I hope this helps. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
The pause is longer than 20ms.· So I don't think it's a case of one bad instruction where the next one makes it go.· The robot has time to come to a complete stop.· I'd guess·the stall is·in the one to two second range.· It also always happens on both HB25's at the same time.· It only happens a couple of times over the course of an hour so I have not been able to identify if the problem is the output from the·VEX or the behavior of the HB-25.· Overall I've been very happy with the performance and ease of use of the HB-25 with the VEX system.·
I mentioned my theories about grounding earlier.· I have been able to simulate a very similar problem by using an underpowered power supply.· When I started to draw too much power and the voltage started to drop the motor connected to the HB-25 would stop and start up again a little bit later.· I'm guessing that the HB-25 reboots if the incoming voltage drops below 6 volts.· I'm fairly certain that's not what's happening now, but the length of time is stops fairly similar.· I'm wondering if the HB-25 is rebooting because of a power spike of some sort or maybe a bad signal.
Andy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
the servos are very similar internally to regular servos, (internal POT, PWM to +/- motor rotation circuit.) while the motor
modules are dedicated single-chip circuitry, no POT.) Also, the motor module output gear doesn't have the stop tab, and a insert
under same gear, that connects to the wiper of the POT.
Even though you tell the VEX controller 0-128-255 control, I found the frequency much broader.. (255 actually puts closer to
1Khz out to the module. and I think the lower end (0), was closer to 100Hz.
The output from the VEX controller is still a standard +7.5V, gnd, and pulse train. (Constant, despite passing the signal in start/stop
pulses, like the code for the BOE-BOT, but need to repeat to continue the movement, the VEX controller remains
constant on the output, till changed.)
the motor and servo modules react as regular and constant rotation servos, separate from the controller. (having cross-matched parts, driving a VEX motor off a BOE, Parallax servo and Constant rotation servos off the VEX controller, though the Parallax
servo and CR servos reacted at different frequencies.. I.E. 500Hz pulse being the midpoint being the center/zero rotation value.
(using user-defined value output under Easy-C 1.0)
I need to dust-off my VEX robot, and begin rebuilding.. I still need to finish the project I started a year ago.. A VEX frame, and controller, using code from Basic Stamp - GPS matching. (hard part, is assembling the VEX code, in one solid routine, instead of
subroutines. (Gosub is a No-No))