|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#2
|
|||||
|
|||||
|
Re: Using a magnetic encoder to get speed of a motor
Can't you just WPILib's encoder VIs? Encoder Get has an output for rate, which is scaled accordingly to Distance Per Count (which you set when you opened the encoder in Begin.vi). That should do it for you.
If you can't/don't want to calculate Rate this way, you can do it this way: Code:
average_rate = delta_position / delta_time Code:
average_rate = (current_position - previous_position)/(current_time - previous_time) |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|