RC India
Welcome Guest, please login or register.
 
Pages: [1]   Go Down
0 Members and 1 Guest are viewing this topic. Topic Tools Topic Tools 
Read
« on: February 13, 2018, 11:19:26 PM »
Aravind298
Heli Lover
Forum Veteran
****

Reputation Power: 5 
Aravind298 has no influence.
Offline Offline

City: Chennai
State: Tamil Nadu
RC Skills: Intermediate
Posts: 439
Join Date: Apr, 2016




Hi all!

After building my first assembled drone, which was also my first drone, I wanted to step into making one myself. Right from programming the Flight Controller to fabricating the ESC to 3d-printing the frame.

Fortunately, I was very well helped, and was able to achieve that last year.

And I figure it's time to let everyone who's stuck, to be helped.

Here's an excellent playlist, that I came across while DIYing the Flight Controller.


https://www.youtube.com/playlist?list=PL0K4VDicBzsibZqfa42DVxC8CGCMB7G2G


If anyone happens to develop any doubts or troubles, reach out to me and I'll help you out!



Peace  Hats Off
Logged
 

Read
« Reply #1 on: February 13, 2018, 11:21:27 PM »
Aravind298
Heli Lover
Forum Veteran
****

Reputation Power: 5 
Aravind298 has no influence.
Offline Offline

City: Chennai
State: Tamil Nadu
RC Skills: Intermediate
Posts: 439
Join Date: Apr, 2016



The arduino code is dead easy. It might look a little complex, but after learning the bitwise operators and extensively using the registers, I believe one can easily understand it.

I suggest reading the 'registers' part of the arduino atmega328 while you're going thru the process.
Logged
 

Read
« Reply #2 on: March 16, 2018, 07:47:35 PM »
anilkunchalaece
Heli Lover
Active Member
**

Reputation Power: 1 
anilkunchalaece has no influence.
Offline Offline

City: kadapa
State: Andhra Pradesh
RC Skills: Beginner
Posts: 22
Join Date: Aug, 2017



Hi,

Can you please explain this part of the code ?

    esc_1 = throttle - pid_output_pitch + pid_output_roll - pid_output_yaw; //Calculate the pulse for esc 1 (front-right - CCW)
    esc_2 = throttle + pid_output_pitch + pid_output_roll + pid_output_yaw; //Calculate the pulse for esc 2 (rear-right - CW)
    esc_3 = throttle + pid_output_pitch - pid_output_roll - pid_output_yaw; //Calculate the pulse for esc 3 (rear-left - CCW)
    esc_4 = throttle - pid_output_pitch - pid_output_roll + pid_output_yaw; //Calculate the pulse for esc 4 (front-left - CW)


I didnt get my head around with it.

I didnt understand PID implementation also, but for now iam going with pid library
Logged
 

Read
« Reply #3 on: March 16, 2018, 07:59:13 PM »
Aravind298
Heli Lover
Forum Veteran
****

Reputation Power: 5 
Aravind298 has no influence.
Offline Offline

City: Chennai
State: Tamil Nadu
RC Skills: Intermediate
Posts: 439
Join Date: Apr, 2016



That is the final value given to the motor as output, summing up all the factors.

The '+' and '-' signs are assigned according to the position of the motor.

I suggest you learn the PID first and look at the code.
Logged
 

Read
« Reply #4 on: March 16, 2018, 10:35:55 PM »
Balakrishna Reddy
Plane Lover
Forum Hero
*****

Reputation Power: 8 
Balakrishna Reddy has no influence.
Offline Offline

City: Hyderabad
State: Telangana
RC Skills: Intermediate
Posts: 698
Join Date: Feb, 2015



Hi,

Can you please explain this part of the code ?

    esc_1 = throttle - pid_output_pitch + pid_output_roll - pid_output_yaw; //Calculate the pulse for esc 1 (front-right - CCW)
    esc_2 = throttle + pid_output_pitch + pid_output_roll + pid_output_yaw; //Calculate the pulse for esc 2 (rear-right - CW)
    esc_3 = throttle + pid_output_pitch - pid_output_roll - pid_output_yaw; //Calculate the pulse for esc 3 (rear-left - CCW)
    esc_4 = throttle - pid_output_pitch - pid_output_roll + pid_output_yaw; //Calculate the pulse for esc 4 (front-left - CW)


I didnt get my head around with it.

I didnt understand PID implementation also, but for now iam going with pid library
Thats a very nice question and its very easy to answer, Below is a brief of it.

1. Assume motor positions and directions initially  https://i.ytimg.com/vi/WNqojyFICZQ/maxresdefault.jpg
   I will take image in link as reference
   a. motor 1 -- bottom right rotating CW
   b. motor 2 -- top right rotating CCW
   c. motor 3 -- bottom left rotating CCW
   d. motor 4 -- top left rotating CW

