I've designed a robot with two motors. It works as follows:
The first motor is attached to the the person's arm, the second motor receives the calculated movement and moves accordingly.
When the person moves his hand (open/close) the other robot moves the the opposite direction; upon opening it closes and vise-versa.
I've tried to invert the movement by multiplying by -1 but the second motor keeps moving on his own. I've tried multiplying the results of both motors, before subtracting, with no success.
The 'code' does the following:
- I take the movements of motors A and B
- Subtract value of motor A from motor B's
- Save the result to a variable-'moveDist'
- Take the absolute value after subtraction for comparison
- If greater than 6, pass 'moveDist' value to the second motor.
but the second motor keeps moving on his own.
- i.e. motor B keeps making movements even if motor A does not register any movement (or movements below your '6' threshold)?