PWM Speed difference - Locked Antiphase vs Sign Magnitude

General discussion of using Roboclaw motor controllers
Post Reply
robof
Posts: 36
Joined: Tue Jun 27, 2017 11:21 pm
PWM Speed difference - Locked Antiphase vs Sign Magnitude

Post by robof »

I'm trying to test Sign Magnitude vs Locked Antiphase PWM modes to work on my hall effect encoder count issues per servocity's suggestion; however I noticed some major differences in speeds between the two PWM Modes

Is this a similar/related issue? Or something different?

In Sign Magnitude mode it appears to be counting 3-6x more quickly in the forward direction than the reverse direction, so my position setting is working even worse than in the Locked Antiphase mode I was using before.

To complicate this more, I'm only seeing it on Motor 1 of a 2x7A roboclaw, regardless of the motor hooked to M1/Enc1. M2/Enc2 appears to have similar speeds in both forward and reverse. I do not see this issue on a 2x15A roboclaw.

For reference, I'm using Ion Studio (latest version, all controllers are latest firmware) and here are my numbers for one motor; though the results are similar on different motors/encoders

Locked Antiphase
--Duty = 1000
----Speed ~= 2200
--Duty = -1000
----Speed ~= -2200


Sign Magnitude
--Duty = 1000
----Speed ~= 12500

--Duty = -1000
----Speed ~= -2200


I've also seen some really strange things happening in Sign Magnitude mode in the Position settings.
  • On both a 2x7A and 2x15A, trying to manually tune, leaving Position I and Position D at 0, and only adjusting Position P, the motors behave as if some I and D are involved. The motor doesn't just move toward the desired position and stop, it will pause and move and pause and move, and sometimes even more backwards. Sometimes it will even move in desired direction but the encoder position will hover around the same value, I'm assuming it is counting +'s and -'s at the same time. In locked antiphase mode, with the same position settings, the motor will just move and stop and these other issues aren't present.
  • This has only happened on a 2X7A, and only randomly, but sometimes I can drag the Control sliders for Motor 1 and after it is done moving, Motor 2 will move some; I do not have Sync motors checked
  • Sometimes I can set position and it will go there and stop, but current draw will hit and stay at 4+ Amps, when typically it draws <1 to move.
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: PWM Speed difference - Locked Antiphase vs Sign Magnitude

Post by Basicmicro Support »

I may have misunderstood what you wrote. Are you testing using Duty commands(eg PWM Settings) or are you using Speed commands(Velocity Settings screen)? I get the impression you are doing some of both?

Please do the following.
1. Test your encoders using Duty commands. Run the motors forward and backwards with the same duty values and read the speeds back(as it appears you may have already done). At the same duty both motors should have similar speeds(within some margin of error) in either direction and relative to each other if the encoders are working correctly.

2. If one motor is showing a problem(in the above test) swap the motors/encoder channels and see if the problem follows the motor or stays on the original channel.

3. Run the same test on the 2x15a you.

4. Give me the numbers for all these tests.

The above tests are to try to determine if the problem is specific to this 2x7A(if its a problem on the same encoder channel no matter which motor is used and the same motors work fine on a 2x15a that could indicate a problem with one encoder channel on the 2x7a). If the problem follows the motor that that definitely indicates something specific to that motor and probably not the general snubber problem we have been talking about.

As for the later half of your post:

Tuning will fail if the encoders are giving bogus information back which seems likely in the case of the one motor channel so until the encoders are confirmed to be working there is no point in trying to tune on that channel(or any channel showing odd behavior with the encoder readings). Note that the other channels that appear to be ok at the test Duty setting could show problems at other duties.

On the case of Motor 2 moving when you move motor 1 slider was this in velocity/position settings? If so that could be cause by encoder noise as well. If the noise is enough to mess with motor 2s encoder readings it thinks the motor is moving and will try to stop it which would cause the motor to move a little.

This could be a number of things but if you are using Position commands if the motor cant get to its position it may hunt back and forth. You may not see it but it will show up as excessive current. Add deadband(widens the "zero" of the position)

Post Reply