Closed philwmcdonald closed 3 years ago
Hmm good question. I think we should be OK as we still have HYSTERISIS
which is set at 137 that is added/removed from the boundaries. It doesn't necessarily match the coast length for the deceleration which I haven't been able to measure.
I can plug in the logic analyzer again and see what the reported motor heights are for both controllers at their limits to see if we need to adjust.
I monitored serial which helpfully provides telemetry during the coast stage (after memoryMove is off). I measure movement of 120 & 123 going downwards and 111 & 111 going up. Both are less than hysteresis of 137. but typically each time through the loop we see a movement of 24 or even 27, currentHeight may already be 20+ beyond min/max.
I set max and a slot at the same height. then tried both memory recall and up-button-hold to see if I could exceed the max I set. memory recall never exceeded the max, but I could with the up-button. and exceeded the max by the exact coast distance I measured above.
With the same experiment with a min limit. I consistently exceeded the min by no more than 117.
As I haven't been able to exceed the soft limits by more than hysteresis I conclude this isn't a real problem. And the code is good as is.
with the recalibration procedure the safety margin was removed. I'm wondering if this is still safe:
or if that should be changed to (use targetHeight instead of currentHeight):
This wouldn't effect recalibration, as that this snippet isn't executed during recal.