Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing parameters to px4io #519

Closed
TickTock- opened this issue Nov 7, 2013 · 5 comments
Closed

Passing parameters to px4io #519

TickTock- opened this issue Nov 7, 2013 · 5 comments

Comments

@TickTock-
Copy link
Contributor

Is there a mechanism to pass a parameter to the px4io through the rc script? Specifically, I want to configure the PX4IO_P_SETUP_VBATT_SCALE to work with this mod
https://pixhawk.ethz.ch/px4/airframes/mantis_x8_6ssetup
without having to carry local changes forever.

volatile uint16_t r_page_setup[] =
{
[PX4IO_P_SETUP_FEATURES] = 0,
[PX4IO_P_SETUP_ARMING] = 0,
[PX4IO_P_SETUP_PWM_RATES] = 0,
[PX4IO_P_SETUP_PWM_DEFAULTRATE] = 50,
[PX4IO_P_SETUP_PWM_ALTRATE] = 200,

ifdef CONFIG_ARCH_BOARD_PX4IO_V1

[PX4IO_P_SETUP_RELAYS]          = 0,

endif

ifdef ADC_VSERVO

[PX4IO_P_SETUP_VSERVO_SCALE]        = 10000,

else

/*TickTock - scale to 6S*/
<bold>[PX4IO_P_SETUP_VBATT_SCALE]       = 17015,</bold>

endif

[PX4IO_P_SETUP_SET_DEBUG]       = 0,

};

@LorenzMeier
Copy link
Member

You can use param set PARAM_NAME and then have the PX4IO driver obey that VBAT_SCALE value. Currently BAT_V_SCALING is used for FMU, but you might be able to reconcile them by rebasing the FMU ADC scale onto the same nominal voltage as IO and then apply the same factor on both.

@TickTock-
Copy link
Contributor Author

Thanks for the response. No luck, though, just using the param set command. Specifically, I added the following to my rc script:

    param set PX4IO_P_SETUP_VBATT_SCALE 17015

but it still reflects the default value of 10000

@LorenzMeier
Copy link
Member

I just went ahead and did it for you: add:

 param set BAT_V_SCALE_IO 17015

In your startup script and use this branch #557 for testing - its untested! But it should work.

@TickTock-
Copy link
Contributor Author

Perfect! It works great. I will study what you did - hopefully one day I will be competent enough to do this kind of stuff myself.

@LorenzMeier
Copy link
Member

Thanks for the feedback, glad it helped - closing this issue now.

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

No branches or pull requests

2 participants