Go to Post If you don't have a hairtie, use a ziptie instead. It works, it's cute, and way geeky. :p - Katie Reynolds [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 Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 05-02-2011, 15:51
Triapod Triapod is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Mar 2010
Rookie Year: 2005
Location: NJ
Posts: 28
Triapod is an unknown quantity at this point
PID Inputs and Outputs

I am wondering if the inputs into the PID SubVI need to be scaled in order to match the output. Can you simply, for example, have a process value that is an angle measure (using an encoder) and a setpoint that is an angle measure and have the control output a value that controls the motor speed, in which case the control accounts for the change in angle based on adjusting the motor speed. The output range also being -1 to 1 to match the motor.

I'd imagine in this case a small proportional gain would be needed since the error in the angle in degrees may be quite large and a small change in the motor speed accounts for a large change in the angle.

Something like:
****The encoder distance will be changed into an angle like in the example motor with encoder vi

Thank you

Last edited by Triapod : 06-02-2011 at 14:37. Reason: Input -> Output
Reply With Quote
  #2   Spotlight this post!  
Unread 06-02-2011, 10:29
j.cole j.cole is offline
Registered User
FRC #0379
 
Join Date: Jan 2010
Location: Girard
Posts: 159
j.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud of
Re: PID Inputs and Outputs

Im not 100 percent if it works yet but that is what I am doing. Just taking the value straight from the encoder into the PID VI. I mean it should work because the error (difference in where you want it and where it is) is derived from the values your giving it so as long as the process value can possibly equal the setpoint (ex. your process value is between 1 and -1 and your setpoint is between 2 and -2).
__________________

It's not normally a good idea to give a programmer a drill but rules are made to be broken.
Reply With Quote
  #3   Spotlight this post!  
Unread 06-02-2011, 13:29
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: PID Inputs and Outputs

The setpoint and the feedback (process variable) need to be compatible, with the same scale. The PID is going to try to drive the output until the inputs match.
Reply With Quote
  #4   Spotlight this post!  
Unread 06-02-2011, 14:36
Triapod Triapod is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Mar 2010
Rookie Year: 2005
Location: NJ
Posts: 28
Triapod is an unknown quantity at this point
Re: PID Inputs and Outputs

Quote:
I am wondering if the inputs into the PID SubVI need to be scaled in order to match the input.
I meant output there

I did make the setpoint and the process variable the same scale by having the second Encoder Get wired to the shift register, but the main concern is whether it is a problem having the PID control a speed based on an error in angle.

My process value and outputs are angle so they can by as high as 90 degrees or more. Its the output range that I've limited to -1 to 1 in order to match motor speed.
Reply With Quote
  #5   Spotlight this post!  
Unread 06-02-2011, 14:40
Vikesrock's Avatar
Vikesrock Vikesrock is offline
Team 2175 Founder
AKA: Kevin O'Connor
no team
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2007
Location: Manchester, NH
Posts: 3,305
Vikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond repute
Send a message via AIM to Vikesrock Send a message via MSN to Vikesrock Send a message via Yahoo to Vikesrock
Re: PID Inputs and Outputs

Not a problem at all. As you've observed it will simply effect the magnitude of the gains.
__________________


2007 Wisconsin Regional Highest Rookie Seed & Regional Finalists (Thanks 930 & 2039)
2008 MN Regional Semifinalists (Thanks 2472 & 1756)
2009 Northstar Regional Semifinalists (Thanks 171 & 525)
Reply With Quote
  #6   Spotlight this post!  
Unread 07-02-2011, 20:27
Triapod Triapod is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Mar 2010
Rookie Year: 2005
Location: NJ
Posts: 28
Triapod is an unknown quantity at this point
Re: PID Inputs and Outputs

Thank you for the responses. The method works -- just needed to be careful of the integral gain that caused a periodic motion.
Reply With Quote
  #7   Spotlight this post!  
Unread 08-02-2011, 02:39
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: PID Inputs and Outputs

I recommend removing the error wire between the Motor SetOutput and the Encoder Get. This will allow those two independent operations to run in parallel.

-Joe
Reply With Quote
  #8   Spotlight this post!  
Unread 08-02-2011, 09:28
Triapod Triapod is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Mar 2010
Rookie Year: 2005
Location: NJ
Posts: 28
Triapod is an unknown quantity at this point
Re: PID Inputs and Outputs

Quote:
Originally Posted by jhersh View Post
I recommend removing the error wire between the Motor SetOutput and the Encoder Get. This will allow those two independent operations to run in parallel.

-Joe
I thought to get the new encoder value right after the motor input has been sent from the PID in each iteration. I'll see if it makes a difference

Also in the image, the encoder should be started
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:11.

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