43 - Buffered Drive M1 / M2 With Signed Speed And Distance

General discussion of using Roboclaw motor controllers
Post Reply
wimble
Posts: 2
Joined: Sat Oct 24, 2015 12:14 am

43 - Buffered Drive M1 / M2 With Signed Speed And Distance

Post by wimble » Sat Oct 24, 2015 12:32 am

Using this command (43) with negative speed does not appear to stop after the specified distance.

I send (hex)
80 2B 00 00 12 07 00 00 03 00 00 00 12 07 00 00 03 00 01 E4

Which is giving m1/m2 speed of 4615, m1/m2 max distance of 768, override previous commands (none were executing).

The motors move forward, m1 moved 875 encoder pulses, m2 moved 862. All is good.

After some delay after the motors have stopped, I send
80 2B FF FF ED F9 00 00 03 00 FF FF ED F9 00 00 03 00 01 FA

Which is giving m1/m2 speed of -4615, m1/m2 max distance (again) of 768, override previous commands (none were executing).

The controller moves the motors backwards well beyond the 768 pulses until I issue a stop command (same command, all zero values).

When I finally have stopped, m1 encoder has moved from 1056 (before the backward move) to -1515 (i.e., 2571 pulses) and m2 has moved from -138 to -2716 (i.e., 2578 pulses). The controller did not stop after 768 pulses.

Can you explain what I might have done incorrectly?

This is the 30A RoboClaw. m1 PID=226.353, 13.354, 0, m2 PID=267.171, 14.510, 0. m1/m2 Qpps=2810. Motor currents are under 1 Amp. Main voltage is 6.2 and logic voltage is 12.0. No error status bits were found during the whole execution. Firmware version is "USB Roboclaw 2x30a v4.1.10". During the execution of the motor commands, I repeatedly poll the RoboClaw to gather status for monitoring. This commands include:
0x10 (m1 encoder)
0x11 (m2 encoder)
0x18 (main batter level)
0x19 (logic battery level)
0x31 (motor currents)
0x37 (m1 PIDQ)
0x38 (m2 PIDQ)
0x5a (error status)

wimble
Posts: 2
Joined: Sat Oct 24, 2015 12:14 am

Re: 43 - Buffered Drive M1 / M2 With Signed Speed And Distance

Post by wimble » Sat Oct 24, 2015 10:21 am

It seems the reverse motion does stop after a distance, but not the expected distance.

User avatar
Basicmicro Support
Posts: 1274
Joined: Thu Feb 26, 2015 9:45 pm

Re: 43 - Buffered Drive M1 / M2 With Signed Speed And Distance

Post by Basicmicro Support » Tue Oct 27, 2015 10:51 am

The Distance commands will not stop instantly. There is a bug in an older firmware version that would stop instantly(or nearly instant) when going in a specific direction, but the commands are not designed to stop for you.

To make a movement(start move stop) you must send TWO commands. One to tell the motor to accelerate(if using accel) and run at some speed for some distance adn a second to decellerate back to 0 speed. I explained this in a post last week.

http://forums.ionmc.com/viewtopic.php?f=2&t=46

Based on your description it sounds like you have older firmware. Please use IonMotion(you can download it from our website) to update your units firmware and also get the latest arduino librarie as well. if the problem still happens after doing that and following my instructions in the linked post let me know and I'll work with you to find out what else it may be.

Post Reply