View unanswered posts | View active topics It is currently Thu Jul 24, 2014 8:03 pm






Reply to topic  [ 13 posts ] 
Strange Motor Reversing 
Author Message
Rookie
User avatar

Joined: Wed Feb 25, 2009 7:00 pm
Posts: 10
Post Strange Motor Reversing
Our team has recently encountered a strange problem. Our robot had always had some funky steering problems. Last week we were finally able to put our fingers on the problem: When we put the motors in reverse after going forward (physically pushing the sticks, not reversing the direction in the program) they power in the original direction for two seconds, then reverse, even if allowed to spin down. After a bit of testing, we found the following:
1. Our program was not to blame. After about an hour of troubleshooting, we opened up the ROBOTC debug window and actually looked for anomalies in the variables that determined the drive speed, as well as the joystick values, were all where they should be.
2. The motors are physically fine. Even after we switched them out, the problem persisted. If we switch the motor direction in the #pragma statements the problem works in the opposite direction.
We think it may be the firmware itself, or possibly the motor controller. Has anyone had similar problems, or are we alone in this?
3. It's not the Joysticks, or controller station. The same thing happens even if the values are directly put in on an autonomous program. Note that the problem only happens in one direction.
We are using:
ROBOTC 1.46
NXT0760.rfw
The new joystickdriver.c, as well as the new dual-program template
Windows XP


Wed Feb 25, 2009 7:23 pm
Profile
Rookie

Joined: Thu Feb 26, 2009 1:03 am
Posts: 4
Post Re: Strange Motor Reversing
We have been experiencing issues with this as well...It seems as if the robots sometimes reverse even when one direction is being pushed on the joystick. It is intermittent, and so far we have simply ignored it and made our tolerance better than any errors it could possibly present.

It is annoying though.


Thu Feb 26, 2009 1:05 am
Profile
Professor

Joined: Fri Sep 19, 2008 1:22 am
Posts: 200
Post Re: Strange Motor Reversing
Several teams at last Sunday's tournament in Oregon experianced exactly the same problem. It happens both with and without PID control enabled although it seems to happen more often with PID control on.

_________________
Jeff McBride
Benson Robotics Club


Thu Feb 26, 2009 3:46 am
Profile
Rookie

Joined: Thu Feb 26, 2009 1:03 am
Posts: 4
Post Re: Strange Motor Reversing
I was going to say that we had only noticed it in pid mode; in fact in pid mode we get 100% or nothing on the motors which seems to indicate that the encoders are not working even though we are successfully reading them from the code. Our solution was simply to use the open loop and make the tolerance big enough to accommodate the less precision.


Thu Feb 26, 2009 10:27 am
Profile
Novice

Joined: Fri Oct 24, 2008 8:58 am
Posts: 87
Post Re: Strange Motor Reversing
I too experienced this problem but only with PID control. When I went to open loop such weirdness went away.

Some other things to check ... and I'm stretching here for a reason why some people have the problem and others don't (other than PID usage)

So what order are your controller's daisy chained in? I doubt that could be the issue, but its the one thing that everybody does a little different. Mine are NXT -> Motor -> Motor -> Servo

Also does this happen with even the simplest of test programs. Does it happen with only 1 motor controller hooked up to the NXT (no servos or sensors or NXT motors)

Does it happen with fully charged batteries vs not charged? The fact that it happens with autonomous is probably actually helpful for tracking down the issue.

Does it happen with another NXT?

I have occasionally gotten weird glitches where the NXT motors won't stop (or move by themselves) when the Hitechnic servo controller is under a heavy load. I've not noticed it happening with the Tetrix motors though (that could be dangerous). I've also gotten random reposition glitches of servos when the motor controllers are under heavy load.

Actually, I sort of expect these kind of glitches with a system that was hacked together as quickly as this Hitechnic-Tetrix-NXT monster that would make Dr. Frankenstein proud.

Not that this excuses your very serious issue. There has to be a reason... keep trying and let us know what you've tried.

I'd suggest removing as many factors as possible: Start with just an NXT, a controller, a motor and dead simple code. If the problem goes away then start putting things back in until the problem comes back. Remember it might be multiple issues in combination. (Actually, the sporadic but apparently repeatable occurance across multiple teams makes this seem likely).


Thu Feb 26, 2009 11:58 am
Profile
Professor

Joined: Fri Sep 19, 2008 1:22 am
Posts: 200
Post Re: Strange Motor Reversing
If you only get full speed or nothing from a motor with PID control turned on it means that it isn't seeing your shaft encoder. Do you not have a shaft encoder installed and wired up by chance? When you have PID contol on the motor controller will keep applying more and more power until the motor is moving at the speed you specified. If it doesn't get any feedback from the shaft encoder it decideds that the motor is not moving and needs more power. That is why it doesn't matter what speed you ask for you get full power.

