I have built a robotic arm with the lego Mindstorms ev3. My goal is to control its motion via teleoperation, that is , to have a gyro sensor strapped onto my arm and have the robot mimick the up and down motion of my forearm. However, I am completely stumped concerning the programming. I need a reliable way to read the gyro sensor readings while taking into account any bias in the sensor. Second, I would also like the sensor to read the rate of change in my arm and translate that into power for the large motor. If anyone can show me how to do this with the ev3 programming environment, the help would be greatly appreciated.
Disclaimer: I have never used the EV3 interface, only the text based programming languages for the NXT. Therefore I might be proven wrong.
I need a reliable way to read the gyro sensor readings
I think the gyro sensor should have come with the appropriate instructions to do that. If not, you can find many tutorials online, such as this: http://robotsquare.com/2014/06/25/tutorial-gyro-ultrasonic-sensor-ev3-home-edition/
while taking into account any bias in the sensor.
Bias can be accounted for by using a previously known position to calibrate the sensor. You could start your program with the gyro (and your arm) in one of the extreme positions and measure movement relative to that.
Second, I would also like the sensor to read the rate of change in my arm and translate that into power for the large motor.
This sounds like a simple differentiation task. You measure the angle and store it along with the current time (in milliseconds or whatever the most precise measurements available). In the next iteration you make another measurement, take the difference of the current and the previous angles, and divide it by the difference of the current and previous times. The result is the rate of change. This can be translated to motor speeds by using either trial and error, or calculations based on the characteristics of the motor, the gearing and the gyro.
However, I would rather use a command to turn the motor a specified number of degrees to match the measurements of the gyro.