dynThrPID and MIDRC

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
User avatar
kos
Posts: 286
Joined: Thu Feb 16, 2012 4:51 am
Location: Fr

dynThrPID and MIDRC

Post by kos »

Code: Select all

//PITCH & ROLL only dynamic PID adjustemnt,  depending on throttle value
  if      (rcData[THROTTLE]<1500) prop2 = 100;
  else if (rcData[THROTTLE]<2000) prop2 = 100 - (uint16_t)dynThrPID*(rcData[THROTTLE]-1500)/500;
  else                            prop2 = 100 - dynThrPID;

should use

Code: Select all

#define MIDRC 1500


or something like

Code: Select all

#define HOVER MIDRC+THRoffest

User avatar
kos
Posts: 286
Joined: Thu Feb 16, 2012 4:51 am
Location: Fr

Re: dynThrPID and MIDRC

Post by kos »

Code: Select all

if (900<dTime && dTime<2200) rcValue[0] = dTime; // just a verification: the value must be in the range [1000;2000] + some margin


Code: Select all

if ((sbus[23]) & 0x0001)       rcValue[16] = 2000; else rcValue[16] = 1000;


should use define for those range .. duplicate static string is bad

Post Reply