May 25, 2020
MMT servos - KSS - the Keith Simple Servo
In April of 2020, Keith Powell proposed a simplified servo topology.
I was asked to evaluate how hard it would be to implement it using the
C code already written (but not tested) to implement the curren elevation
servo.
The initial evaluation is that it looks quite easy.
Unless I am mistaken, code has already been written and tested for
the six filter blocks used in the new topology.
The new design consists of a PID position loop, a velocity feedforward
term, an series of 4 filters on the servo output, and the command
preprocessor block. Both the PID loop and the velocity feedforward
sections require a filter to calculate velocity.
It may be advisable to add some "slow start" code to delay output of the
servo until enough samples have passed through the filters to allow their
output to be accurate and stable.
The elevation servo in use was generated using simulink from R2007b.
Subsequent work has used R2009 as well as a 2012 release.
The 2012 release yielded some changes and surprises in code generation,
but none of this has seen actual use on the telescope.
Filter blocks
The following is a discussion of how the six filter blocks in the KSS will be
implemented using C code pulled from the elevation servo.
It should be noted that these blocks were tested by wrapping the code
for each as an "S function", then setting up a model that ran that side
by side with the simulink blocks with identical input. The outputs
were differenced, with the expectation that the difference would be zero.
This was rarely the case exactly due to round off error, but values on
the order of 1.0e-12 were considered entirely acceptable.
Also note that the C code I have written was often based on a study of the C code
generated by real time workshop.