Answers.Body: <p>Disclaimer: I have never used the EV3 interface, only the text based programming languages for the NXT. Therefore I might be proven wrong.</p>
  
  <blockquote>
    <p>I need a reliable way to read the gyro sensor readings </p>
  </blockquote>
  
  <p>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: <a href="http://robotsquare.com/2014/06/25/tutorial-gyro-ultrasonic-sensor-ev3-home-edition/" rel="nofollow">http://robotsquare.com/2014/06/25/tutorial-gyro-ultrasonic-sensor-ev3-home-edition/</a></p>
  
  <blockquote>
    <p>while taking into account any bias in the sensor.</p>
  </blockquote>
  
  <p>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.</p>
  
  <blockquote>
    <p>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.</p>
  </blockquote>
  
  <p>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.</p>
  
  <p>However, I would rather use a command to turn the motor a specified number of degrees to match the measurements of the gyro.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-30T15:20:52.653Z
Answers.LastActivityDate: 2014-09-30T15:20:52.653Z
Answers.UserDisplayName: zovits
Body: <p>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.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-09-24T17:54:37.423Z
Comments.Text: Are the robotic arm (motor) and the gyro sensor connected to the same EV3 brick? If two EV3 bricks, the programming is more about the communication protocol between the bricks.
Comments.UserDisplayName: dfrevert
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-09-28T00:27:42.847Z
Comments.Text: Yes, the gyro and the motor are on the same brick.  I am considering getting another ev3 brick, as I could easily see how to program that setup.
Comments.UserDisplayName: bsaat
Tags: <mindstorms><ev3><programming>
Title: Teleoperated arm trouble
UserDisplayName: bsaat
ThreadText: # Teleoperated arm trouble
  
  (Asked by: username_0 on 2014-09-24)
  
  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.
  
  **Tags:** mindstorms, ev3, programming
  > **Comments:**
  > **username_1**: Are the robotic arm (motor) and the gyro sensor connected to the same EV3 brick? If two EV3 bricks, the programming is more about the communication protocol between the bricks.  
  > **username_0**: Yes, the gyro and the motor are on the same brick.  I am considering getting another ev3 brick, as I could easily see how to program that setup.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2014-09-30. Score: 1 | Accepted answer
  
  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.
  
  
  ---
  
  