Find more videos like this on DIY Drones
Here is the solution:In the 2.0 code, try this:Reverse IR sensor-old code-return constrain((int)(((infrared0-511)*90)/max_ir),-60,60);new code-return -constrain((int)(((infrared0-511)*90)/max_ir),-60,60);Reverse IR sensor pitch-old code-return -constrain((int)(((infrared1-511)*90)/max_ir),-60,60);new code-return constrain((int)(((infrared1-511)*90)/max_ir),-60,60);Just reverse the sign in front of "constrain".
Comments
For do that, you have to change the source code.
In the code:
int get_pitch(void)
{
return -constrain((int)(((infrared1-511)*90)/max_ir),-60,60);
}
you have to put
int get_pitch(void)
{
return constrain((int)(((infrared1-511)*90)/max_ir),-60,60);
}
it should work
About the FMA sensor, i believe, every time you fly, you need to calibrate the sensor. If you don't do that, you can have wrong angles. Because in a sunny day, the max_ir is much more high than in a cloudy day.
I really don't know if in high altitude, like when the plane is flying, if this differences are minimal.
How to do?
Also having problem making the FMA sensor working first time, can see other having same problem.
Please don't tell me to reverse the FMA sensor.
Nice looking plane and a nice Ardupilot installation!
Regards,
TCIII