Using SciPy’s optimization features, we let vary the model parameters and use difference of the logged position over time with the simulated one as the goal to minimize. This should let us identify the model parameters.
So, what model would we try to fit to? If you don’t have one in mind, might I suggest:
Torque = inertial_load*acceleration + damping*velocity + gravity[theta] + torque_ripple[theta] + disturbance
We’d obviously tell users to leave the motor undisturbed during this test so we can neglect the last term. If we get enough data points, we could fit a
torque_ripple function of the form these guys have used. This should make motor performance reallly nice and smooth, even at very low speeds.
inertial_load would be a constant,
damping would be a function of the form
a + sgn[theta]*b, and the
gravity would have to changed based on loading conditions but should be something like
Meanwhile, one thing that is possible to do with the proposed workflow is to do a form of robust control: we can let the user supply a range of load masses that are expected, and hence we can force the tuning in simulation to be stable over a sample of all possible load masses
I’m sure this idea would work, but sliding mode control is also a form of robust control, and usually improves performance. I know augmenting the control scheme on hardware is more difficult than what we’re proposing here, but it might not be that much of a performance hit.
So here is my half-baked ideas for stimulus…
For these, a set of a few different frequency and amplitude sinusoids could be appropriate. Maybe throw in some steps?
I like this approach because smooth sinusoid-y motion and step commands are common, so we’d be “training” the motor on practical moves, which I think is the right approach.
I’d love to help design the Python implementation side, but I’ve never contributed to a Github project before. Are you looking for contributors? If so, is it straightforward to become one?