Go to Post My strongest FIRST memories, and the teams that leave the biggest impact on me, are teams that seem like they have every reason to give up, but never do. - Chris is me [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 52 votes, 4.98 average. Display Modes
  #16   Spotlight this post!  
Unread 21-03-2012, 11:14
mommazzboy mommazzboy is offline
Registered User
FRC #2468 (Team Appreciate)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2009
Location: Austin, TX
Posts: 4
mommazzboy is an unknown quantity at this point
Re: Alternative to PID speed control

Quote:
Originally Posted by Ether View Post
Make sure you scale the feedforward appropriately and then clamp the result after you add it to the PID output.


Can you expand on this some? We're setting the motor outputs in PWM, so the input to the VI needs to be between -1 and 1 inclusive, so we should make sure that the sum of the feedforward and the output of the PID never goes out of that range. Is that what you mean by "scale the feedforward appropriately"? If not, what do you mean? And what do you mean by "clamp the result"?
Reply With Quote
  #17   Spotlight this post!  
Unread 21-03-2012, 12:03
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,034
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: Alternative to PID speed control

Quote:
Originally Posted by Ether
Make sure you scale the feedforward appropriately and then clamp the result after you add it to the PID output.
Quote:
Originally Posted by mommazzboy View Post
Can you expand on this some?
Yes, but first let me make a recommendation: Seriously consider the approach Martin has described in his earlier post in this thread. Really.

Quote:
We're setting the motor outputs in PWM, so the input to the VI needs to be between -1 and 1 inclusive, so we should make sure that the sum of the feedforward and the output of the PID never goes out of that range. Is that what you mean by "scale the feedforward appropriately"?
No. What I mean by "scale the feedforward appropriately" is that you must scale the feedforward so that adding it to the PID output makes sense.

If your PID setpoint is in rpm, and your PID output is +/-1, then it would not make sense to add the setpoint to the PID output without first scaling the setpoint. Adding 4000 (rpm) to the PID's +/-1 output would make the PID completely ineffective.

After you've added the feedforward to the output of the PID, you should then clamp that sum to whatever range the downstream code is expecting. In LabVIEW I think that's called "in range and coerce", or some such thing.




Last edited by Ether : 21-03-2012 at 12:22.
Reply With Quote
  #18   Spotlight this post!  
Unread 21-03-2012, 15:18
plnyyanks's Avatar
plnyyanks plnyyanks is offline
Data wins arguments.
AKA: Phil Lopreiato
FRC #1124 (The ÜberBots), FRC #2900 (The Mighty Penguins)
Team Role: College Student
 
Join Date: Apr 2010
Rookie Year: 2010
Location: NYC/Washington, DC
Posts: 1,113
plnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond repute
Re: Alternative to PID speed control

Quote:
Originally Posted by Ether View Post
In LabVIEW I think that's called "in range and coerce", or some such thing.
Right you are
__________________
Phil Lopreiato - "It's a hardware problem"
Team 1124 (2010 - 2013), Team 1418 (2014), Team 2900 (2016)
FRC Notebook The Blue Alliance for Android
Reply With Quote
  #19   Spotlight this post!  
Unread 21-03-2012, 15:24
mommazzboy mommazzboy is offline
Registered User
FRC #2468 (Team Appreciate)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2009
Location: Austin, TX
Posts: 4
mommazzboy is an unknown quantity at this point
Re: Alternative to PID speed control

Quote:
Originally Posted by martin417 View Post
We used a very simple closed loop control that worked flawlessly. We had a jag on CAN bus with an encoder attached to the jag. We used voltage control with a voltage ramp of ~115 V/S. We queried the jag for speed, and if the speed was less than the set speed, we set max voltage. If the speed was greater than or equal to set speed, we set zero voltage. The inertia of the system kept the shooter speed within ~15 RPM of set speed at all times, and when we shot, the voltage immediately went to full for rapid spin-up.

the simplest solution that works is usually best.
A couple of questions:
1. How often were you asking the Jag for the speed?
2. How quickly were you running the control loop?
3. Were you able to compensate for the load that the ball puts on the motors quickly enough as to keep them at the correct speed?
Reply With Quote
  #20   Spotlight this post!  
Unread 21-03-2012, 15:48
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,034
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: Alternative to PID speed control

Quote:
Originally Posted by mommazzboy View Post
A couple of questions:
1. How often were you asking the Jag for the speed?
2. How quickly were you running the control loop?
3. Were you able to compensate for the load that the ball puts on the motors quickly enough as to keep them at the correct speed?
I'm not Martin, but until he reads your post and replies, here's a preliminary response:

Questions 1 & 2:
I'm guessing this controller would work fine in TeleOp. If that is the case, the answer to both questions 1 & 2 would be 20ms1.

Question 3:
For this application, no other control scheme provides faster spin-up or recovery time than the controller Martin described2. So if Martin's controller approach doesn't respond quickly enough, you won't be able to improve things by using PID.


1 if the CAN cannot respond that fast, the encoder could be moved to the cRIO and read by the FPGA.
2 we used to call this a "bang-bang" control (for obvious reasons) when I was working aerospace back in the '80s.
. see this: http://www.chiefdelphi.com/forums/sh....php?p=1146748
. @Martin: what was your criterion for selecting the voltage ramp rate? did you try this with a much faster ramp?



Last edited by Ether : 21-03-2012 at 16:37.
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 03:45.

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