Go to Post Having 75% of the drive train without direct connection to the transmission would make me a bit queasy, but then again, I'm not Winnovative. - Taylor [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 31-01-2013, 19:06
Jay Meldrum's Avatar
Jay Meldrum Jay Meldrum is offline
Registered User
FRC #0067 (H.O.T.)
Team Role: Engineer
 
Join Date: Jan 2012
Rookie Year: 2003
Location: Michigan
Posts: 42
Jay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud of
PIDController with Potentiometer

Our students are currently trying to reprogram last years robot with Command based programming. Last year we used a homemade PID function to controller our arm instead of wpi's PIDController.

We are now trying to use PIDController with the arm; one potentiometer is the input. When we set the set point to a known location and enable the PID, the pid outputs -1 100% of the time, when we move the arm across the known point the pid output never changes. Below is how we have the ReturnPIDInput defined.

We have had success with controlling the Shooter with a PID but we cannot get the arm to work.

Is it possible the PIDController is trying to read a voltage too quickly from the pot and we are recieving a NULL value back?

Anyone run into issues with this?

Code:
double Arm::ReturnPIDInput () {
	return armPot->GetAverageVoltage();
}
__________________
2012-2015 - FRC 67 - Programming/Controls Lead Mentor
2003-2005 - FRC 857 - Driver

Check us out at http://www.hotteam67.org
Previous year design docs, programming tutorials, and more!
Reply With Quote
  #2   Spotlight this post!  
Unread 31-01-2013, 19:19
Team3266Spencer's Avatar
Team3266Spencer Team3266Spencer is offline
Team Captain and Lead Programmer
AKA: Spencer Lanman
FRC #3266 (Robots-R-US)
Team Role: Programmer
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Richmond, Indiana
Posts: 280
Team3266Spencer is an unknown quantity at this point
Re: PIDController with Potentiometer

Have you tuned the PID values?
__________________
2012: Buckeye Regional, Queen City Regional, Human Player
2013: Queen City Regional, Buckeye Regional, Crossroads Regional
Shooter Operator
2014: Crossroads Regional, Queen City Regional
Catapult Operator
2015: Georgia Southern Classic Regional (Winner), Queen City Regional
Chainsaw Operator
Want to talk? TeamSpeak: team3266.noip.me
Reply With Quote
  #3   Spotlight this post!  
Unread 31-01-2013, 19:19
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,044
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: PIDController with Potentiometer

Quote:
Originally Posted by jsmeldru View Post
when we move the arm across the known point the pid output never changes
what is happening to the signal from the pot when you are doing this?


Reply With Quote
  #4   Spotlight this post!  
Unread 31-01-2013, 19:27
Jay Meldrum's Avatar
Jay Meldrum Jay Meldrum is offline
Registered User
FRC #0067 (H.O.T.)
Team Role: Engineer
 
Join Date: Jan 2012
Rookie Year: 2003
Location: Michigan
Posts: 42
Jay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud of
Re: PIDController with Potentiometer

When we read directly armPot->GetAverageVoltage(); we get expected values that range from 0 - 3.

However we believe the PIDController is not receiving that value.

We are using PID values from our previous PID loop, but we are not even trying to power the motors in this debug stage.

If we manually move the arm across the setpoint we should at least expect a change from the output of the PID to go from a negitive number to a positive number or vise versa. We currently do not see that.
__________________
2012-2015 - FRC 67 - Programming/Controls Lead Mentor
2003-2005 - FRC 857 - Driver

Check us out at http://www.hotteam67.org
Previous year design docs, programming tutorials, and more!
Reply With Quote
  #5   Spotlight this post!  
Unread 31-01-2013, 19:46
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,044
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: PIDController with Potentiometer

Quote:
Originally Posted by jsmeldru View Post
we believe the PIDController is not receiving that value
Why the uncertainty? Is there no way to examine that?


Reply With Quote
  #6   Spotlight this post!  
