Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Technical Discussion (http://www.chiefdelphi.com/forums/forumdisplay.php?f=22)
-   -   Measuring RPM (http://www.chiefdelphi.com/forums/showthread.php?t=142004)

dradel 17-01-2016 17:44

Measuring RPM
 
Was wondering if it would be possible to measure and set shooter wheel rpm with a vex versa encoder?

nandeeka 17-01-2016 17:51

Re: Measuring RPM
 
Yes, it is possible. For measuring, you can divide encoder ticks/distance by time. For setting the speed, you can use a PID control loop to PID your motor speed based on feedback from your encoders.

nighterfighter 17-01-2016 17:53

Re: Measuring RPM
 
From the specs on their website: (http://www.vexrobotics.com/276-2156.html)

Quote:

The optical shaft encoder can detect up to 1,700 pulses per second, which corresponds to 18.9 revolutions per second and 1,133 rpm (revolutions per minute). Faster revolutions will therefore not be interpreted exactly, potentially resulting in erroneous positional data being passed to the microcontroller.
So the maximum speed of the shaft being measured is 1133 RPM. Assuming you are spinning something faster, you will have to change the rotation speed of the shaft you are measuring.

Tom Line 17-01-2016 17:57

Re: Measuring RPM
 
He may have been talking about the integrated vex versaplanetary stage with encoder from CTRE. I believe that can measure up to 15,000 rpm depending on the method you use (pwm or dio).

nighterfighter 17-01-2016 17:58

Re: Measuring RPM
 
Quote:

Originally Posted by Tom Line (Post 1525561)
He may have been talking about the integrated vex versaplanetary stage with encoder from CTRE. I believe that can measure up to 15,000 rpm depending on the method you use (pwm or dio).

Ah, my mistake. If that's the case, disregard my post.

dradel 17-01-2016 18:01

We are using a wheeled shooter this year, and I am thinking to have a repeatable shot the wheels need to spin at same rate every time so was thinking using the versa planetary encoder to read and set rpm on the wheels

nighterfighter 17-01-2016 18:06

Re: Measuring RPM
 
Quote:

Originally Posted by dradel (Post 1525566)
We are using a wheeled shooter this year, and I am thinking to have a repeatable shot the wheels need to spin at same rate every time so was thinking using the versa planetary encoder to read and set rpm on the wheels

Yes, you do need a feedback mechanism to control the speed of the shooter wheel. Just always setting the motor value to ".75" or what have you, won't work, as the actual speed will fluctuate.

To control the RPM, you can use a variety of methods. One method is Bang-Bang (what we used in 2012) and a whitepaper can be found here.

Another option is to create a PID loop that runs on the roboRIO.

Another option, at least in years past, was to feed the encoder values directly to a Jaguar, and the Jaguar would run the PID loop for you after you give it a set point. I am not sure what the equivalent motor controller of today is that can do that, however.

nandeeka 17-01-2016 18:17

Re: Measuring RPM
 
Another option would be for the speed to be controlled by a dial on the driver's station. You could play with the dial as needed, even during the match, if you are having issues.

Even if you do not decide to use this method in competition, it might be a good way to figure out what speed you want in the first place and then use a Bang-Bang controller or PID loop to control on-field.

nighterfighter 17-01-2016 18:21

Re: Measuring RPM
 
Quote:

Originally Posted by nandeeka (Post 1525577)
Another option would be for the speed to be controlled by a dial on the driver's station. You could play with the dial as needed, even during the match, if you are having issues.

Even if you do not decide to use this method in competition, it might be a good way to figure out what speed you want in the first place and then use a Bang-Bang controller or PID loop to control on-field.

You still need a way to control and verify that what your dial is setting, is actually being run on the robot.

We did do something similar in 2012 though. After our camera tracked the target, and fed the shooter a setpoint value, we had 2 buttons on our joystick that would increase the RPM setpoint by 50, or decrease it by 50.

Tom Line 17-01-2016 18:27

Re: Measuring RPM
 
In the case that you are unable to create a speed control routine in code, you actually can do a reasonably good job just by accounting for the battery voltage.

The major contributor to speed fluctuations of your wheel will be battery voltage, assuming that your motor and mechanical system don't change. By simply multiplying the amount your drive your shooter wheels by the % of battery voltage you can actually do a reasonably good job of keeping the motor at the same speed.

That said, if you use the "I" value in PiD, you can do a pretty good simple speed controller.

Ether 17-01-2016 18:36

Re: Measuring RPM
 
Quote:

Originally Posted by nighterfighter (Post 1525569)
Another option is to create a PID loop that runs on the roboRIO.

Yet another option would be TBH.

Quote:

Another option, at least in years past, was to feed the encoder values directly to a Jaguar, and the Jaguar would run the PID loop for you after you give it a set point. I am not sure what the equivalent motor controller of today is that can do that, however.
Talon SRX has built-in PIDF (Proportional/Integral/Derivative/Feedforward) if used in CAN mode.



ozrien 17-01-2016 19:04

Re: Measuring RPM
 
In case you do decide to use the velocity Closed-loop in Talon SRX, checkout section 12.4 for a Java walk-through of Velocity-closed-loop.

http://www.ctr-electronics.com/talon...ical_resources

Also source here...
https://github.com/ozrien/FRC-Exampl...bot/Robot.java

dradel 17-01-2016 20:19

We are using srx speed controllers.

dradel 17-01-2016 20:21

I should also include that we are using lab view

nighterfighter 17-01-2016 20:23

Re: Measuring RPM
 
Quote:

Originally Posted by dradel (Post 1525646)
We are using srx speed controllers.

Then it might be worth trying out the SRX closed loop control; Should be simpler than implementing it yourself.

I am not versed with LabView, but I'm sure someone can help you with that.


All times are GMT -5. The time now is 16:00.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi