Let's find ourselves a trailer and get hitched!
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 Yesterday, 09:12
bmfrc bmfrc is offline
Registered User
FRC #5554
 
Join Date: Feb 2017
Location: Israel
Posts: 11
bmfrc is an unknown quantity at this point
Re: PIDController - control speed vs distance - SetSetpoint

Quote:
Originally Posted by gerthworm View Post
In general, a PID algorithm requires that your setpoint ("desired") and actual values be of the same units. If you want to control your motor-powered mechanism to a certain position, use distance for both. If you want to have it rotate at a constant speed, use speed for both.

In Java, this is accomplished by two methods - setSetpoint(), which you already mentioned, and returnPIDInput().

setSetpoint gets called by other classes in your code, when they want to change the operation of the controlled system (ex: set a new speed to the shooter).

The PID class requires that you define the contents of returnPIDInput(). As long as the PID subsystem is running, it will periodically call returnPIDInput() to figure out where it's actually at, and compare that to the most recent value given via setSetpoint().

tl;dr - setSetpoint = Desired, returnPIDInput = Actual, must be same units.

Note that depending on whether you choose to control to a speed or position, the tuning philosophies do tend to change... but that's a broader discussion on the nature of the controlled system...
Thanks for the help!
But how/where do i set the returnPIDInput so when i want to control the speed it will return the rate and when I want to control the distance it will return the distance?
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 15:31.

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