Change Angle Mode maximum angle

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
doppler
Posts: 64
Joined: Wed Sep 26, 2012 1:35 pm

Change Angle Mode maximum angle

Post by doppler »

It has been described that in Angle mode the maximum pitch/roll is 50 degrees in either direction. My quadcopter appears to obey this number fairly well. I'd like to adjust it, make it more tame, say 20 degree's instead, so I can let the kiddies play with the copter a bit with less concern.

Now I could adjust the travel on my sticks, but if I wanted to change it in the code, I think I would want to change;

in MultiWii.ino;

Code: Select all

  for(axis=0;axis<3;axis++) {
    if ((f.ANGLE_MODE || f.HORIZON_MODE) && axis<2 ) { // MODE relying on ACC
      // 50 degrees max inclination
      errorAngle = constrain((rcCommand[axis]<<1) + GPS_angle[axis],-500,+500) - att.angle[axis] + conf.angleTrim[axis]; //16 bits is ok here
      PTermACC = ((int32_t)errorAngle*conf.pid[PIDLEVEL].P8)>>7;                          // 32 bits is needed for calculation: errorAngle*P8[PIDLEVEL] could exceed 32768   16 bits is ok for result
      PTermACC = constrain(PTermACC,-conf.pid[PIDLEVEL].D8*5,+conf.pid[PIDLEVEL].D8*5);


and replace the -500 and +500 in the constrain statement to -200 and + 200? I've written some arduino scripts, but am no way a programmer, understanding the MultiWii code doesn't come easy for me.

Thanks for any help.

Andrew

BradQuick2
Posts: 6
Joined: Wed Apr 17, 2013 1:03 pm

Re: Change Angle Mode maximum angle

Post by BradQuick2 »

As far as I can tell, that would change the maximum angle, but you would only use a small portion of your stick throw. Instead, I think you can change the pitch and roll rate using the config program.

doppler
Posts: 64
Joined: Wed Sep 26, 2012 1:35 pm

Re: Change Angle Mode maximum angle

Post by doppler »

Ah, you're right, I also need to find where the stick input scaling is done as well.... more searching required....

(any hints also appreciated to those in the know)

Thanks
Andrew

Post Reply