Code dedicated to the electric motor and its disengagement in the event of an error accumulating on the setpoint.
Define a new virtual steering wheel rotation sensor that can be adjusted in the AgOpenGPS parameters.
During self-steering, the WAS evaluates the error in the WAS setpoint (wheel angle sensor): If the error is maintained or reduced, this can be considered normal. But if the error increases more and more, it is an abnormal situation: such as the steering wheel being taken over manually or the steering sensor having a problem.
This code checks the evolution of the error and accumulates an index according to the abnormal situation.
The result is that it stops the autosteer if the value of the steering wheel rotation sensor is greater than the index.
Depending on the quality of the AgopenGPS response and the hardware, we can set the value of the turn sensor between 30 and 60.
Because it is based of number of error the autosteer will be disengaged with 0.6-1.2s and it will be link according your electric motor and reactivity setting
In case you are not satisfied you can set off turn sensor to cancel the function
if you can test it can you report your setting ? or report that it is not good
Due to my experiance I think the most dificult is on line with very few modification … that probbably we can add 1-0.5% error comparaison
for Switch mode and autosteer stop (code from @m_elias ) permit to use Switch in this case