![]() |
RPM calculator
I have the AS5030 rotary encoders and I was trying to find a way to calculate the RPM of our shooter motors with it. Does any one have any idea how to do so? I tried the counter class but I am having trouble selecting the
Code:
AnalogTriggerOutput.Type triggerTypeAlso how could I make it so it had a very small sampling time like .1 of a second? |
Re: RPM calculator
Try just using the Encoder class. That should have everything you need. Just make sure you use setDistancePerPulse() with the right units and you can get the speed (this class gives speeds in units per second, not minute, but you can always scale it).
|
Quote:
The AS5030 is not a quaderature encoder. It won't work with the encoder class. |
Re: RPM calculator
Quote:
|
Re: RPM calculator
Quote:
A bit of advice, if you are open to it: as a newcomer you might want to be a bit more respectful, especially with people like Joe who have helped countless people over the past 10 years. |
Re: RPM calculator
Thanks for your replies, but I was just wondering if anyone had any ideas for the RPM issue?
thanks Dimitir |
Re: RPM calculator
Quote:
Or you could use a sensor more suited to your purpose. |
Re: RPM calculator
The encoder class works with both i belive..
if so Code:
Encoder myencoder = new Encoder(#); |
Re: RPM calculator
Quote:
|
Re: RPM calculator
According to the operation manual for the AS5030 adapter board, if you open the P1 solder bridge you can access cos&sin quadrature signals at JP3 pins 1&3. Not sure if the WPILib Encoder class will work with those waveforms without some signal conditioning. Has anyone tried and succeeded? |
Re: RPM calculator
Quote:
https://decibel.ni.com/content/thread/11955 |
Re: RPM calculator
Does it output analog or digital? if its digital try using the Counter class, if its analog then use something like
Code:
int count |
Re: RPM calculator
Get rate is not ideal.
We store a last time variable. Take counter.getdistance / (current time - last time) Then reset the counter. You will get a much stabler speed this way |
Re: RPM calculator
Quote:
this is straight out of the encoder class Code:
* Get the current rate of the encoder. |
Re: RPM calculator
Quote:
This is manifestly not the same as the computing the rate using delta counts since the last sample and dividing by the elapsed time since the last sample, for sample periods on the order of 20ms and encoder pulse periods associated with shooter wheel speeds. |
| All times are GMT -5. The time now is 08:22. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi