Micro Dual Serial Motor Controller

Adam, i was just going through the booklet and something occured to me. If im sending only the configuration command once, why do i gota keep sending the same serial data to tell the unit to move forward?? Do i not send the 4 byte command once to tell the unit to move forward??? why must i be sending it consistently to the motor controller?

Wait, are you continuously re-sending command bytes? I don’t have a motor controller here with me to test, but that could TOTALLY be the entire problem!

You only need to send a speed/direction command once, and the controller will just keep doing whatever that command said until you send it another command that says otherwise! It’s great because it frees up your microcontroller from constantly having to output control signals until you want to change how the motor is moving.

As for the configuration command, you really never need to use it UNLESS you want to use more than one motor controller on the same serial line. That way, you can leave one motor controller with the default motor numbers 2 and 3, and configure another to respond to motor numbers 4 and 5, and so on. As for the statement that all motor controllers will respond to motor numbers 0 and 1, it’s not a contradiction, but it is a little unclear. Think of it more as all even numbered motors will respond to commands sent to address 0, and all odd numbered motors will respond to commands sent to address 1. Basically, if you don’t remember what motor numbers you configured your controller to use, you can always just send commands to motors 0 and 1 and it will work.

Once you set the motor controller to use a set of numbers it saves that configuration in non-volatile memory, so it will keep using that set of motor numbers until you configure it otherwise (even when you switch it off and unplug the batteries). In fact, you shouldn’t use the configuration command too often, like every time you start your program for example, because the non-volatile memory the configuration is stored in can only be written to so many times (well, something like 100,000 times, but still!).

So, was that it? Are you going to build two robots with your two motor controllers?

-Adam

WHAT!!! lol. i totally thought you gota keep sending the command bytes to the uDSMC!!! dats how i thought it worked. I was going through the booklet and it is very poorly written because 1- it doesnt state that you only need to send one command and 2- it doesnt inform you how to do a master reset on the uDSMC if you change your configuration etc etc…

well if you only need to send one byte command, that is probably my issue.

maybe you can clear this out for me. if i send the uDSMC a [128, 0,5,63] byte that is stating to use motor 2 and go forward but if i use [128,0,6,63] this is stating to tell motor 3 connected to go in reverse (the only reason i switched from motor 0 and 1 to 2 and 3 is becuase in the book it states that the default configuration uses motors 2 and 3). so how does the uDSMC know to keep motor 2 moving forward if i send the second motor information to tell motor 3 to go backwards? wont motor 2 then stop and motor 3 then work? or does it save both byte configurations in non-volatile memory because of the configuration stating your gona be using 2 motors?

Not sure if its the issue, gona do some testing tomorrow, but no i m not building two robots, just one to move forward.

Thanks Adam

Each motor remembers the last command you sent that applied to it.

Lets say I command motor 2 to go forwards. Then I command motor 3 to go backwards, then motor 3 to stop, then motor 3 to go forwards, then motor 3 to stop again. All this time motor 2 will keep going forward because that is the last command I sent that applies to it.

Can’t wait to see your robot!

-Adam