View Single Post
  #4   Spotlight this post!  
Unread 15-02-2011, 15:11
BornaE's Avatar
BornaE BornaE is offline
Registered User
FRC #0842 (Formerly 39)
Team Role: Engineer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Gilbert, Arizona
Posts: 359
BornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant future
Re: E-Stop Lag... now part of our arm is broken

Ryan,

You absolutely cannot , cannot just reverse the output to the motor to reverse the motor output if your pid is working correctly.

Reversing the motor output will destabalize your control loop by creating positive feedback. see this which can cause catastrophic failures in critical systems. Nuclear explosion is an example of positive feedback.

To reverse the direction, you have to either
1.negate the output to the motor and negate the input from the encoder/potentiometer.
or 2. negate the preset line.

Also I have never heard of an analog encoder. can you explain what you mean?

Quote:
Originally Posted by RyanN View Post
So we had a crazy problem last night. We were trying to get PID running with our arm using presets. Everything was going fine until we changed one little thing... motor direction.

Now our logic is this... and sorry for no LabVIEW code.

Preset-->PID-->Negate Motor-->Arm Limits-->Arm Motor

Very straight and simple logic. The Arm Limits is based on motor direction, and our absolute analog encoder value. The limits were working fine. Reversing the direction that the PID responded with shouldn't have affected anything and we still don't think it did.

We programmed it with the negate on the motor output value of the PID to correct the response. It was going completely reversed, but the arm limits were working perfectly.

Well, we deployed the new code and it immediately ran the motor full forward until the arm hit the physical stop and kept going. We saw it about to happen (in like a second in advance), so the programmer hit the E-stop button, but it didn't work. The arm snapped the physical stop, and kept driving down. We had to stop it by hitting the reset breaker on the back of the robot that was to remain clear because of the said arm.

So a few issues here... the robot ignored the coded and tested limits on the arm. The robot ignored the E-stop button. And one of the craziest things is that the arm wasn't even in preset mode. It was in joystick mode. (We have 3 modes: joystick, throttle, and preset... when the robot is first run, it defaults to joystick mode). We verified it was in joystick mode because that was what was set on the front panel. Another issue is that we know it knew it's position. It wasn't supposed to go below 90 degrees, but when it lost the signal, it was at 59.6 degrees.

So, programmable limit was ignored, e-stop was ignored, joystick mode was ignored...

I can't even imagine what happened. All the programmers sat down for a while and tried to put the pieces of the puzzle together, but we still have no idea what was wrong.

Even weirder is that we re-deployed the same code, except with the arm breaker removed and a probe on the motor output, and it worked flawlessly. Flawlessly enough to plug the breaker back in and try it. Worked fine. No code change at all.

Some extra background. We were definitely in Teleop mode. The arm is only called in teleop, and autonomous.

Seeing that the problem is corrected for now... I don't know if anyone can tell us how to fix it. Is there a known issue for the robot just doing random stuff?
What was up with the E-stop not working at all?

All we can think is that we lost communication for a split second, which caused the motors to retain their values and ignore all other code until the watchdog would timeout... which I guess it never had a chance to do.
__________________
-Borna Emami
Team 0x27
Reply With Quote