Regarding the weird reversing issue, we have tried it with multiple motor controllers in the first and third position on the chain and we have tried three different motors and shaft encoders with and without PID control. All of that on one robot. We have seen this behavior with serveral other robots belonging to other teams. They have done similar debugging with similar results.

_________________
Jeff McBride
Benson Robotics Club


Thu Feb 26, 2009 4:03 pm
Profile
Novice

Joined: Fri Oct 24, 2008 8:58 am
Posts: 87
Post Re: Strange Motor Reversing
Has anyone tried to intercept the I2C between the NXT and the Hitechnic controller to see if the problem is a firmware issue.

I would do this myself, but I can't seem to replicate the problem on my system.


Thu Feb 26, 2009 4:08 pm
Profile
Professor

Joined: Fri Sep 19, 2008 1:22 am
Posts: 200
Post Re: Strange Motor Reversing
That is the next test on our list. We know it isn't an error in the values we are setting in the motor[] array. It will be interesting to see if there are discontinuities in the values being sent to the motor controller.

_________________
Jeff McBride
Benson Robotics Club


Thu Feb 26, 2009 8:36 pm
Profile
Rookie

Joined: Thu Feb 26, 2009 1:03 am
Posts: 4
Post Re: Strange Motor Reversing
Our configuration is motor->servo->motor. It happens under both autonomous and remote control, 9 times out of 10 when all four motors are moving. Also, now that we have attached a fourth servo, the servos like to randomly move, but this is mostly at the start of the program(s). Slight misunderstanding here; we figured this out and have coded around it. It simply seems like this should be better documented somewhere...

All of our encoders are plugged in and they all can be read accurately from the nMotorEncoder[motor] but the pid control still does not work. The fact that it is happening on all the motors points to some kind of problem somewhere, but this is true whether there is one motor connected or 4 (we don't get motor encoder readings when only 1 out of 2 encoders is plugged in while both motors are plugged in a single motor controller though).

Having one motor controller under some testing, we have not found a way to make it switch directions, but having two motor controllers without a servo has done it for us when 3 or four of the motors are moving under load. We are lucky that the way our robot is designed the dc motors are unlikely to destroy anything, but it has caused some problems in the autonomous mode (and has caused many a lost puck).


Last edited by mindstormss on Thu Feb 26, 2009 10:56 pm, edited 1 time in total.



Thu Feb 26, 2009 10:02 pm
Profile
Novice

Joined: Mon Oct 13, 2008 6:29 pm
Posts: 75
Location: Florida, USA
Post Re: Strange Motor Reversing
random servo moving is normal, that is what the initialize robot function is for, to combat this issue.

_________________
PHUHS Robotics
Team 516 FTW

Daytona Robofest Winning Alliance Captain
Daytona Robofest Inspire Award


Thu Feb 26, 2009 10:29 pm
Profile
Professor

Joined: Fri Sep 19, 2008 1:22 am
Posts: 200
Post Re: Strange Motor Reversing
10nisman94 wrote:
random servo moving is normal, that is what the initialize robot function is for, to combat this issue.


That would be relevant if we were talking about servos. Unfortunately, we are talking about motors.

_________________
Jeff McBride
Benson Robotics Club


Fri Feb 27, 2009 11:15 am
Profile
Novice

Joined: Mon Oct 13, 2008 6:29 pm
Posts: 75
Location: Florida, USA
Post Re: Strange Motor Reversing
Jeff McBride wrote:
10nisman94 wrote:
random servo moving is normal, that is what the initialize robot function is for, to combat this issue.


That would be relevant if we were talking about servos. Unfortunately, we are talking about motors.


actually they mentioned it here

Quote:
Also, now that we have attached a fourth servo, the servos like to randomly move, but this is mostly at the start of the program(s).

_________________
PHUHS Robotics
Team 516 FTW

Daytona Robofest Winning Alliance Captain
Daytona Robofest Inspire Award


Fri Feb 27, 2009 7:05 pm
Profile
Rookie
User avatar

Joined: Wed Feb 25, 2009 7:00 pm
Posts: 10
Post Re: Strange Motor Reversing
We eventually settled on a workaround. If we set both the motors to be at -1 or positive 1 power, the motor never actually spins down. If the motor doesn't stop being moved, the glitch disappears. At the same time, 1 is not powerful enough to move the robot in any way, so it's not bothering us much any more. Thanks for all the replies! They were useful for understanding how the NXT work, even if we didn't directly solve the issue. :)

_________________
--Nathan


Wed Mar 04, 2009 9:32 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 13 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.