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: May 09, 2012, 07:51:26 PM »
nehasha187
Plane Lover
Active Member
**

Reputation Power: 1 
nehasha187 has no influence.
Offline Offline

City: sonepat
State: Haryana
RC Skills: Beginner
Posts: 20
Join Date: Apr, 2012




anyone who has successfully completed a quadcopter..please help...i have checked every module namely,
gps, gyroscope + accelerometer, controlling individually. for controlling i am not sure what values (maximum and minimum) for raw, pitch, yaw to have a stable flight. help. its urgent
Logged
 

Read
« Reply #1 on: May 09, 2012, 08:10:17 PM »
sajid6300shaikh
Plane Lover
Senior Member

***

Reputation Power: 3 
sajid6300shaikh has no influence.
Offline Offline

City: nasik
State: Maharashtra
RC Skills: Beginner
Posts: 161
Join Date: Mar, 2012



well there are no pre defined values for roll, pitch and yaw gain. that's why they provide a preset to adjust these according to our setup.
you need to find the values by trial and error method, on very low throttle, coz u don't want to break your props..  Grin
go according to the manual and u'll figure out..
Logged
 

Read
« Reply #2 on: May 09, 2012, 08:15:16 PM »
spitfire
Plane Lover
Forum Hero
*****

Reputation Power: 7 
spitfire has no influence.
Offline Offline

City: Bengaluru
State: Karnataka
RC Skills: Advanced
Posts: 506
Join Date: Jul, 2010



Which control board are you using?
Logged
 

Read
« Reply #3 on: May 09, 2012, 08:16:31 PM »
hyd_quads
Plane Lover
Forum Hero
*****

Reputation Power: 9 
hyd_quads has no influence.
Offline Offline

City: Hyderabad
State: Andhra Pradesh
RC Skills: Beginner
Posts: 761
Join Date: Sep, 2011



Which board are you using? I suppose it's a standalone board, using some sized arduino (pro mini or nano?) Which firmware are you running?
Which gyros and acc? (nunchuk and WM+?) or other ITG32XX series gyros and BMA18X acc? Specify so that others can figure the sol. out.
Logged
 

Read
« Reply #4 on: May 09, 2012, 08:45:34 PM »
nehasha187
Plane Lover
Active Member
**

Reputation Power: 1 
nehasha187 has no influence.
Offline Offline

City: sonepat
State: Haryana
RC Skills: Beginner
Posts: 20
Join Date: Apr, 2012



Which control board are you using?
i designed the board myself according to my requirements. i am using PIC18F4520 microcontroller. In pid tuning of quadcopter, we need to set the output limits for throttle, pitch, yaw and roll and based on the tilting requirement the maximum and minimum values for all these are chosen in order to have a safe flight. with implementation of kalman filter i am able to get angles from -90 to 90 degree. i am posting my code. i am just a beginner so correct me if i have made any mistakes. thank you

#ifndef pidquadchanges
#define pidquadchanges
#define throttle 0
#define roll 1
#define pitch 2
#define yaw 3
// for yaw we apply only the user yaw
//unsigned int count; this variable stores the current time
// setpoints are data of sensors, input are data from my remote(designed according to my requirement) and output is used for setting the values of timers which are generating pwm for bldc motors

// variables used in calculating final throttle of all the motors
   #pragma udata my_section_1      //this was necessary otherwise some error was there see word file error on pid quad
   unsigned lasttime=0;
   // already defined in recievespi module   float input[6],setpoint[3],output[4];
   float error[3],dinput[3];      //output 4 as yaw is another output that is not calculated here but applied directly
   float iterm[3],lastinput[3],min[4],max[4];
   #pragma udata my_section_2
   float KP[3],KI[3],KD[3];
   float kp[4]={0,1.8,1.8,3.6},ki[4]={0,0.48,0.48,1.2},kd[4]={0,0.30,0.30,0.15};
   int sampletime=1000;   //1 sec
   float outmax[3],outmin[3];
   unsigned int d;
   unsigned inauto=0;
void compute(void);
void setoutputlimits();
void initialize(void);

void compute() // this is the comput function
{
   //if(!inauto)   return;   //manual mode and hence no pid tuning inauto needs to be connected to any pin of microcontroller
   setpoint[0]=output[0];
   d=0;
   while(d<3)
      {
      unsigned int now=count;      //here the value of count is to be assigned
      int timechange=(now-lasttime);
      if(timechange>=sampletime)
         {
         //compute all the working variable errors
         error[d]=setpoint[d]-input[d];
         iterm[d]+=(ki[d]*error[d]);
         if(iterm[d]>outmax[d]) iterm[d]=outmax[d];
         else if(iterm[d]<outmin[d]) iterm[d]=outmin[d];
         dinput[d]=(input[d]-lastinput[d]);
         //compute pid output
         output[d] = kp[d]*error[d]+iterm[d]-kd[d]*dinput[d];
         //remember some variables for the next time
         lastinput[d]=input[d];
         lasttime=now;   
         d++;      
         }
      }
      setpoint[0]=output[0];      //assigning throttle for the next time
}
be limited to min and max
{
   if(min[d] > max[d]) return;
   outmin[d] = min[d];
   outmax[d] = max[d];

   if(output[d] > outmax[d]) output[d] = outmax[d];
   else if(output[d] < outmin[d]) output[d] = outmin[d];

   if(iterm[d]> outmax[d]) iterm[d]= outmax[d];
   else if(iterm[d]< outmin[d]) iterm[d]= outmin[d];
   d++;
}
}

