Go to Post We are reluctant to deprive you of the experience of learning how to do your own research. - Alan Anderson [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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 01-02-2017, 12:52
FRC2501's Avatar
FRC2501 FRC2501 is offline
Registered User
FRC #2501 (Bionic Poalrs)
 
Join Date: Jan 2015
Rookie Year: 2008
Location: Minnesota
Posts: 54
FRC2501 is an unknown quantity at this point
PIDController Issues

Hello, this year our team decided to try and implement the PIDController to regulate the speed at which our shooter is running.

I have a simple code for just the shooter (VictorSP in PWM 4) and the AMT103-V encoder (in DIO 0 & 1). I have been able to get input from the encoder and run the motor manually, but I haven't been able to get the PIDController to actually turn on the motor.

Here is a screenshot of the smartdashboard output:


I was wondering if anyone here on ChiefDelphi had any ideas on how to get the motor to run, the code can be found here:
https://github.com/FRCTeam2501/2017-.../src/Robot.cpp
Reply With Quote
  #2   Spotlight this post!  
Unread 01-02-2017, 14:54
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,604
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: PIDController Issues

How did you choose your P and D values?
Reply With Quote
  #3   Spotlight this post!  
Unread 01-02-2017, 15:54
FRC2501's Avatar
FRC2501 FRC2501 is offline
Registered User
FRC #2501 (Bionic Poalrs)
 
Join Date: Jan 2015
Rookie Year: 2008
Location: Minnesota
Posts: 54
FRC2501 is an unknown quantity at this point
Re: PIDController Issues

Quote:
Originally Posted by Joe Ross View Post
How did you choose your P and D values?
We just threw random numbers in, we have tried larger P and D values but it didn't effect it at all.
Reply With Quote
  #4   Spotlight this post!  
Unread 01-02-2017, 16:29
dvanvoorst dvanvoorst is offline
Registered User
FRC #2771 (Code Red)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Grand Rapids, MI
Posts: 73
dvanvoorst is an unknown quantity at this point
Re: PIDController Issues

It may be helpful to use the SmartDashboard to actually update your PID values on the fly so that you can easily see what they should be.
If you add a line to your OperatorControl main while loop that says something like shooterPID.setPID(SmartDashboard.getNumber("P: "), SmartDashboard.getNumber("I: "), SmartDashboard.getNumber("D: ")) (convert that from Java to C of course), then you can just type in new values to test with.
You can do the same thing with your SetPoint. Instead of hard coding it like you did, just pull the value from SmartDashboard. e.g. shooterPID.SetSetpoint(SmartDashboard.getNumber("S etpoint: ") (again, converting to C syntax)
Then you can try a larger P value easily to see if that's the issue. And try a zero D to start with.
__________________

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 20:22.

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