imawolfking / ardupirates

Automatically exported from code.google.com/p/ardupirates
0 stars 0 forks source link

FLIGHT_MODE_X control range #9

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

When using FLIGHT_MODE_X, motors receive +/-control_roll +/- control_pitch. 

This means that the cyclic control range is twice as large as for + mode or 
FLIGHT_MODE_X_45Degree, and all PID settings and internal limits need to be 
reduced accordingly.

Just a suggestion, but IMO it's better to divide the cyclic control by 2 in 
motors.pde. I'm using this on my quad:

int half_control_roll_plus_pitch, half_control_roll_minus_pitch;
...
half_control_roll_plus_pitch = (control_roll + control_pitch) / 2;
half_control_roll_minus_pitch = (control_roll - control_pitch) / 2;

rightMotor = constrain(throttle - half_control_roll_minus_pitch + control_yaw, 
minThrottle, 2000); // Right motor
leftMotor = constrain(throttle + half_control_roll_minus_pitch + control_yaw, 
minThrottle, 2000);  // Left motor
frontMotor = constrain(throttle + half_control_roll_plus_pitch - control_yaw, 
minThrottle, 2000); // Front motor
backMotor = constrain(throttle - half_control_roll_plus_pitch - control_yaw, 
minThrottle, 2000);  // Back motor

Original issue reported on code.google.com by patrick....@gmail.com on 13 Jan 2011 at 11:29

GoogleCodeExporter commented 9 years ago
can u post your motor.pde?
where do u exactly insert:

int half_control_roll_plus_pitch, half_control_roll_minus_pitch;

and:

half_control_roll_plus_pitch = (control_roll + control_pitch) / 2;
half_control_roll_minus_pitch = (control_roll - control_pitch) / 2;

Original comment by wart...@googlemail.com on 13 Jan 2011 at 9:26

GoogleCodeExporter commented 9 years ago
i changed it in the motors.pde like this:

void motor_output()
{
  int throttle;
  int half_control_roll_plus_pitch, half_control_roll_minus_pitch;
  byte throttle_mode=0;

  throttle = ch_throttle;
  #if (defined(UseBMP) || defined(IsSONAR))
  if (AP_mode == AP_ALTITUDE_HOLD || AP_mode == AP_ALT_GPS_HOLD)
  {
    throttle = ch_throttle_altitude_hold;
    throttle_mode=1;
  }
  #endif

......

#ifdef FLIGHT_MODE_X      
          // For X mode - APM front between front and right motor

          half_control_roll_plus_pitch = (control_roll + control_pitch) / 2;
          half_control_roll_minus_pitch = (control_roll - control_pitch) / 2;

          rightMotor = constrain(throttle - half_control_roll_minus_pitch + control_yaw, minThrottle, 2000); // Right motor
          leftMotor = constrain(throttle + half_control_roll_minus_pitch + control_yaw, minThrottle, 2000);  // Left motor
          frontMotor = constrain(throttle + half_control_roll_plus_pitch - control_yaw, minThrottle, 2000); // Front motor
          backMotor = constrain(throttle - half_control_roll_plus_pitch - control_yaw, minThrottle, 2000);  // Back motor

now the quad is stable! that was my problem. thanks for your info. hein should 
implement this in the code.

Original comment by wart...@googlemail.com on 13 Jan 2011 at 10:53

GoogleCodeExporter commented 9 years ago
Hi Patrick,

Thanx for the feedback.  I think you have a point, because in plus mode its 
always just 2 x motor involved in either roll or pitch but in Xmode you have 
all 4 motors involve in a pitch or roll change.  Maybe even the stick control 
will be harder in Xmode.

I think you mentioned this before.  I will look into this.

Greetings,
Hein

Original comment by lohnieh@gmail.com on 14 Jan 2011 at 10:47

GoogleCodeExporter commented 9 years ago
Hi Warthox,Patrick.

Please email me lohnieh@gmail.com your complete firmware (your setup).

How is your APM installed on your Quad.  Front facing front motor or APM front 
between Front and Right motor?

Greetings,
Hein

Original comment by lohnieh@gmail.com on 16 Jan 2011 at 1:49

GoogleCodeExporter commented 9 years ago
The new code has been implemeted in current Hein's branch (ArdupiratesNG).
PLease test and leave comments.
Emile

Original comment by emile.ca...@gmail.com on 19 Jan 2011 at 1:21

GoogleCodeExporter commented 9 years ago
i tried to update the code yesterday via svn but i cant complete it.

everytime i get this error message: 

Error: URL 'http://arducopter.googlecode.com/svn/trunk/libraries/APM_RC' of 
existing   
Error: directory 'C:\Arducopter\updates   
Error: svn\branches\Hein\Quad\ArduPiratesNG\libraries\APM_RC' does not match 
expected   
Error: URL 
'http://ardupirates.googlecode.com/svn/branches/Hein/Quad/ArduPiratesNG/librarie
s/APM_RC'  

Original comment by wart...@googlemail.com on 19 Jan 2011 at 5:08

GoogleCodeExporter commented 9 years ago
You have to use the https:// and have to be granted by Kinderkram if you are 
not already.
E.

Original comment by emile.ca...@gmail.com on 19 Jan 2011 at 8:58

GoogleCodeExporter commented 9 years ago
Nope, that's not the reason. Delete all folders in the libraries folder and 
start an update again. Anyone can download the whole stuff from her like I 
described on my blog:
http://www.rcgroups.com/forums/showpost.php?p=17131788&postcount=4059

Original comment by kinderkram@gmail.com on 20 Jan 2011 at 5:17

GoogleCodeExporter commented 9 years ago
Hello,
I have my quad set with the APM facing the front motor, and I'm trying to fly 
it in x mode, so the manual says to just set the DIP1 swithch up. But nothing 
happens. It's still in + mode. What I'm I doing wrong?
Thank you.
Jose

Original comment by josebue...@yahoo.com on 17 Mar 2011 at 1:54