Skip to content

Pr add rotary encoder#14

Open
anant3110 wants to merge 72 commits intoairbound-developfrom
pr-add-rotary-encoder
Open

Pr add rotary encoder#14
anant3110 wants to merge 72 commits intoairbound-developfrom
pr-add-rotary-encoder

Conversation

@anant3110
Copy link

@anant3110 anant3110 commented Sep 10, 2025

Add rotary encoder with quadrature architecture to measure angles

  • ISR based system called from HAL
  • Define in ArduPlane, with other sensors and servos
  • Add parameters to assign the appropriate pins and variables for the rotary encoder
  • Add synchronous modules that update a global instance at a fixed time
  • Add data flash logs as "RENC"

@anant3110 anant3110 self-assigned this Sep 10, 2025
@anant3110 anant3110 force-pushed the pr-add-rotary-encoder branch 2 times, most recently from ad5fe61 to c23fa95 Compare September 15, 2025 10:56
@anant3110 anant3110 marked this pull request as ready for review September 15, 2025 11:00
Copy link
Member

@botmayank botmayank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move stuff to quadplane/tailsitter or as localized to our files as possible.

AP_GROUPINFO("BCK_PIT_LIM", 38, QuadPlane, q_bck_pitch_lim, 10.0f),


AP_SUBGROUPINFO(tailsitter.rotary_encoder, "RENC_", 39, QuadPlane, AP_RotaryEncoder),
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This had to be added here, there was no way to do this from tailsitter.cpp

@anant3110 anant3110 force-pushed the pr-add-rotary-encoder branch 5 times, most recently from 233d783 to 91b3a17 Compare October 10, 2025 08:34
@anant3110 anant3110 requested a review from botmayank October 11, 2025 04:07
@anant3110 anant3110 force-pushed the pr-add-rotary-encoder branch from ec02c0b to 477f32b Compare November 13, 2025 06:18
@coderabbitai
Copy link

coderabbitai bot commented Nov 13, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@anant3110 anant3110 force-pushed the pr-add-rotary-encoder branch from d94fde4 to 6755bad Compare November 13, 2025 07:25
@anant3110
Copy link
Author

Merged conflicts resolved. Conflicts were in version.h and default params. Added default params from ardupilot-develop.

@anant3110 anant3110 force-pushed the pr-add-rotary-encoder branch from 0d5c0bd to 4f25c4a Compare January 27, 2026 12:40
botmayank and others added 5 commits January 27, 2026 18:14
* Update last_pos2_ms time for non-rtl modes to freeze climb rate

* Move set climb rate 0 for pos2 height control out of tailsitter check
…EK3 to DCM (#25)

* Add control surface checks lua script

* Update parachute lua script log

* Add door auto control script

* Update version.h

* Add wvane lo threshold to pix6c defaults param file

* Add all airbound params to defaults.parm with q_tailsit_wv ones as readonly

* Reduce default param list basis recent flights

* Update version.h

* Change EK3 airspeed estimate source from EK3 to DCM
Update version.h

---------

Co-authored-by: Mayank Joneja <mayankj@airbound.co>
* Modify Pixhawk6C-bdshot default parameter list

- Update version.h to rc4
- Update default params in lua scripts

* Handle gimbal lock singularity specifically for pitch in ahrs view

* Update version to rc5

* Add simple ahrs pitch based check to correct att pitch beyond 90

* Add rot matrix based check for nose down belly up/down

* Swap pitch corrections in ahrs view

---------

Co-authored-by: akshar-airbound <aksharp@airbound.co>
* Modify Pixhawk6C-bdshot default parameter list

- Update version.h to rc4
- Update default params in lua scripts

* Handle gimbal lock singularity specifically for pitch in ahrs view

* Update version to rc5

* Add simple ahrs pitch based check to correct att pitch beyond 90

* Add rot matrix based check for nose down belly up/down

* Swap pitch corrections in ahrs view

* Add logging for ahrs view compensation

* Fix logging of pitch before and after compensation

* Add logging for att target axis angle

* Add logging of att body and error quat as axis angle

* Add flags for belly up/down and nose down in logs

* Update version to rc6

* Change version to 4.5.7.3 rc1

* Change mode check for landing phase for doors script

* Check valid landing mission commands

* Add check for vtol land descent from quadplane

* Force doors open under takeoff alt_trig_m and don't check for transitions during takeoff

* Add a landing latch flag to only trigger doors basis modes

* Initialize servo pwm open close based on specific defaults

* Update version to 4.5.7.2 hf1

* Update version to v4.5.7.2 - hf1

* Fix vtol flight check logic basis latch

* Add global override param for doors auto logic

* Fix num params for door script

* Fix docstring for ATPC logging

---------

Co-authored-by: akshar-airbound <aksharp@airbound.co>
@anant3110 anant3110 force-pushed the pr-add-rotary-encoder branch from 4f25c4a to 6a80821 Compare January 27, 2026 12:47
Copy link
Member

@botmayank botmayank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Address comments, if changes are too tough to manage here, close this and open a new PR based on 4.5.7.2 hf1

const float roll_out = stabilize_roll_get_roll_out();
SRV_Channels::set_output_scaled(SRV_Channel::k_aileron, roll_out);

#if HAL_LOGGING_ENABLED
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anant3110 remove these logs, not needed

logger.Write_PID(LOG_PIDE_MSG, quadplane.pos_control->get_vel_xy_pid().get_pid_info_y());
}

// Write tailsitter specific log at same rate as PIDs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix comment indent

void Plane::init_ardupilot()
{

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix this

*/
void AP_Param::load_param_defaults(const volatile char *ptr, int32_t length, bool last_pass)
{
const volatile char *original_ptr = ptr; // Save original pointer for offset calculations
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check this @anant3110


#include <AP_HAL/AP_HAL_Boards.h>

#ifndef AP_ROTARYENCODER_ENABLED
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anant3110 check this, feels like a roundabout way of forcing always enable

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anant3110 fix this, submodules shouldn't be touched

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anant3110 Fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants