TLDR: If using an SRX magnetic endcoder, and linearity within each rotation is important, ensure that the mounting screws are not in contact with the shaft bearing. Edit - better yet, substitute brass screws for mounting.
Background: I am investigating the transient and steady-state performance of the 100W+ FRC brushed motors (BAG and more powerful)*. My mechanical portion is a gearbox (made up of 5 COTS gearboxes) with all the motors hooked up to the same flywheel, and a TALON SRX encoder mounted to a 3-motor AndyMark Toughbox (AM-2388) using the AndyMark Toughbox encoder mount pad (am-0208a) and the AndyMark SRX encoder mount kit (am-3565). My control system consists of an Arduino Pro Micro (Leonardo compatible, but smaller), Rev SPARK motor controller, and the encoder (with a cable and breakout), and high-level control from my desktop PC.
After getting all the hardware nominally working, my first critical system test was to look at the acceleration of a motor which was transitioned from 0 to 100% duty cycle against the friction and inertia of the system, to ensure that I could, in fact, measure what I expected. I fully expected something approximating an RC (resistor-capacitor) voltage saturating, overlaid with some random spiky noise. Instead, I got the first image below**:
Looking at the right end of the graph, I instantly noticed a strong CW (single-frequency) signal. (If you didn’t notice it, don’t feel bad; I’ve spent the last 30 years doing underwater acoustics, including at least half of that dealing with time series data.) As my eye swept back left, I could easily see the frequency decreasing/period increasing in a way that suggested that the ripple frequency was related to the output shaft frequency. I then added a “spike” to the data each full revolution (4096 samples), then adjusted this to each half revolution (2048 samples). The result follows:
With these spikes, it is clearly obvious that the oscillation is at twice the shaft frequency; each green spike intersects the blue time series near the center of the downstroke.
– More to come, probably tonight –
*My goal is to get a white paper out by year’s end to assist teams in designing their 2019 robots.
** I have the arduino sending a dump of the curve after the fact over USB, then I’m loading the data via notepad and gawk under cygwin into excel for visualization.