I know it has been done a lot here already, but I’m looking for some guidance/advice on how to wire a Rover 5 Chassis (4 motors, 4 encoders) to a Gadgeteer Motor controller.
Any help or links would be appreciated as I can’t find anything.
I know it has been done a lot here already, but I’m looking for some guidance/advice on how to wire a Rover 5 Chassis (4 motors, 4 encoders) to a Gadgeteer Motor controller.
Any help or links would be appreciated as I can’t find anything.
Here’s a couple:
With a Cerbus: http://www.tinyclr.com/forum/topic?id=7625
With a WP7 controlling it via WiFi: http://www.tinyclr.com/forum/topic?id=7854
Min of what’s needed:
Not sure about wiring in the encoders.
Yeah I found the WP7 one, but the piece that is lacking is the actual wiring of the Rover -> Gadgeteer, I haven’t found any post that really covers it.
In the image you can see motor module in the middle on the back. The 2 pair of thicker red/white are going to the motors and the thinner ones (with the red disconnected) are the power wires from the battery.
Then you can see the ribbon cable going to socket #11 on the FEZ Spider.
If you use 2 motor controllers, you’d have 1 connected to the left front/rear motors and another module connected to the right front/rear motors.
Looks like he has a 9V battery for the FEZ and another for the motors (if you follow the loose red wire)
That makes sense, mine just looks more complicated since I have the encoders…
Hm, I wonder if I could bypass them.
Writing? Or wiring?
Please clarify…are you looking for code, or for wiring?
For the latter, the wiring is essentially straightforward, at least with respect to the motors. You simply need two L298 motor modules, and you connect the red and black leads from each motor to one of the two output terminals on a given L298 module. IIRC, I have the front 2 motors connected to one module, and the rear 2 to the other, but it doesn’t really matter as long as you keep track of which is which.
The modules are labeled as to which terminal is positive and which is negative, so just keep track of which motor is connected to which output, and you should be fine in terms of coding.
Now as for the encoders, I’ve not yet hooked those up, so I’m sorry to say I can’t be much help there. It’s on my TODO list for my omnidirectional robot (along with getting larger omnidirectional wheels) My understanding is that the encoders are quite a bit more complex to implement than just the motors alone, but if you’re doing something like I am with omnidirectional wheels, encoders are a must-have.
FWIW, Dagu sells a motor controller with encoder support that might be worth looking at, as it might simplify things a bit:
If you don’t need the encoders for precision motor control, you don’t need to wire them up at all. Just wire the red/black from each motor to one of the output terminals on your L298 (remember you’ll need 2 to drive 4 motors), and you should be good to go.
Encoders aren’t needed, unless you needed extremely precise control.
The way I understand it is that they send a pulse (I think, I guess it would depend on the encoder) 4 times for every revolution. So your code would count the interrupts for each encoder. Then you’d compare the different encoders to see if you are tracking straight or not. Another use would be to go forward [em]x[/em] pulses.
DevHammer
First of all that was a bad typo on my part…yes the wiring was the hard part, BUT I think I found an answer to this as well.
It looks like with two extender modules I can drive 4 encoders. I found a sample online and will try it when I get home tonight. (If it works I’m going to blog about it).
Otherwise, I’ll just pull out the encoders and wire them directly as at this point I do not need the precise control.
Hope you get it working, and if you do, please do blog about it…I’m very much interested in getting the encoders working. Can you share a link to the sample you found?
Sure can, not sure why it wasn’t there before.
I’ll know this evening if it works. (I’m prepping for a Gadgeteer presentation that I’m giving at St. Louis Day of .NET and this is my “wow, if I get it done” final demo. Not really needed for the presentation, but will be a nice add.)
Just looked at the post…all he’s doing there (apart from the network stuff) is using the Extender module INSTEAD of the motor driver module. Unfortunately, I’m not seeing anything about the encoders there, so if you’ve already got the L298 modules, you may be better off sticking with those, so you don’t have to write the PWM code directly, and just use the motor driver API instead.
If you look about 3/4 of the way down at his breadboard diagram, that shows the wiring of the leads from the Encoders, at least that is what it looks like.
Looking forward to reading about it!
Just looked again. Unless I’m missing something, the breadboard only shows wiring the extenders to the motor leads. No encoder wiring that I can see.
I gave up on the Encoders, but now trying to find a workaround for the fact that I can run two motor controllers. (TO handle all 4 motors).
Anyone have an idea?
What kind of work around? You want to run the 4 motors off of one controller? DevHammer is running all 4 of of two controllers so that he can controller each motor/omnidirectional wheel independently.
If you wanted to run tracks, technically you could run the left side motors on one channel of the controller and the right motors on the other channel. With tracks, you wouldn’t need (or want) to run the front motor faster/slower than the back motor.
Right now what I’m running into is the same thing I’ve seen in other places. I have a spider and I’m trying to run two motor controllers. (Pin 8 and 11) However, what happens is that only the last one added actually works.
As a temporary workaround I’m using 1 motor controller and on “Motor 1” I’m controlling the right motors. On “Motor 2” I’m controlling the left motors.
Ideally I’d like to be able to control the front motors with 1 motor controller and the back motors with the other.
I’ll try and replicate that with my setup. I know andrew was having some issues getting with omni wheels to turn properly a few weeks back at MADExpo, we thought it may have been a grip/lube issue on the wheels. I can try it with some motors I have here this weekend.
Yes, I think my issues were specific to the use of the omnidirectional wheels.
I’m not sure what the best setup would be for treads. Unfortunately, as I understand it, with motor controllers you may not get precisely the same rotation from 2 motors, even if they’re set to the same duty cycle. Which means that you might potentially have some loss of power when using treads, if the two motors on a given side are moving at different speeds, as one motor may end up essentially creating drag on the other.
All this is off the top of my head, though, as I never used the treads with my Rover 5. If I was going to use treads, I’d probably just go with the two motor model.