View Single Post
  #4   Spotlight this post!  
Unread 09-04-2013, 22:58
gluxon's Avatar
gluxon gluxon is offline
\n
AKA: Brandon Cheng
FRC #0178 (The 2nd Law Enforcers)
Team Role: Leadership
 
Join Date: Apr 2012
Rookie Year: 2011
Location: Connecticut
Posts: 65
gluxon has a spectacular aura aboutgluxon has a spectacular aura aboutgluxon has a spectacular aura about
Re: Question about encoders to control motor

Quote:
Originally Posted by Chris Hibner View Post
We use a bang-bang controller very successfully. It is very simple:

1) decide on the RPM you want for your shooter. Let's call it DesiredRPM.

2) You have the RPM from your encoder. Call it ActualRPM.

3) Implement your LabVIEW code as follows:

if (ActualRPM < DesiredRPM)
MotorOutput = 1.0;
else
MotorOutput = 0;

The keys to this working well are:

1) Do NOT filter or use averaging of your RPM reading from your encoder.

2) Run it in the fast loop. We do it in a 30 ms loop and we get good results.

If you have any questions or want any help with setting it up or testing, come find me in our pit on Wednesday evening. I won't be at the competition during the day on Thursday and Friday (I'll be at work).
This particular algorithm scares me a bit. Did your robot shooter motors have issues handling the stress of constantly reversing its rotation?