Quote:
Originally Posted by z_beeblebrox
My team is direct driving the shooter wheels with the AndyMark hub and CIM/ miniCIM motors. To measure speed, we are using a slotted optical switch whose light beam is broken by the teeth of a sprocket mounted to the wheel. Although we haven't tested it yet (hopefully tomorrow), I expect that it will be easy to mount and program (the program is mostly done) and give good (48 counts per revolution) resolution data.
|
You didn't mention the RPM you are trying to control. At 48 counts per rev at 5000 RPM, you're going to get roughly 150 RPM jitter with GetPeriod() if you leave the FPGA sample averaging at the default value of 1. If you set the samples to 48, you'll get the same clean signal as a one-per-rev sensor at that speed, namely 3 RPM.
If you use Get() to get counts instead of period, and your control loop is running at 10ms, you're going to see about 125 RPM jitter at 5000 RPM. If you try to filter that in software, there may be too much phase lag to get clean control with bang-bang.