Go to Post Guess i don't know what the secret weapon is, but i bet if it can be wedge shaped it is. - Chris [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Spotlight this post!  
Unread 26-01-2016, 18:00
techkid86's Avatar
techkid86 techkid86 is offline
Magic Programer
FRC #3044 (0xBE4)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: ballston spa
Posts: 58
techkid86 is an unknown quantity at this point
Re: Drive train PID control

Be very careful with those encoders. My team has never successfully used these encoders in competition without hilariously disastrous consequences. Make sure you thoroughly test these in the shop and do plenty of research on how to mount them.

now, as to how to implement it. I did a little more research and found that you can infact use the robot drive class.
Code:
Encoder leftEncoder = new Encoder(1,2);
RobotDrive tank= new RobotDrive (/*numbers I dont know about*/)
PIDController leftControl = new PIDController(0.1,0,0, leftEncoder ,tank.m_frontLeftMotor);
This does not show how to tune PID, or set up encoder values, but it should be enough to get you started.

Code:
leftEncoder.setPIDSourceType(kDisplacement);
leftControl.enable();
leftControl.setSetpoint(distanceToTravel);
__________________
"you can build a perfect machine out of imperfect parts" -Urza

Last edited by techkid86 : 26-01-2016 at 18:06.
Reply With Quote
 


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:19.

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