視頻時(shí)間
1.遙控器與飛機(jī)的電子設(shè)計(jì)與編程:0:45
2.飛機(jī)主體的搭建制作:4:50
制作需要準(zhǔn)備
2 x Arduino Nano
1 x NRF24L01 + PA 無(wú)線收發(fā)模塊
1 x NRF24L01 無(wú)線收發(fā)模塊
2 x Arduino joystick
2 x 100uF 電容 (16V 以上)
1 x 13 * 6 cm PCB 電木板
1 x 5 * 3.5 cm PCB 電木板
3 x SG90 舵機(jī)
1 x 20A ESC 電子調(diào)速器
2 x 7.4V 450Mah 2S 鋰電池
1 x DC 180 Motor 39000 RPM 電機(jī)+螺旋槳
5mmKT板/泡沫板/雪弗板
舵機(jī)夾頭、金屬調(diào)節(jié)器、1mm鐵絲
視頻內(nèi)容
今天就給大家分享一個(gè)油管上KendinYap,K大的Arduino的低成本無(wú)線遙控飛機(jī),總共材料費(fèi)用是在100元左右。
除了遙控飛機(jī),今天介紹的制作方式也可以應(yīng)用在制作無(wú)人機(jī)、遙控車、遙控船這類東西,解說(shuō)分成遙控器跟飛機(jī)兩部分。
遙控器能夠控制3個(gè)舵機(jī)跟1個(gè)直流電機(jī),這里的控制主板選用的是Arduino Nano,應(yīng)該是為了降低成本,因?yàn)檫b控器本身需要連接的電子元件并不多,控制飛機(jī)用了兩個(gè)Joystick搖桿、一個(gè)NRF24L01PA的大功率無(wú)線收發(fā)模塊、一個(gè)100微法的電容、1個(gè)7.4V的鋰電池。
飛機(jī)上使用的一樣是Arduino Nano,3個(gè)SG90舵機(jī)、1個(gè)39000轉(zhuǎn)的直流電機(jī)、100微法的電容、一個(gè)30A雙向有刷電調(diào),1個(gè)NRF24L01無(wú)線收發(fā)模塊,一個(gè)7.4V鋰電池。
機(jī)身的尺寸是45.3厘米,屬于偏迷你大小的飛機(jī),這里制作采用的是泡沫板/PVC板/雪弗板/KT板,使用熱熔膠槍粘合。
連桿機(jī)構(gòu)使用了舵機(jī)夾頭跟金屬調(diào)節(jié)器。
遙控器電路圖
遙控器Arduino代碼
// 4 Channel Transmitter | 4 Kanal Verici #include #include #include const uint64_t pipeOut = 0xE9E8F0F0E1LL; //IMPORTANT: The same as in the receiver 0xE9E8F0F0E1LL | Bu adres al?c? ile ayn? olmal?RF24 radio(7, 8); // select CE,CSN pin | CE ve CSN pinlerin se?imi struct Signal {byte throttle;byte pitch;byte roll;byte yaw;}; Signal data; void ResetData(){data.throttle = 127; // Motor Stop (254/2=127)| Motor Kapal? (Signal lost position | sinyal kesildi?indeki pozisyon)data.pitch = 127; // Center | Merkez (Signal lost position | sinyal kesildi?indeki pozisyon)data.roll = 127; // Center | merkez (Signal lost position | sinyal kesildi?indeki pozisyon)data.yaw = 127; // Center | merkez (Signal lost position | sinyal kesildi?indeki pozisyon)} void setup(){//Start everything up radio.begin();radio.openWritingPipe(pipeOut);radio.stopListening(); //start the radio comunication for Transmitter | Verici olarak sinyal ileti?imi ba?lat?l?yorResetData();} // Joystick center and its borders | Joystick merkez ve s?n?rlar? int mapJoystickValues(int val, int lower, int middle, int upper, bool reverse){val = constrain(val, lower, upper);if ( val < middle )val = map(val, lower, middle, 0, 128);elseval = map(val, middle, upper, 128, 255);return ( reverse ? 255 - val : val );} void loop(){// Control Stick Calibration | Kumanda Kol Kalibrasyonlar?// Setting may be required for the correct values of the control levers. | Kollar?n do?ru de?erleri i?in ayar gerekebilir. data.throttle = mapJoystickValues( analogRead(A0), 524, 524, 1015, true );data.roll = mapJoystickValues( analogRead(A1), 12, 524, 1020, true ); // "true" or "false" for servo direction | "true" veya "false" servo y?nünü belirlerdata.pitch = mapJoystickValues( analogRead(A2), 12, 524, 1020, true ); // "true" or "false" for servo direction | "true" veya "false" servo y?nünü belirlerdata.yaw = mapJoystickValues( analogRead(A3), 12, 524, 1020, true ); // "true" or "false" for servo direction | "true" veya "false" servo y?nünü belirler radio.write(&data, sizeof(Signal));}?
飛機(jī)上的電路主板也是用Arduino Nano,3個(gè)SG90舵機(jī)、1個(gè)39000轉(zhuǎn)的直流電機(jī)、100微法的電容、一個(gè)30A雙向有刷電調(diào),1個(gè)NRF24L01無(wú)線收發(fā)模塊,一個(gè)7.4V鋰電池。
飛機(jī)控制電路圖
飛機(jī)控制Arduino代碼
// 4 Channel Receiver | 4 Kanal Al?c?// PWM output on pins D2, D3, D4, D5 (??k?? pinleri) #include #include #include #include int ch_width_1 = 0;int ch_width_2 = 0;int ch_width_3 = 0;int ch_width_4 = 0; Servo ch1;Servo ch2;Servo ch3;Servo ch4; struct Signal {byte throttle;byte pitch;byte roll;byte yaw;}; Signal data; const uint64_t pipeIn = 0xE9E8F0F0E1LL;RF24 radio(7, 8); void ResetData(){// Define the inicial value of each data input. | Veri giri?lerinin ba?lang?? de?erleri// The middle position for Potenciometers. (254/2=127) | Potansiyometreler i?in orta konumdata.throttle = 127; // Motor Stop | Motor Kapal?data.pitch = 127; // Center | Merkezdata.roll = 127; // Center | Merkezdata.yaw = 127; // Center | Merkez} void setup(){ //Set the pins for each PWM signal | Her bir PWM sinyal i?in pinler belirleniyor. ch1.attach(2); ch2.attach(3); ch3.attach(4); ch4.attach(5); //Configure the NRF24 module ResetData(); radio.begin(); radio.openReadingPipe(1,pipeIn); radio.startListening(); //start the radio comunication for receiver | Al?c? olarak sinyal ileti?imi ba?lat?l?yor} unsigned long lastRecvTime = 0; void recvData(){while ( radio.available() ) {radio.read(&data, sizeof(Signal));lastRecvTime = millis(); // receive the data | data al?n?yor}} void loop(){recvData();unsigned long now = millis();if ( now - lastRecvTime > 1000 ) {ResetData(); // Signal lost.. Reset data | Sinyal kay?psa data resetleniyor} ch_width_1 = map(data.throttle, 0, 255, 1000, 2000); // pin D2 (PWM signal)ch_width_2 = map(data.pitch, 0, 255, 1000, 2000); // pin D3 (PWM signal)ch_width_3 = map(data.roll, 0, 255, 1000, 2000); // pin D4 (PWM signal)ch_width_4 = map(data.yaw, 0, 255, 1000, 2000); // pin D5 (PWM signal) // Write the PWM signal | PWM sinyaller ??k??lara g?nderiliyorch1.writeMicroseconds(ch_width_1);ch2.writeMicroseconds(ch_width_2);ch3.writeMicroseconds(ch_width_3);ch4.writeMicroseconds(ch_width_4);}
審核編輯黃宇
-
遙控
+關(guān)注
關(guān)注
11文章
282瀏覽量
57317 -
RC
+關(guān)注
關(guān)注
0文章
224瀏覽量
48726 -
Arduino
+關(guān)注
關(guān)注
187文章
6457瀏覽量
186502
發(fā)布評(píng)論請(qǐng)先 登錄
相關(guān)推薦
評(píng)論