Safety Notes
When working with a real system, be careful and mind the following safety measures:
Brushless motors can be very powerful, moving with tremendous force and speed. Always limit the range of motion, power, force and speed using configurable parameters, current limited supplies, and mechanical design.
Stay away from the plane in which double pendulum is swinging. It is recommended to have a safety cage surrounding the double pendulum in case the parts of the pendulum get loose and fly away.
Make sure you have access to emergency stop while doing experiments. Be extra careful while operating in pure torque control loop.