Go to Post I understand that I'm in the minority when it comes to these things, so when the coverage switches to one these stories I exercise my right to change the channel. - Karthik [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 7 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 12-02-2014, 16:11
Maxchrist Maxchrist is offline
Registered User
FRC #4458 (Infernobotix)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2012
Location: Center Moriches, NY
Posts: 10
Maxchrist is an unknown quantity at this point
How do you make a PID move a motor in Java?

Hi we are trying to get a motor to move with a potentiometer to specific positions, and we are attempting to use a PID controller to do so. We have tried using .setSetpoint(), but we do not know what that value actually means and how to make the motor move, if that is the right way to do it. If someone could help us out it would be great. Thank you.
Reply With Quote
  #2   Spotlight this post!  
Unread 12-02-2014, 16:26
cgmv123's Avatar
cgmv123 cgmv123 is offline
FRC RI/FLL Field Manager
AKA: Max Vrany
FRC #1306 (BadgerBOTS)
Team Role: College Student
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Madison, WI
Posts: 2,079
cgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond repute
Re: How do you make a PID move a motor in Java?

Did you enable the PIDController?
__________________
BadgerBOTS Robotics|@team1306|Facebook: BadgerBOTS
2016 FIRST Championship Tesla Division | 2016 Wisconsin Regional Engineering Inspiration Award

2015 FIRST Championship Carson Division | 2015 Wisconsin Regional Chairman's Award

2013 FIRST Championship Curie Division | 2013 Wisconsin Regional Chairman's Award

2012 FIRST Championship Archimedes Division | 2012 Wisconsin Regional Engineering Inspiration Award, Woodie Flowers Finalist Award (Lead Mentor Ben Senson)

Reply With Quote
  #3   Spotlight this post!  
Unread 12-02-2014, 16:31
Maxchrist Maxchrist is offline
Registered User
FRC #4458 (Infernobotix)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2012
Location: Center Moriches, NY
Posts: 10
Maxchrist is an unknown quantity at this point
Re: How do you make a PID move a motor in Java?

well we are not entirely sure how to set it up, can you maybe show us a sample or something?
Reply With Quote
  #4   Spotlight this post!  
Unread 12-02-2014, 16:35
cgmv123's Avatar
cgmv123 cgmv123 is offline
FRC RI/FLL Field Manager
AKA: Max Vrany
FRC #1306 (BadgerBOTS)
Team Role: College Student
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Madison, WI
Posts: 2,079
cgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond repute
Re: How do you make a PID move a motor in Java?

Quote:
Originally Posted by Maxchrist View Post
well we are not entirely sure how to set it up, can you maybe show us a sample or something?
If you set the setpoint with:
Code:
pidController.setSetpoint(setpoint);
then you need to enable the controller with:
Code:
pidController.enable();
I'm not as familiar with PID controllers as I'd like to be, but here is the API if that helps: http://www.wbrobotics.com/javadoc/ed...ontroller.html
__________________
BadgerBOTS Robotics|@team1306|Facebook: BadgerBOTS
2016 FIRST Championship Tesla Division | 2016 Wisconsin Regional Engineering Inspiration Award

2015 FIRST Championship Carson Division | 2015 Wisconsin Regional Chairman's Award

2013 FIRST Championship Curie Division | 2013 Wisconsin Regional Chairman's Award

2012 FIRST Championship Archimedes Division | 2012 Wisconsin Regional Engineering Inspiration Award, Woodie Flowers Finalist Award (Lead Mentor Ben Senson)

Reply With Quote
  #5   Spotlight this post!  
Unread 12-02-2014, 16:40
TFleig78's Avatar
TFleig78 TFleig78 is offline
Registered User
AKA: Tyler
FRC #0078 (Air Strike)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Rhode Island
Posts: 58
TFleig78 will become famous soon enoughTFleig78 will become famous soon enough
Re: How do you make a PID move a motor in Java?

The PID controller needs an input (use the method returnPIDInput()). This comes from a sensor, such as a gyro or potentiometer. You then use the usePIDOutput() method to move one or multiple motors in order to make the input value reach the setpoint. You need to enable the pid with enable().
This video explains the PID subsystem really well:

http://www.youtube.com/watch?v=j2Xz8bRRcF0
Reply With Quote
  #6   Spotlight this post!  
Unread 12-02-2014, 16:52
Maxchrist Maxchrist is offline
Registered User
FRC #4458 (Infernobotix)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2012
Location: Center Moriches, NY
Posts: 10
Maxchrist is an unknown quantity at this point
Re: How do you make a PID move a motor in Java?

Thank you so much, i think that will help, I will update this when we figure out if it works
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 11:29.

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