Go to Post Engineers can really make a difference when people are in their time of need. - Elgin Clock [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
  #16   Spotlight this post!  
Unread 16-04-2016, 11:32
Oblarg Oblarg is online now
Registered User
AKA: Eli Barnett
FRC #0449 (The Blair Robot Project)
Team Role: Mentor
 
Join Date: Mar 2009
Rookie Year: 2008
Location: Philadelphia, PA
Posts: 1,116
Oblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond repute
Re: Problem with NavX to turn around.

Quote:
Originally Posted by rich2202 View Post
In theory, PID is great. In practice, not so much.

In this exercise, you are trying to turn a robot to a set angle. PID will increase the speed until you get there, and then oscillate back and forth trying to hit the mark. The easier way to do it is to turn at a controlled speed until you get there.

In the original code, I'm guessing that the robot is rotating too fast, and overshoots the error range (self.desired to self.desired+10) that one time in 10. The solution is to turn slower, check the angle more frequently, wider error range. Maybe when you get close, you slow down the turn.
This is kind of (erm, very) misleading.

One can easily cap the max speed of a P loop (let's be honest, for turn-to-angle you're probably not going to need any I or D) or tune the P term to avoid overshoot. In fact, one of the appeals of a P loop is precisely that the output ramps down as you approach the setpoint, such that you do not overshoot. In this capacity, it is quite a bit nicer than bang-bang control (which is what you are describing).
__________________
"Mmmmm, chain grease and aluminum shavings..."
"The breakfast of champions!"

Member, FRC Team 449: 2007-2010
Drive Mechanics Lead, FRC Team 449: 2009-2010
Alumnus/Technical Mentor, FRC Team 449: 2010-Present
Lead Technical Mentor, FRC Team 4464: 2012-2015
Technical Mentor, FRC Team 5830: 2015-2016
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 19:21.

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