Go to Post After all, each day is fresh with no mistakes in it [yet]. - atomikitten [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 04-02-2016, 09:33
Sparx030 Sparx030 is offline
Registered User
FRC #1251
 
Join Date: Jan 2016
Location: Florida
Posts: 14
Sparx030 is an unknown quantity at this point
PID setSetPoint

When I type PID.setSetPoint(), what value is it looking for me to input? Does it want counts per second, degrees per second, ect?
Reply With Quote
  #2   Spotlight this post!  
Unread 04-02-2016, 10:00
aeastet aeastet is offline
Programming Mentor
AKA: Tim Easterling
FRC #6043 (Allegan Tigers Robotics)
Team Role: Coach
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Holland, MI
Posts: 116
aeastet is an unknown quantity at this point
Re: PID setSetPoint

That depends on how you set up your PID loop. For our PID loop we are using RPM as the input and we get motor power out. It would also depend on what you are using your PID loop for.

Inputs
You should have a set point you are trying to achieve.
The process variable (current measured value)
The PID values
Limits (This could be anything +/- 1, 0-1VDC, 0-5000RPM, 3500-5000RPM etc...)

Output would be a number somewhere in the range of your limits.
Reply With Quote
  #3   Spotlight this post!  
Unread 04-02-2016, 11:25
Sparx030 Sparx030 is offline
Registered User
FRC #1251
 
Join Date: Jan 2016
Location: Florida
Posts: 14
Sparx030 is an unknown quantity at this point
Re: PID setSetPoint

Quote:
Originally Posted by aeastet View Post
That depends on how you set up your PID loop. For our PID loop we are using RPM as the input and we get motor power out. It would also depend on what you are using your PID loop for.

Inputs
You should have a set point you are trying to achieve.
The process variable (current measured value)
The PID values
Limits (This could be anything +/- 1, 0-1VDC, 0-5000RPM, 3500-5000RPM etc...)

Output would be a number somewhere in the range of your limits.
I am using my PID to maintain a certain RPM with input from an encoder (which would read counts per revolution) using 4x decoding at 120 cycles per revolution, so I have
Code:
pidShooter = new PIDController(Kp, Ki, Kd, encoder, motor);
now say I'm trying to maintain 1000 RPM, what do I put into PID.setSetPoint() to achieve that? If I am still missing something let me know.
Reply With Quote
  #4   Spotlight this post!  
Unread 04-02-2016, 11:31
aeastet aeastet is offline
Programming Mentor
AKA: Tim Easterling
FRC #6043 (Allegan Tigers Robotics)
Team Role: Coach
 
Join Date: Jan 2015
Rookie Year: 2011
Location: Holland, MI
Posts: 116
aeastet is an unknown quantity at this point
Re: PID setSetPoint

Your set point should be 1000 as long as the input to the PID is in RPM and the process values is in RPM. If the input to the system is pulses then you are going to read pulses on the process variable and change the motor output.

You have two options here:

One: figure out how many pules it takes to get to 1000RPM and have that be your input. I your case 120 (counts in one revolution) * 1000 RPM = 120,000 pluses. This way you could read pulses into your PID and it would adjust. In this case 120,000 would be your input to the setpoint.

Two: convert pulses to RPM and feed this into your PID loop. I this case you you have the set point of 1000 and you would read RPM.

Either way will work.

Last edited by aeastet : 04-02-2016 at 11:39.
Reply With Quote
  #5   Spotlight this post!  
Unread 04-02-2016, 14:59
Sparx030 Sparx030 is offline
Registered User
FRC #1251
 
Join Date: Jan 2016
Location: Florida
Posts: 14
Sparx030 is an unknown quantity at this point
Re: PID setSetPoint

Quote:
Originally Posted by aeastet View Post
Your set point should be 1000 as long as the input to the PID is in RPM and the process values is in RPM. If the input to the system is pulses then you are going to read pulses on the process variable and change the motor output.

You have two options here:

One: figure out how many pules it takes to get to 1000RPM and have that be your input. I your case 120 (counts in one revolution) * 1000 RPM = 120,000 pluses. This way you could read pulses into your PID and it would adjust. In this case 120,000 would be your input to the setpoint.

Two: convert pulses to RPM and feed this into your PID loop. I this case you you have the set point of 1000 and you would read RPM.

Either way will work.
Thank you for the help, hopefully things will go well when I get a chance to test this.
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 09: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