Go to Post We are engineers after all so I say "Bring on the technology"!:yikes: - emersont49 [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 07-02-2012, 18:31
Romanotics Romanotics is offline
Registered User
FRC #3130
 
Join Date: Jan 2012
Location: Minnesota
Posts: 2
Romanotics is an unknown quantity at this point
CAN PID problems

Our team is looking this year to implement PID control embedded in the Jaguars using CAN. Unfortunately, when we try to request any value out of the Jaguars, the motors spin at top velocity.

We have modified the example code to include speed, output voltage, and PID value indicators acquired from the Jaguars, and the voltage, when any speed is requested, we get a voltage out of 12 volts, an RPM of 600 (The max, and accurate), and all the correct PID values read from the jaguar. We cannot figure out this problem, and I am very confused about this.
Reply With Quote
  #2   Spotlight this post!  
Unread 07-02-2012, 20:25
dakaufma dakaufma is offline
Registered User
AKA: David Kaufman
FRC #0449 (Blair Robot Project)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2009
Location: Silver Spring
Posts: 28
dakaufma is an unknown quantity at this point
Re: CAN PID problems

What values are you using for P, I, and D?
Reply With Quote
  #3   Spotlight this post!  
Unread 07-02-2012, 21:28
Romanotics Romanotics is offline
Registered User
FRC #3130
 
Join Date: Jan 2012
Location: Minnesota
Posts: 2
Romanotics is an unknown quantity at this point
Re: CAN PID problems

We have tried every possible combination of P,I, and D, with no noticeable results except huge values of I and D instantly cause the robot to oscillate.
Reply With Quote
  #4   Spotlight this post!  
Unread 07-02-2012, 22:32
dakaufma dakaufma is offline
Registered User
AKA: David Kaufman
FRC #0449 (Blair Robot Project)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2009
Location: Silver Spring
Posts: 28
dakaufma is an unknown quantity at this point
Re: CAN PID problems

We have only minimally tuned our drive PID constants (because our robot isn't close enough to its final weight yet), but it is working fairly well with P=D=0 and I=0.01. Perhaps you are using values that are too large? If the robot is oscillating your constants are too large.

Note that you generally want to tune the PID loop with the P constant in position control, but in speed control the I constant takes the place of the P constant and P takes the place of D. CD has a lot of threads about speed-based PID control by now; refer to them for details about tuning speed PID loops.
Reply With Quote
  #5   Spotlight this post!  
Unread 08-02-2012, 00:04
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,609
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: CAN PID problems

I suggest you look closer at your feedback and command values. I'm nearly certain that while you're commanding a positive speed, you're getting a negative speed feedback. Or vice versa. This would explain your run away condition. If a positive Voltage output doesn't give you a positive feedback, then your PID loop will make things worse and worse and worse until it's running as fast as possible in the opposite direction.

Your solution is to either swap your A and B channels on the encoder, or the wires on the M+ and M- terminals. Do either one of those (not both!) and things should start working better. I believe our programming team is using P=0.5, I=0.0005, and D=0 and is getting decent results. Once they had the feedback and command directions matching, that is.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
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:56.

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