Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Code Sample for Holonomic Drive (HO15 drive)
#3
The Pololus can be “daisy chained”. You need GRD (signal reference), TX & RX. For a single simple motor controller the GRD on the Arduino goes to GRD on the motor controller. Tx goes to Rx and Rx goes to Tx. (They’re labeled a transmit and receive for the device they’re on).

For multiple controllers, they all “listen” for their # when the Arduino talks, so the Tx and ground from the Arduino just go to all of their GND and Rx pins. I used the Serial1 Tx/Rx for my Leonardo, but if you have a single serial you can rename that to Serial. Or if you have a Mega, you can assign the motors to unique serial lines.

When daisy chained, the controllers all have to talk to the single Arduino pin. You can’t just tie them all together because they non-talkers would pull the talking one’s pin the wrong way. They say you can use an AND gate, however they put that on the board (so why mention it?)

So, the TX from the LAST Pololu goes to TXin on the next to-last Pololu. Then that one’s TX pin goes to the txIn of the next-to-last one. Etc. They relay the signal through all of them.

Really, we only need to “listen” to the first two if you put the ones with the RC inputs first in the chain, so you only really have to do that once, but I added the other two just in case I wanted to query them later for some reason.

The R/C wires for the 3 channels we need then go to the R/C inputs of the 1st two controllers.

When the Arduino “talks”, everyone listens. The Arduino sends 0xAA to get their attention, then a byte with the motor’s controller #, then the rest of the command (it’s in their PDF docs). The command changes a tiny bit in this mode, normally the high bit is set (basically to get it’s attention) for one controller, but in this mode the commend has the high bit cleared. They list it in the docs both ways.

When the Arduino is queried for information (like the R/C input values), then we have to “wait” a little for the serial buffer to get full before we can read the answer. My understanding is that if the controllers all respond at the same time we’ll get garbage – but that’s tough to do because our command is 4 bytes and they only reply 2 bytes, so they should have plenty of time to reply while we’re sending the next command.
Reply


Messages In This Thread
RE: Code Sample for Holonomic Drive (HO15 drive) - by kresty - 02-09-2018, 10:18 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)