Go to Post I think we must take seriously the importance of "infecting" the rest of the world with this passion. - Tstone [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
  #3   Spotlight this post!  
Unread 04-02-2016, 22:29
Dan Waxman Dan Waxman is offline
Registered User
FRC #0263 (Aftershock)
Team Role: Programmer
 
Join Date: Feb 2016
Rookie Year: 2016
Location: Long Island
Posts: 34
Dan Waxman is an unknown quantity at this point
Re: Problems with Encoders

If you would like to just start at a certain angle, you're going to have a few issues.

Your first issue is that if you just stop your motors at a certain angle, you will get a ridiculous amount of overshoot. In order to fix this, I would use a PID system. You have the option of using the PIDSubsystem that WPILib has built in (a quick tutorial for which can be found here), or you can write your own. I wrote my own due to a little issue I found with the built in PID subsystem, but by all means you can use the built in sub system. If you would like a better explanation of what a PID Controller is/how it works, here's a fantastic video explaining it.

Another issue you'll find is that if you don't implement a PID system, encoders don't usually report back in angles anyways. We have two encoders on my team, one where a full rotation is 1500 from encoder.getRaw(), another type where a full rotation is 1000. To convert from degrees to encoder ticks, you would multiply by (ticks per full rotation / 360). To convert to degrees, you would multiply by (360 / ticks per full rotation). You would have to figure out what your encoders rotation is empirically.

If you have any questions, feel free to message me. Sorry if anything is fuzzy, very tired right now.
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:47.

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