How to accurately calibrate the code so that my claw move smoothly... Currently it's not that consistent What factors should I modify in the codes? Can anyone please help
It's not physically possible to create a setup to linearly move servo motor from EMG signals generated by muscle as the Muscle signal fluctuates a lot! It's better to activate servo with thresholding technique. You can apply EMG envelope algorithm to first get a smooth output from your rapidly changing muscle signal and then set a threshold activation if/else argument where you move the servo to specific location when signal is above threshold (muscle flexing) and it goes back to zero when signal is below threshold (muscle relaxed).