Arduino 控制四軸飛行器 相關問題

大家好:
因為小弟最進突然想玩台直升機
所以就想說自己組裝
所以就選用arduino 順便學C語言
我在控制馬達(電子調速器)的地方一直搞不懂
所以想請教各位大大們
謝謝!

以下是科威特電子調速器

Arduino 控制四軸飛行器 相關問題
Arduino 控制四軸飛行器 相關問題
2014-12-03 20:05 發佈
這地方有範例
https://github.com/diydrones/ardupilot

\ArduCopter\ArduCopter.pde
大約 477行定義
MOTOR_CLASS motors(CONFIG_APM_HARDWARE, &APM_RC, &g.rc_1, &g.rc_2, &g.rc_3, &g.rc_4);

1036行
static void fast_loop()

1051行
set_servos_4();

\ArduCopter\motors.pde
220行
motors.output();

追下去
\libraries\AP_MotorsMatrix.cpp
約 265行

// send output to each motor
for( i=0; i<AP_MOTORS_MAX_NUM_MOTORS; i++ ) {
if( motor_enabled[i] ) {
_rc->OutputCh(_motor_to_channel_map[i], motor_out[i]);
}
}


\libraries\APM_RC\APM_RC_APM2.cpp
166行
void APM_RC_APM2::OutputCh(unsigned char ch, uint16_t pwm) 大概就是這裡了

INIT的部分可以參考
82行
void APM_RC_APM2::Init( Arduino_Mega_ISR_Registry * isr_reg )
{
// --------------------- TIMER1: OUT1 and OUT2 -----------------------
digitalWrite(12,HIGH); // pulling high before changing to output avoids a momentary drop of the pin to low because the ESCs have a pull-down resistor it seems
digitalWrite(11,HIGH);
pinMode(12,OUTPUT); // OUT1 (PB6/OC1B)
pinMode(11,OUTPUT); // OUT2 (PB5/OC1A)
digitalWrite(12,HIGH); // pulling high before changing to output avoids a momentary drop of the pin to low because the ESCs have a pull-down resistor it seems
digitalWrite(11,HIGH);
...........................


謝謝您找了那麼多資料

但小弟我因為剛接觸不久
所以看不太懂(本身學機械,多少學一點控制)
希望大大能在將控制馬達轉速的部分稍為講解一下

小弟非常感謝您
犧牲寶貴的時間為小地講解
大家好,剛好借這串討論串問一下,小的也是想入門 Arduino 控制四軸,但是英文不好,爬國外的資料也看不太懂。剛好看到其他站有-多旋翼(四軸飛行器) DIY 實作坊 (這邊就不附連結打廣告了),但是價格要3000元。
課綱有包含飛行原理、開發環境建置和刃體編譯、燒錄以及 app 安裝,不知道這樣的價格 ok 值得學嗎?或者有人有上過嗎?謝謝
關於你說得這個課程我是沒上過
但至如果費用裡包含材料費了話
算是合理

飛行原理、開發環境建置和刃體編譯、燒錄以及 app 安裝
其實我個人覺得(刃體編譯)比較需要長時間的研究
至於其他的網路上其是可以找了到

程式編譯的部分其實多看看不同人的打法或找本書來研究(有中文講解)
多少也有幫助

內文搜尋
X
評分
評分
複製連結
Mobile01提醒您
您目前瀏覽的是行動版網頁
是否切換到電腦版網頁呢?