Go to Post being surgically altered to have two right hands is a big commitment, but if you wanna drive, and drive well ..... ! - KenWittlief [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 20-12-2016, 11:35
Robodragons4630 Robodragons4630 is offline
CHS Robodragons Programming
AKA: Noah Jarnigan
FRC #4630 (Robodragons)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2014
Location: Clinton, Tennessee
Posts: 15
Robodragons4630 is an unknown quantity at this point
PID

Using LabVIEW I can use a auto PID where it fixes the PID as it is being ran. Can I do this with C++ and how do I use a C++ PID loop. I have used a PID loop before in LabVIEW but I can't understand how to do it on c++ using the wpiLIB. If you can provide simple code to help or give a website other than wpiLIB that would be appreciated. Thanks!
Reply With Quote
  #2   Spotlight this post!  
Unread 20-12-2016, 12:19
euhlmann's Avatar
euhlmann euhlmann is offline
CTO, Programmer
AKA: Erik Uhlmann
FRC #2877 (LigerBots)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2015
Location: United States
Posts: 322
euhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud of
Re: PID

I know you said site that is not WPILib but it actually has some useful info
http://wpilib.screenstepslive.com/s/...rs-pid-control
Make sure you've read this. It has extensive information and example code
__________________
Creator of SmartDashboard.js, an extensible nodejs/webkit replacement for SmartDashboard


https://ligerbots.org
Reply With Quote
  #3   Spotlight this post!  
Unread 20-12-2016, 13:07
Robodragons4630 Robodragons4630 is offline
CHS Robodragons Programming
AKA: Noah Jarnigan
FRC #4630 (Robodragons)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2014
Location: Clinton, Tennessee
Posts: 15
Robodragons4630 is an unknown quantity at this point
Re: PID

Quote:
Originally Posted by euhlmann View Post
I know you said site that is not WPILib but it actually has some useful info
http://wpilib.screenstepslive.com/s/...rs-pid-control
Make sure you've read this. It has extensive information and example code
Thank you . For some reason after 20 mintues of googling that page didn't show up for me.
Reply With Quote
  #4   Spotlight this post!  
Unread 20-12-2016, 14:45
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,044
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: PID

Quote:
Originally Posted by Robodragons4630 View Post
Using LabVIEW I can use a auto PID where it fixes the PID as it is being ran.
I'm curious what you mean by this. Would you please explain?


Reply With Quote
  #5   Spotlight this post!  
Unread 20-12-2016, 16:55
Robodragons4630 Robodragons4630 is offline
CHS Robodragons Programming
AKA: Noah Jarnigan
FRC #4630 (Robodragons)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2014
Location: Clinton, Tennessee
Posts: 15
Robodragons4630 is an unknown quantity at this point
Re: PID

Quote:
Originally Posted by Ether View Post
I'm curious what you mean by this. Would you please explain?


This code isn't as smooth as a perfectly tuned PID but we couldnt use that because the thing we used the PID rotated vertically on a shaft so the PID needed to constantly update because based on the angle of our shooter gravity would effect it differently.
Attached Thumbnails
Click image for larger version

Name:	PID.png
Views:	40
Size:	37.3 KB
ID:	21376  
Reply With Quote
  #6   Spotlight this post!  
Unread 26-12-2016, 12:20
sspoldi's Avatar
sspoldi sspoldi is offline
Steven Spoldi
AKA: Steve Spoldi
FRC #0230 (Gaelhawks)
Team Role: Mentor
 
Join Date: Mar 2010
Rookie Year: 2008
Location: Shelton, CT
Posts: 16
sspoldi is a splendid one to beholdsspoldi is a splendid one to beholdsspoldi is a splendid one to beholdsspoldi is a splendid one to beholdsspoldi is a splendid one to beholdsspoldi is a splendid one to behold
Re: PID

Quote:
Originally Posted by Robodragons4630 View Post
Using LabVIEW I can use a auto PID where it fixes the PID as it is being ran. Can I do this with C++ and how do I use a C++ PID loop. I have used a PID loop before in LabVIEW but I can't understand how to do it on c++ using the wpiLIB. If you can provide simple code to help or give a website other than wpiLIB that would be appreciated. Thanks!
Hi Noah,
Normally I wouldn't post (relatively) untested code, but if simple is what you want the attached may work for your needs. I just tossed this together the other day (I intend to make this a development task for some of our software kids, if you're on Team 230 stop looking!). BTW, we use the simple robot class with C++ and do our own loops, just seems to be easier that way.

Cheers,
Steve.

P.S. Don't tell MamaSpoldi I'm posting code, I'll get in trouble
Attached Files
File Type: c pid.c (972 Bytes, 10 views)
File Type: h pid.h (300 Bytes, 4 views)
File Type: c example.c (453 Bytes, 10 views)
Reply With Quote
  #7   Spotlight this post!  
Unread 04-01-2017, 13:54
MamaSpoldi's Avatar
MamaSpoldi MamaSpoldi is offline
Programming Mentor
AKA: Laura Spoldi
FRC #0230 (Gaelhawks)
Team Role: Engineer
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Shelton, CT
Posts: 305
MamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant futureMamaSpoldi has a brilliant future
Re: PID

Quote:
Originally Posted by sspoldi View Post
Hi Noah,
Normally I wouldn't post (relatively) untested code, but if simple is what you want the attached may work for your needs. I just tossed this together the other day (I intend to make this a development task for some of our software kids, if you're on Team 230 stop looking!). BTW, we use the simple robot class with C++ and do our own loops, just seems to be easier that way.

Cheers,
Steve.

P.S. Don't tell MamaSpoldi I'm posting code, I'll get in trouble
No worries. I am always happy to post our code whenever it is needed by someone. Besides, as you mentioned, that is your code, not code developed by our students. Either way it is always good to share!
Save
__________________
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 13:43.

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