강의

멘토링

로드맵

Inflearn Community Q&A

namkyungnyoon1500's profile image
namkyungnyoon1500

asked

Everything about STM32 drone development starting from the ground up

9-2. Booting and Arming: Transmitter Throttle and SWA Status Check

스위치 및 스로틀 상태 검사에 약간의 루틴 추가 했습니다.

Written on

·

376

0

- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요!
- 먼저 유사한 질문이 있었는지 검색해보세요.
- 서로 예의를 지키며 존중하는 문화를 만들어가요.
- 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.

 

아래와 같이 SwA를 올린상태에서 실수로 쓰로틀이 최소가 아닌 상태에서 SwA를 내리면 부저가 울리면서 아밍 및 스로틀링이 되지 않습니다.

제가 약간의 코드로 스로틀을 내리면 동작하도록 햇는데, 사실 SwA를 올리고 스로틀을 최소로 한상태에서 다시 SwA를 내리는것이 안전면에서는 더 유리할것 같습니다.

 

if(iBus.SwA == 2000 && iBus_SwA_Prev != 2000)

{

if(iBus.LV < 1010)

{

motor_arming_flag = 1;

}

else

{

while (Is_iBus_Throttle_Min() ==0 || iBus.SwA == 2000)

{

LL_TIM_CC_EnableChannel(TIM3, LL_TIM_CHANNEL_CH4);

TIM3->PSC = 1000;

HAL_Delay(70);

LL_TIM_CC_DisableChannel(TIM3, LL_TIM_CHANNEL_CH4);

HAL_Delay(70);

if (iBus.LV < 1010)

{

motor_arming_flag = 1;

break;

}

else

motor_arming_flag = 0;

}

}

}

iBus_SwA_Prev = iBus.SwA ;

드론-개발iot드론-개발

Quiz

What is the most important reason for checking sensor connections and PID gain load status before drone flight?

To check the drone's exterior

Sensor data is required for flight control and to ensure safe flight performance

To check the battery level

To check controller connection status

Answer 1

0

ChrisP님의 프로필 이미지
ChrisP
Instructor

아 직접 코드를 추가하셨군요!

직접 추가하시는 것도 좋은데 가급적이면 우선 강의와 똑같이 따라하신 후에 비행까지 성공하시면 그 후에 코드를 바꾸시는 것을 추천드립니다.

진행하시다가 질문이 생겼을 때 제 코드와 다르면 제가 도와드리기가 어렵거든요~

namkyungnyoon1500's profile image
namkyungnyoon1500

asked

Ask a question