rx stick calibration

Post Reply
User avatar
alll
Posts: 220
Joined: Fri Dec 07, 2012 9:53 am

rx stick calibration

Post by alll »

Happy new year!

Idea is to avoid setting the endpoints of transmitter to "1000" ... "2000" in the gui.
We “assume” then throttle(1000)-pitch(1500)=500 msec, read the real values, make the ratio...

To do so, a transmitter calibration has to be done once.
During calibration, throttle at low position (=1000), yaw, pitch and elevator at center (=1500). The calibration procedure reads the rx values, calculates the offset and stores the rx ratio. Later, this ratio is multiplied with the read rx-values.
This way, in code we can assume 1000-2000 rx inputs.

Manu

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: rx stick calibration

Post by Hamburger »

probably not good. For experiment make up a number out of [1000;2000] and then try to move any of your tx sticks until the corresponding value in the MWii gui is equal to that number.
Soem things to consider:
- you want maximum resolution (distinguishable steps) on the tx-rx side; if your tx emits only say [1300;1700] and your modified software in MWii would map that to the [1000;2000] range you would have even less resolution than you have nowadays.
- you must not exceed this [1000;2000] range, otherwise it may corrupt the joint wireless signal, making separate channels no longer distinguishable; then you have a failsafe condition.

I agree it is tedious to setup properly; but with typical limited hardware it is worth it.

User avatar
alll
Posts: 220
Joined: Fri Dec 07, 2012 9:53 am

Re: rx stick calibration

Post by alll »

Thanks for your input,

We assume the transmitter as a reference for rx signal lengths. This suppose that transmitter has all values by default, so we will "never" ;) exceed the "1000" msec range!
So for example throttle reads 1020, pitch/roll/yaw averaged 1530 => diff=510 (if the difference between throttle and p/r/y not near +-500, or throttle +-1000, you have a problem with your transmitter anyway!).

Calibration :
check throttle = "1000" (+-20)
check thr-avg(r/p/y)="500" (+-20)
ratio ("500"/(1530-1020))
rx p/r/y = rxvalue*ratio-"500"
rx offsets thr = rxvalue*ratio-"1000"


If mwii does not support signals longer then 2000 msec, a proper rx calibration would be a nice to have.
* power up board,
* wait for rx inputs 1000-2000 (+-20) for all channels (loop until no stick movement and all channels +-1000 range),
* calibrate rx
* ready to arm

manu
PS: taking the rx as a clock reference, we could overclock the mcu, and multiply all read rx timings by the ratio..., your radio is the "clock reference"

User avatar
alll
Posts: 220
Joined: Fri Dec 07, 2012 9:53 am

Re: rx stick calibration

Post by alll »

I really want to get my esc's calibrated correctly BASED ON THROTTLE STICK POSITION and not on "real" timings !!!...

If in the gui i see for throttle min:1065 and max:2003
Then i set ?:

Code: Select all

    #define MINTHROTTLE 1000
    #define MAXTHROTTLE 1997
    #define MINCOMMAND  935

And apparently the rx setup in gui you are suppose NEVER to get lower then 1000 or higher then 2000! :shock:

Sorry to say, but it is really confusing, i really need to have a better understanding of the code logic (main loop).

manu

sorg
Posts: 34
Joined: Mon Apr 08, 2013 2:49 pm

Re: rx stick calibration

Post by sorg »

alll wrote:Happy new year!

Idea is to avoid setting the endpoints of transmitter to "1000" ... "2000" in the gui.
We “assume” then throttle(1000)-pitch(1500)=500 msec, read the real values, make the ratio...

To do so, a transmitter calibration has to be done once.
During calibration, throttle at low position (=1000), yaw, pitch and elevator at center (=1500). The calibration procedure reads the rx values, calculates the offset and stores the rx ratio. Later, this ratio is multiplied with the read rx-values.
This way, in code we can assume 1000-2000 rx inputs.

Manu


I support this idea.

I have a crappy transmitter with some channels shifted (fo example throttle cover a range from 900 to 1850... even with maximum trimming...). That means that i have a dead zone at low throttle, and i can't reach maximum throttle. That would be good to be able to compensate that on multiwii side.

Mis
Posts: 203
Joined: Fri Apr 01, 2011 12:23 am

Re: rx stick calibration

Post by Mis »

This is not standard behaviour. Do it yourself in Your private code.
In RX.ino in function "uint16_t readRawRC(uint8_t chan)" add few lines just lines before "return data; // We return..."

Code: Select all

if(chan == THROTTLE) data += 125;      // add 125 to throttle
if(chan == ROLL)     data -= 25;       // substract 25 from ROLL channel

ect, ect.

Post Reply