Hello, the team I mentor is trying to use the Talon SRX Java support to read a hall effect sensor plugged into an SRX breakout on QuadA.
They’ve installed the latest libs and firmware, and do see values when calling getspeed()
The ultimate goal is to PID control the input to a traget velocity. However, as we ramp up speed, the velocity returned send to be in increments of 600. 50 percent throttle is giving 1200, same does 55 percent. At 60 percent it steps to 1800 (1799.999). The next step is seen at 2400. It feels like a sampling rate or rounding issue but we haven’t identified it yet.
The sensor is a 1 square wave/rising edge per rotation (2 opposing magnets).
The motor is a minicim under a small load, with no reduction so it could generate upwards of 5 or 6 thousand ticks per minute, 100 revs (ticks) per sec, 10 tics per 100ms sample loop, etc.
We’ve done something similar before with the wpi libs right on the roborio without issues, this is our first try on the talon SRX interface.
Any ideas? Thanks!