Project Process/KRC-FTC (Team TC(5031, 5048))

[FTC] FTC block programming (4) - REV IMU sensor

DrawingProcess 2020. 1. 21. 15:38
반응형

REV IMU sensor (결론은,,, proportional integral derivative(PID) control)

  • 0. [가장 중요!!] sample code이용하기
  • 1. call telemetry.addDatatextimu.SystemStatus를 넣어 실시간 데이터 받기.
  • 2. call telemetry.addDatatextimu.CalibrationStatus를 넣어 실시간 데이터 받기.
    • + 기울기 측정가능. -> 수평 계산 -> 기울어짐에 따라 Dynamic control
  • 3. 매우 정확한 직선을 위한 IMU센서 활용
    • 1) 함수생성(Yaw-Angle) set Yaw-Angle to Orientation.ThirdAngle 위치 후 orientation value 값으로 call imu.getAngularOrientation 지정 + call telemetry.addData number valueYaw-Angle 넣기.(Utility -> Orientation -> Orientation.ThirdAngle)
    • 2) z축을 중심으로 약간이라도 회전할 시, 살짝만 반대로 돌면서 이동하여 원상태로!
      • if Yaw-Angle < -5 : (Little Turn Left)
      • else if Yaw-Angle > 5 : (Little Turn Right)
      • else : (straight)
  • 4. if 정지버튼을 눌렀을 때 IMU sensor값의 변화로 멈추지 않는다면? main loop문 밖에 이동을 준 후 repeat until 조건: Yaw-Angle <= -90 or call (fileName).isStopRequested loop 내부에 set Yaw-Angle tovalueOrientation.ThirdAngle 위치 후 orientation value 값으로 call imu.getAngularOrientation 지정 + call telemetry.addData number valueYaw-Angle 넣기. + call Telemetry.update도 넣어야함.
    • + IMU sensor : 3-axis 가속도와 3-axis 자이로 센서를 조합하여 출력

 

참고 : https://www.youtube.com/playlist?list=PLEuGrYl8iBm4A4yrRcatGcK7q0od0LYov

 

Blocks Tutorials - YouTube

 

www.youtube.com

 

반응형