Unread 31-01-2013, 22:47
nightpool's Avatar
nightpool nightpool is offline
robotRectifier
AKA: Evan
no team (formerly of CORE 2062)
Team Role: Alumni
 
Join Date: Oct 2011
Rookie Year: 2011
Location: Waukesha, WI
Posts: 81
nightpool is on a distinguished road
Re: PIDController with Potentiometer

Try reading armPot->PIDGet(). This should show you exactly what values the PIDController class is getting.
__________________
Proud alum of CORE 2062.
www.core2062.com
Reply With Quote
  #7   Spotlight this post!  
Unread 03-02-2013, 10:49
Jay Meldrum's Avatar
Jay Meldrum Jay Meldrum is offline
Registered User
FRC #0067 (H.O.T.)
Team Role: Engineer
 
Join Date: Jan 2012
Rookie Year: 2003
Location: Michigan
Posts: 42
Jay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud of
Re: PIDController with Potentiometer

Quote:
Originally Posted by nightpool View Post
Try reading armPot->PIDGet(). This should show you exactly what values the PIDController class is getting.
Thanks nightpool. Interesting results. When reading armPot->GetAverageVoltage() we receive values that range from 0-3. (armPot->GetAverageVoltage() is what we return as the input to the PID loop). However when we read armPot->PIDGet() we receive values from 300 to 600. When we change our set points to match what PIDGet is receiving the PID works as expected... Not sure what is going on here, but at least we have a solution.

Thanks again
__________________
2012-2015 - FRC 67 - Programming/Controls Lead Mentor
2003-2005 - FRC 857 - Driver

Check us out at http://www.hotteam67.org
Previous year design docs, programming tutorials, and more!
Reply With Quote
  #8   Spotlight this post!  
Unread 04-02-2013, 18:24
Jefferson Jefferson is offline
Registered User
AKA: Jeff Clements
FRC #0016 (Bomb Squad)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Mountain Home, AR
Posts: 257
Jefferson has a brilliant futureJefferson has a brilliant futureJefferson has a brilliant futureJefferson has a brilliant futureJefferson has a brilliant futureJefferson has a brilliant futureJefferson has a brilliant futureJefferson has a brilliant futureJefferson has a brilliant futureJefferson has a brilliant futureJefferson has a brilliant future
Re: PIDController with Potentiometer

I think the PIDController is getting integer counts ranging from 0-1024.
Interestingly, we've been using the HOT_PID controller for years, starting in 2010. Now, we are doing exactly the same thing this year, switching over to commands and WPI PIDController.
This was confusing to us as well when we switched over. Try reading armPot->GetAverageValue. That should give you the same value as the PIDGet function.
Just give it an integer value in the 0-1024 range instead of the 0-5V range, and you should be good.

And thanks for the years of use from the HOT_PID.
Reply With Quote
  #9   Spotlight this post!  
Unread 05-02-2013, 10:20
Jay Meldrum's Avatar
Jay Meldrum Jay Meldrum is offline
Registered User
FRC #0067 (H.O.T.)
Team Role: Engineer
 
Join Date: Jan 2012
Rookie Year: 2003
Location: Michigan
Posts: 42
Jay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud ofJay Meldrum has much to be proud of
Re: PIDController with Potentiometer

Thanks Jeff, we'll be sure to try the GetAverageValue function with setting the range differently. Glad HOTPID helped you throughout the years. We are sad to not use it anymore as well, but when PIDController works, it works great.
__________________
2012-2015 - FRC 67 - Programming/Controls Lead Mentor
2003-2005 - FRC 857 - Driver

Check us out at http://www.hotteam67.org
Previous year design docs, programming tutorials, and more!
Reply With Quote
  #10   Spotlight this post!  
Unread 06-02-2013, 16:29
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 588
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: PIDController with Potentiometer

That has been a little confusing.

The hardware returns a value between 0 and 1023 for 0-5V. The library will return either the hardware value or the voltage and it's important to be consistant in your units otherwise the output values will be way off.

Brad
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
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 12:55.

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