Go to Post Doctor the drill, or doctor your hand. Easy choice. Let's all make the right one. - Molten [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Spotlight this post!  
Unread 08-07-2016, 02:17
ollien ollien is online now
Registered User
FRC #5202
 
Join Date: Feb 2015
Location: United States
Posts: 317
ollien has a spectacular aura aboutollien has a spectacular aura aboutollien has a spectacular aura about
Re: What is wrong with my Vision to Gyro code?!

Quote:
Originally Posted by pblankenbaker View Post
You indicated that your PID loop would rotate the robot to 125 degrees instead of the target of -56 degrees. Given that the robot then oscillates around 125 degrees, this sounds like a condition where you need to invert (negate) the output value produced by the PID before applying it to your motors.

When we run across this issue, we typically observe the following:
  • Robot rotates away from target because we are applying power in the opposite direction required to reduce the error.
  • As the robot rotates away from the target, the error increases and the power output increases (it typically speeds up as it "runs away" from the target).
  • Because the PID set to continuous mode, 180 degrees is the farthest away from the target that you can get (so once it goes past that, the PID probably inverts the error on you and you bounce back hard in the other direction).

Try negating the power before applying it to your motors to see if that fixes the problem.

It might also be useful to add a command that rotates the robot 90 degrees every time you press a button (to make sure you get the rotation PID figured out before adding the camera code).
My team ran into a similar issue when trying to use PID and a NavX to make our robot drive straight. What I was confused about (and still am, quite frankly) is as to how we would get a steady state error 180 degrees from the target. You said in your post that

Quote:
Because the PID set to continuous mode, 180 degrees is the farthest away from the target that you can get...
If the error is still such a huge value, why wouldn't the PID loop account for that?
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 01:13.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi