視頻時間
2.飛機主體的搭建制作:4:50
制作需要準備
2 x Arduino Nano
1 x NRF24L01 + PA 無線收發模塊
1 x NRF24L01 無線收發模塊
2 x Arduino joystick
2 x 100uF 電容 (16V 以上)
1 x 13 * 6 cm PCB 電木板
1 x 5 * 3.5 cm PCB 電木板
3 x SG90 舵機
1 x 20A ESC 電子調速器
2 x 7.4V 450Mah 2S 鋰電池
1 x DC 180 Motor 39000 RPM 電機+螺旋槳
5mmKT板/泡沫板/雪弗板
舵機夾頭、金屬調節器、1mm鐵絲
視頻內容
今天就給大家分享一個油管上KendinYap,K大的Arduino的低成本無線遙控飛機,總共材料費用是在100元左右。
除了遙控飛機,今天介紹的制作方式也可以應用在制作無人機、遙控車、遙控船這類東西,解說分成遙控器跟飛機兩部分。
遙控器能夠控制3個舵機跟1個直流電機,這里的控制主板選用的是Arduino Nano,應該是為了降低成本,因為遙控器本身需要連接的電子元件并不多,控制飛機用了兩個Joystick搖桿、一個NRF24L01PA的大功率無線收發模塊、一個100微法的電容、1個7.4V的鋰電池。
飛機上使用的一樣是Arduino Nano,3個SG90舵機、1個39000轉的直流電機、100微法的電容、一個30A雙向有刷電調,1個NRF24L01無線收發模塊,一個7.4V鋰電池。
機身的尺寸是45.3厘米,屬于偏迷你大小的飛機,這里制作采用的是泡沫板/PVC板/雪弗板/KT板,使用熱熔膠槍粘合。
連桿機構使用了舵機夾頭跟金屬調節器。
遙控器電路圖
遙控器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));}?
飛機上的電路主板也是用Arduino Nano,3個SG90舵機、1個39000轉的直流電機、100微法的電容、一個30A雙向有刷電調,1個NRF24L01無線收發模塊,一個7.4V鋰電池。
飛機控制電路圖
飛機控制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);}
審核編輯黃宇
-
遙控
+關注
關注
11文章
285瀏覽量
57371 -
RC
+關注
關注
0文章
227瀏覽量
48819 -
Arduino
+關注
關注
188文章
6469瀏覽量
187068
發布評論請先 登錄
相關推薦
評論