Following the discussion above, I started implementing a sensor alignment test for closed loop based on the same conscept as for open loop, but when I think deeper about it, I believe this is nonsense and the measured misalignment will always be close to zero, since the reference position for the control loop is always the sensor position. Am I right with that assumption? Any ideas how it could be done better?
Yes, youâre right, for closed loop control the situation is more complicated.
The same test does not make sense, I donât think. You donât have two seperate references to compare like you do in the open loop case.
Of course one solution can be an external test rig, with its own sensor - assuming it is at least as precise as the motor sensor, you can use it to check the primary setup.
The motor settling time test makes a certain amount of sense, and could be used to check how long the motor takes to come to rest. This will depend also on the PID tuning, as a badly tuned setup may oscillate so much it just doesnât settle.
More generally, can set the target value and see how closely the system tracks the target value as it changes. The difference between these curves will be a measure of the quality of control, both in terms of latency and accuracy.
I was also thinking about a test where you bounce the motor back and forth between two pre-defined positions, say -30° and 30° within a given time-span. When this time-span is long, the motor will reach the ends, and perhaps even come to a stop there. As you decrease the time-span, the motor will spend less and less time at rest, and eventually reach the point where it does not fully arrive at the -30° or +30° points any more. The test can be extended with physical or optical end-stops, which are used to trigger the direction changes.
Iâm still thinking about it, but I believe it could be an interesting test, and allow you to experiment with ramp-values and give information about the sensor latency by comparing timings vs. measured sensor positions.