I am working on the sim to real job now,use model to simulate Bolt in real time and send the results to motors.
You know,this job often cause the motors out of control because of the imperfect model and the not suitable parameters.I need to stop the motors for safety if any motor is out of the position or velocity limit.
Currently i found that setting zero current or use PD controller is not good,is there a goood way to stop motors as soon as possible ?
I think the best (as in safest) method is to use an emergency stop button to physically cut the power of the motors. We have them on the connection between power supply and robot, so if something goes wrong we can immediately turn off the robot completely.
One simple solution that has worked well for us is to go to damping mode. Basically, what we do is that once we detected something is wrong, we initiate a controller -kd*v, where kd is the damping and v is the joint velocity. Try to make kd as large as possible (you are limited with the measurement noise). Now, when something goes wrong and this damping mode is activated, the controller tries to bring all the joints to a stop as quickly as possible.