ROBOTC.net forums
http://robotc.net/forums/

How to maintain motor RPM
http://robotc.net/forums/viewtopic.php?f=11&t=12187
Page 1 of 1

Author:  harrisenpai [ Mon Sep 14, 2015 2:02 pm ]
Post subject:  How to maintain motor RPM

okay, so I am having some trouble here with my bot. first, when a ball is fired from the launcher we have created that works by spinning two columns of stacked wheels at high-speeds using a gear ratio, the wheels are slowed greatly and there is a brief refractory period in which the launcher will not fire its full distance as the wheels are spinning back up. is there any way to counteract this? secondly, powering a launcher like ours throughout a match, we experience a great amount of voltage drop and thus the ball is not fired as far. is there a way to write code that specifically maintains motors at a set RPM despite the voltage drop of the battery? thank you in advance.

Author:  Tabor473 [ Fri Sep 18, 2015 1:19 pm ]
Post subject:  Re: How to maintain motor RPM

So to start of trying to maintain RPM the first thing you have to do is actually calculate the RPM.

Code:
encoderChange=(EncoderValue-lastEncoderValue);
delay(100);


Using the change in the encoder per tenth of a second you should be able to calculate the RPM based off of your gearing setup and where you locate the encoder on the system. The next step is actually how to maintain that RPM. Some sort of control loop is required to keep increasing power until the RPM is reached rather than just setting a constant power level. James Pearman has a really nice post explaining a few types of velocity control loops here on the vexforum.
http://www.vexforum.com/showthread.php?t=86058

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/