kkbin505 / Arduino-Transmitter-for-ELRS

Arduino based RC transmitter for ELRS external TX Module
GNU General Public License v3.0
212 stars 47 forks source link

Calibration Added #5

Closed erstec closed 2 years ago

erstec commented 2 years ago

Need to be tested!

Workflow:

  1. AUX1 (Arm) in DISARMED
  2. Switch AUX2 5 times in 5 seconds
  3. LED and BEEPER confirms entering calibration
  4. 15 seconds to move sticks
  5. Confirmation beep/led
  6. Constants are saved to EEPROM and will be loaded at startup.
kkbin505 commented 2 years ago

First, thanks for update the code, this is the first pull I have received. The calibration is the function I'm struggled to implement, and your ideal is amazing. Just on question : The center stick postion is caculated from 1/2 min + max, if the stick travel is unever from min to center and center to max , the center stick will drift.

erstec commented 2 years ago

Center is not calculated as it was not required in your implemetation, only min and max values are measured and stored during "calibration". centerValue are only used at beginning of calibration process to let for "if's" (>= `calValues._max and <= min) work. As we need some kind of "center" point to start decreasing current measured min and increasing max. Idea is: User can move sticks as he want, any direction and any combinations, algorythm just have to store min and max of every axis.

I can't test it fully, as I'm still waiting for Arduino board to arrive.

kkbin505 commented 2 years ago

I tested it today, i can not enter cal mode, I'm looking for the root cause.

kkbin505 commented 2 years ago

I have added center stick calibration in the main branch. works well so far