드론

1-8 YMFC-3D_V2 setup 과정

coding art 2017. 11. 1. 14:50
728x90



YMFC-3D_V2 비행제어 코드 시험 순서는 YMFC-3D 홈페이지에서 제공하는 오픈소스 코드 즉 setup 및 esc calibration을 실행하고 비행제어 코드를 업로딩하여 비행 시험하는 단계로 이루어진다.

setup 코드는 우선적으로 송신기 스틱의 가 방향 별 중앙값을 확인과 이어서 스틱별 최소, 중앙 및 최대값을 확인하는 단계를 거쳐 자이로 센서 설정으로 넘어 가게 된다.

하지만 중앙값 확인 후  스틱별 최소, 중앙 및 최대값을 확인하는 “Gently move∙∙∙” 단계에서 통과하지 못하고 실패하는 경우가 발생하였다.

그 원인은 인터럽트 루틴을 사용하여 송신기로부터의 신호 데이터를 받아들이는 과정에서 문제가 발생하였으며 인터럽트 서비스를 받는 정수형 변수들을 volatile 로 선언할 필요가 있다. 이 수정 과정은 인터럽트 서비스 루틴을 사용하는 setup, esc calibration 및 YMFC-3D_V2 코드 모두에 적용할 필요가 있어 보인다.


아래의 아두이노 드론 리모델링 setup 결과를 참조하기 바란다,


===================================================

Your
  Multicopter
    Flight
      Controller

V         V     22222               
 V       V     2     2            
  V     V          2            
   V   V         2             
    V V        2                 
     V        22222222                 

YMFC-V2 Setup Program

===================================================
For support and questions: www.brokking.net

Have fun!

===================================================
System check
===================================================
Checking I2C clock speed.
I2C clock speed is correctly set to 400kHz.

===================================================
Transmitter setup
===================================================
Checking for valid receiver signals.. OK

Place all sticks and subtrims in the center position within 10 seconds.
9 8 7 6 5 4 3 2 1 

Center positions stored.
Digital input 08 = 1500
Digital input 09 = 1492
Digital input 10 = 1500
Digital input 11 = 1500

Move the throttle stick to full throttle and back to center
Throttle is connected to digital input 10
Channel inverted = no

Move the roll stick to simulate left wing up and back to center
Roll is connected to digital input 8
Channel inverted = no

Move the pitch stick to simulate nose up and back to center
Pitch is connected to digital input 9
Channel inverted = no

Move the yaw stick to simulate nose right and back to center
Yaw is connected to digital input 11
Channel inverted = no

Gently move all the sticks simultaneously to their extends
When ready put the sticks back in their center positions
Measuring endpoints....

High, low and center values found during setup
Digital input 08 values:1096 - 1500 - 1904
Digital input 09 values:1096 - 1496 - 1904
Digital input 10 values:1096 - 1500 - 1904
Digital input 11 values:1096 - 1500 - 1900
Move stick 'nose up' and back to center to continue

===================================================
Gyro search
===================================================
Searching for MPU-6050 on address 0x68/104
Searching for MPU-6050 on address 0x69/105
Searching for L3G4200D on address 0x68/104
Searching for L3G4200D on address 0x69/105
L3G4200D found on address 0x69

===================================================
Gyro register settings
===================================================
Register 0x20 is set to:1111
Register 0x23 is set to:10010000

===================================================
Gyro calibration
===================================================
Don't move the quadcopter!! Calibration starts in 3 seconds
Calibrating the gyro, this will take +/- 8 seconds
Please wait....................
Axis 1 offset=186.89
Axis 2 offset=13.99
Axis 3 offset=-154.00

===================================================
Gyro axes configuration
===================================================
Lift the left side of the quadcopter to a 45 degree angle within 10 seconds
OK!
Angle detection = 1
Axis inverted = no
Put the quadcopter back in its original position
Move stick 'nose up' and back to center to continue

Lift the nose of the quadcopter to a 45 degree angle within 10 seconds
OK!
Angle detection = 2
Axis inverted = yes
Put the quadcopter back in its original position
Move stick 'nose up' and back to center to continue


Rotate the nose of the quadcopter 45 degree to the right within 10 seconds
OK!
Angle detection = 3
Axis inverted = yes
Put the quadcopter back in its original position
Move stick 'nose up' and back to center to continue

===================================================
LED test
===================================================
The LED should now be lit
Move stick 'nose up' and back to center to continue

===================================================
Final setup check
===================================================
Receiver channels ok
Gyro axes ok

===================================================
Storing EEPROM information
===================================================
Writing EEPROM
Done!
Verify EEPROM data
Verification done
Setup is finished.
You can now calibrate the esc's and upload the YMFC-3D V2 code.
___________________________________________________________________

setup 과정이 에러 없이 완료되었으면 YMFC-3D_V2_esc_calibrate 과정으로 넘어가도록 한다.
USB 케이블이 연결된 상태에서 DEVO 7 스위치를 on 하면 바인딩이 되었음을 확인한 다음 YMFC-3D_V2_esc_calibrate 코드를 컴파일 업로딩 한다. 이 코드는 setup 과정에서 생성하여 EEPROM 에 저장한 데이터를 불러내어 사용하므로 setup 과정이 에러 없이 완료됨을 전제로 한다. 이 과정이 끝나면 USB 케이블을 제거한다.

이 단계에서 드론 배터리를 연결하고 DEVO 7 스위치를 on 하여 ♫1 2 3 음악소리와 함께 바인딩이 된 후 THROTTLE 스틱을 최소점에서 최대점까지 움직여 보아 모터 회전을 확인한다. YAW, PITCH, ROLL 스틱을 움직일 경우에는 반응이 없다는 점도 확인해 보자.

마지막으로 YMFC-3D_V2_Controller 코드를 컴파일 업로딩 함과 동시에 프로펠러를 설치한 후 비행 시험을 실시한다.

비행 시험을 시작함에 있어서 일단은 YMFC-3D_v2에서 제공하는 PID 값을 초기치로 사용해야 하지만 드론 리모델링에 따라 드론의 비행 성능이 현격히 변화되었기 때문에 최적 PID 값을 찾아내어 조율할 필요가 있다. 특히 초기치를 사용함에 있어서 주의해야 할 점은 드론을 살짝 50cm 정도 이륙시켜 보면 드론이 원치 않는 형태로 진동 내지는 떨린다는 것을 알 수 있을 것이다. 일단 착륙 시켜서 PID 값을 조정해 나가도록 해야 한다. 어느 정도 떨림 현상이 진정이 되면 제대로 비행 시험을 통해 보다 정밀한 PID 값을 찾아서 부여해야 한다.