void setmode(int mode)
{
   char newauto = (mode == automatic);
   if(newauto && !inauto)
   {  /*we just went from manual to auto*/
      initialize();
   }
   inauto = newauto;
}

void initialize()
{
d=0;
while(d<3)
{
   lastinput[d] = input[d];
   iterm[d] = output[d];
   if(iterm[d]> outmax[d]) iterm[d]= outmax[d];
   else if(iterm[d]< outmin[d]) iterm[d]= outmin[d];
   d++;
}
}
#endif


help please
Logged
 

Read
« Reply #5 on: May 09, 2012, 08:49:16 PM »
nehasha187
Plane Lover
Active Member
**

Reputation Power: 1 
nehasha187 has no influence.
Offline Offline

City: sonepat
State: Haryana
RC Skills: Beginner
Posts: 20
Join Date: Apr, 2012



due to budget problems i am not able to employ manetometer so my quad can change only pitch and roll not yaw. if user wants to change the yaw angle then it is directly used in calcaluting pwm for the motors.
« Last Edit: May 10, 2012, 02:14:34 PM by SunLikeStar » Logged
 

Read
« Reply #6 on: May 09, 2012, 08:55:45 PM »
nehasha187
Plane Lover
Active Member
**

Reputation Power: 1 
nehasha187 has no influence.
Offline Offline

City: sonepat
State: Haryana
RC Skills: Beginner
Posts: 20
Join Date: Apr, 2012



Which board are you using? I suppose it's a standalone board, using some sized arduino (pro mini or nano?) Which firmware are you running?
Which gyros and acc? (nunchuk and WM+?) or other ITG32XX series gyros and BMA18X acc? Specify so that others can figure the sol. out.
3 axis gyroscope and accelerometer from nex-robotics and i designed the control board myself.
Logged
 

Read
« Reply #7 on: May 10, 2012, 12:20:05 PM »
nehasha187
Plane Lover
Active Member
**

Reputation Power: 1 
nehasha187 has no influence.
Offline Offline

City: sonepat
State: Haryana
RC Skills: Beginner
Posts: 20
Join Date: Apr, 2012



can anyone help?Huh?
Logged
 

Read
« Reply #8 on: May 10, 2012, 05:47:21 PM »
RotorZone
Forum Administrator
Forum Hero

*****

Reputation Power: 8 
RotorZone has no influence.
Offline Offline

City: Bangalore
State: Karnataka
RC Skills: Advanced
Posts: 607
Join Date: Mar, 2009

RotorZone.com



The ESCs accept standard servo pulse of 1-2ms.

Near 1ms the ESCs shut down and go into start up mode. Start up is slow, so you'd want to avoid going there in flight. The start up point will vary with different brands of ESCs. You could try 1.2ms as a initial value and then increase it if needed.

Most ESCs learn the high limit at power on, you should have provision for that in your code.

Other than this I don't think you need a specific limit for stable mode. I haven't worked on any quad code myself, so you could get better and faster answers if you go through code of projects like multiwii, mikrokopter, ardupilot etc. They are open source.
Logged

 

Read
« Reply #9 on: May 11, 2012, 06:46:05 PM »
nehasha187
Plane Lover
Active Member
**

Reputation Power: 1 
nehasha187 has no influence.
Offline Offline

City: sonepat
State: Haryana
RC Skills: Beginner
Posts: 20
Join Date: Apr, 2012



i have successfully generated pwm for the four motors and tested it as well....but that is not the issue...i am facing problem in balancing my quad..just want to know what should be the gains for roll, pitch and yaw and also what percentage of them is to be added to throttle of motors.
Logged
 

Read
« Reply #10 on: May 11, 2012, 06:56:02 PM »
satyagupta
Heli Lover
Forum Hero

*****

Reputation Power: 29 
satyagupta barely matters.satyagupta barely matters.
Offline Offline

City: Navi Mumbai
State: Maharashtra
RC Skills: Beginner
Posts: 2565
Join Date: Mar, 2012



Start with 40%-50% and keep increasing or decreasing it..

Decrease or increase your pitch/roll gain until it starts oscillating, once starts decrease it back to previous value.
Logged

 

Pages: [1]   Go Up
Jump to:  

Related Topics
Subject Started by Replies Views Last post
quadcopter stability problem
Multirotors
sathish kumar 8 4418 Last post October 08, 2013, 02:16:41 PM
by sathish kumar
quadcopter yaw problem
Multirotors
rustydusty 2 3340 Last post September 14, 2014, 08:33:09 AM
by rustydusty
Quadcopter Motor/ESC problem
Multirotors
rameshgoud 19 9596 Last post October 16, 2014, 12:35:38 PM
by SideWinder
quadcopter takeoff problem « 1 2  All »
Beginners Zone
anis jayaram 29 17469 Last post December 19, 2014, 12:36:47 PM
by phanivyas
quadcopter controlling using android
Multirotors
abhinavbhopal26 10 7398 Last post July 28, 2016, 02:23:04 AM
by Akshay N