Go to Post Please share your opinion and post whatever you want, I wouldn’t mind. Because I may be wrong. - Arefin Bari [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-16-2015, 06:08 PM
palyrobotics palyrobotics is offline
Registered User
None #0008
 
Join Date: Feb 2015
Location: Palo Alto
Posts: 1
palyrobotics is an unknown quantity at this point
Help with PID

So we wrote PID code for our robot and it is acting very strangely. Encoders seem to be working fine, but on one side the talons go far past the set point and on the other side they approach it then change direction. We printed out the error and confirmed that it is decreasing and is correct. Even when we only use the proportional value, and the error is positive, for some reason one side decelerates and switches direction. We tested code that worked on last years robot with slight modification like changing victors to talons and it acted the same way.
Reply With Quote
  #2   Spotlight this post!  
Unread 02-16-2015, 06:24 PM
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Help with PID

Are these drive motors? If so, is your robot up on blocks? Trying to tune a closed-loop controller with no load on the wheels is going to be a frustrating exercise, as there is going to be a lot of overshoot and very little damping.

You might be able to get it to work adequately if you limit the rate at which the motor speed command can change. But it's really going to have to be run on the carpet in order to get it dialed in properly.
Reply With Quote
  #3   Spotlight this post!  
Unread 02-17-2015, 11:57 AM
GeeTwo's Avatar
GeeTwo GeeTwo is offline
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,539
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: Help with PID

If these are drive motors, or are otherwise oriented in opposite directions, you need to either use the invertedMotor() method during initialization on one side, or use negative PID constants as well as using negative speed settings in your drive functions. The advantage of using invertedMotor() is that you do it once, and don't worry about what is positive or negative anywhere else.
__________________

If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.
Reply With Quote
Reply


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 10:10 AM.

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