Propeller Chip and Motor Mount and Wheel Kit w/ HB-25
ekosminsky
Posts: 4
I wired two motors/wheels each with an HB-25 to my propeller chip. The data pin on the chip goes to the Motor1, and is then chained from Motor1 to Motor2. Each are independently connected to the HB-25s, powered by a 12V power supply.
TRVL is a constant with hex value $20 (the move command for the motors). When wheel = 1 or wheel = 2, the program works as expected. When the method is recalled, the controllers properly append the number of total positions. However, if the method is called for wheel = 0, both wheels should move simultaneously. However, this causes them to both move for about 1 full rotation and then spazz out (they move in random directions and jitter). Also, when move(distance, 1) and then move(distance, 2) is called, both wheels should move distance, but the same unexpected result occurs. Ideas??
PUB move(distance, wheel) positions := distance Wheels.tx(TRVL + wheel) Wheels.tx(positions.byte[noparse][[/noparse] 1]) 'plz ignore the space before the 1, forum doesn't like bracket 1 bracket Wheels.tx(positions.byte[noparse][[/noparse]0])
TRVL is a constant with hex value $20 (the move command for the motors). When wheel = 1 or wheel = 2, the program works as expected. When the method is recalled, the controllers properly append the number of total positions. However, if the method is called for wheel = 0, both wheels should move simultaneously. However, this causes them to both move for about 1 full rotation and then spazz out (they move in random directions and jitter). Also, when move(distance, 1) and then move(distance, 2) is called, both wheels should move distance, but the same unexpected result occurs. Ideas??
Comments
> Baud Rate = 19.2kbps
> Motor Leads on BOTH HB-25s set to Yellow=M1; Blue=M2
> Device ID jumpers on Position Controllers physically set uniquely for each Position Controller. For example Right motor ID = 1, Left motor ID = 2.
> During initialization, the Right side position controller should be sent the SREV command to reverse it's orientation. (Note command must be re-sent if the Position Controller loses power).
Each of the items above are very important in getting your setup to work. Each Position Controller relies on these settings for a proper feedback loop. There are a few other ways that things can be set up but to avoid confusion start with this hardware setup first. Other than that, for commands that do not require a response (such as the TRVL command), each Position Controller accepts the command if the ID=(jumper setting) or ID=0. If it doesn't receive either of these values, the entire command is ignored.
The fact that you are seeing oscillation tells me there is an issue in your feedback loop polarity. Check your wiring polarity, jumper settings (and that they match your software), and that you properly sent the SREV command during initialization. This should solve your problems.
-Kevin