problems with velocity readout from encoderget vi

Hi, We are programming (still) our traction control for our bot since I’m the only programmer for our team and I’m having trouble with reading sensible values from the velocity outpu of the encoder get vi. The distance is reading fine, however, the velocity keeps resetting to zero or stays at zero.

Does anyone know what my problem might be? I tried using the example code without modification and I have the same problem.

Thanks!

Make sure that the " minimum rate" parameter is not set too high. We scaled our output to ftc/sec, so the default min rate was too big. If your measured rate drops below the min, the output is set to zero, and the “stopped” output goes true. Watch the “stopped” output.

It sounds like you may have found the bug mentioned here: http://forums.usfirst.org/showpost.php?p=26395&postcount=34

If you still can’t get it, you can use the counter. The period output works for speed. One rev (Count of the counter) is one rev. of the encoder. Multiply that by the circumference of the wheel or whatever and you got the speed. You also get rev. here. You can multiply that by the circumference to get distance too… that would save space. You must have a Digsrc if the encoder is analog!! You get some example code for it.