2. Now I will go step by step.
   a) w.r.t Throttle:
         What is the output of all motors with respect to input? It is proportional output irrespective of position. So throttle is positive i.e
         added to outputs
         Now output is
        m4 = +thr
        m2 = +thr
        m3 = +thr
        m1 = +thr
   b) w.r.t Pitch:
         When you increase the pitch to forward i.e you want your model to move forward. What actually goes?
         motors in front(4,2) will slow a bit and back motors(1,3) will speed up a bit. To increase/decrease add/substract pitch input to/from motor.
         m4 = +thr -pitch
         m2 = +thr -pitch
         m3 = +thr +pitch
         m1 = +thr +pitch
   c) w.r.t Roll:
         When you increase the Roll i.e you want to go right what exactly happens?
         Motor on right i.e (2,1) will slow a bit and motors left(3,4) will speed up a bit. To do this follow above step. Add/substract from output of motor.
         m4 = +thr  -pitch  +Roll
         m2 = +thr  -pitch   -Roll
         m3 = +thr +pitch  +Roll
         m1 = +thr +pitch   -Roll

   d) w.r.t yaw:
         I hope you have already understood the entire logic and you won't really read this. So I skip this. sorry Grin Grin


This is the very basic and you may have to sometimes reverse the inputs depending on how the value changes for direction of stick movement. This is called stick reversing or something similar.


Logged
 

Read
« Reply #5 on: March 17, 2018, 12:29:45 AM »
AL HAM SHARI
Plane Lover
Forum Hero

*****

Reputation Power: 7 
AL HAM SHARI has no influence.
Offline Offline

State: Kerala
RC Skills: Not into RC
Posts: 541
Join Date: Nov, 2012

RC



Bro, You did an awesome job. Even if it's easy for you, You can now proudly say that you technically built a quad rather than assembling.😁
Logged

A Dozen Scratch Built Models , 
VT-Speedster Pro
55' UAV Wing
Model  Rocketry
 

Read
« Reply #6 on: March 17, 2018, 07:14:06 PM »
anilkunchalaece
Heli Lover
Active Member
**

Reputation Power: 1 
anilkunchalaece has no influence.
Offline Offline

City: kadapa
State: Andhra Pradesh
RC Skills: Beginner
Posts: 22
Join Date: Aug, 2017



@Balakrishna Reddy
Thankyou so much for clear explanation.

My Build is Faling  to TakeOff - it is Tilting to one side and flipping.
Find the Video

Things I checked :
            Motor Directions
            Propeller Directions
            MPU 6050 Calibration

Is there any other things i need to check ? Head Scratching

I am able to see modified motor values from PID loop - but dont know are they enough to prevent tilting  Bang Head.

Quad Configuration :
NTM Prop 28-26 1000kv motors
2200mah 3s battery
afro 20A esc's
Arduino Uno
MPU 6050 with i2c dev Library
Pid_V1 library

Logged
 

Read
« Reply #7 on: March 17, 2018, 07:52:48 PM »
Aravind298
Heli Lover
Forum Veteran
****

Reputation Power: 5 
Aravind298 has no influence.
Offline Offline

City: Chennai
State: Tamil Nadu
RC Skills: Intermediate
Posts: 439
Join Date: Apr, 2016



Hey! It seems the props are spinning in the wrong direction, actually, it's definite that the props are spinning to the full motor RPM, from the sound captured.

Also, post the size of the propeller that you're using. That might be another reason.


BTW, that's an excellent explanation from Bala. Hats off to that  Hats Off
Logged
 

Read
« Reply #8 on: March 20, 2018, 01:31:27 AM »
Erpoyo
Plane Lover
Active Member

**

Reputation Power: 1 
Erpoyo has no influence.
Offline Offline

City: Dublin Ireland
State: OUTSIDE INDIA
RC Skills: Intermediate
Posts: 23
Join Date: Aug, 2017



There is nothing worse than building your first quad and think you have it all right.. and BUMB flipping on take off..  Giggle Giggle

That actually happened to me and created a video on 5 different things that could be causing the issue





Hope this helps!!
Logged

Check my channel for videos on how to build your own quadcopter:

 

Pages: [1]   Go Up
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Mini quadcopter with arduino
Multirotors
shivela39 5 4552 Last post September 02, 2013, 10:46:18 AM
by manojswizera
How to Build an Ultra Mini Quadcopter using Arduino or without it....?
Beginners Zone
RachitEliite 7 8674 Last post September 28, 2013, 06:00:12 AM
by lastRites
arduino multiwii quadcopter not getting armed
Chatter Zone
taksh 0 1232 Last post June 01, 2018, 10:02:53 PM
by taksh
Issues regarding pre-programmed Arduino micro Quadcopter flight
Multirotors
sainatarajan 3 1625 Last post December 24, 2018, 02:33:15 PM
by sainatarajan
Arduino Quadcopter Unable to fly
RC India Forum
Sunveer 8 6866 Last post February 11, 2022, 04:24:08 PM
by K K Iyer