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

Allow more than 4 MC motors in VTOL Simulator #12166

Closed
wants to merge 4 commits into from

Conversation

irsdkv
Copy link
Contributor

@irsdkv irsdkv commented Jun 4, 2019

Describe problem solved by the proposed pull request
In the SITL MAVLink module, the outputs are scaled based on the number of motors determined from the vehicle type. For tiltrotors and some other types of VTOLs, the vehicle type is not sufficient to determine the number of motors.

Describe your preferred solution
The VT_PSH_MOT_COUNT (push / pull motors count) parameter specifies the number of pushing / pulling motors for the copter. This new parameter together with VT_MOT_COUNT used to define total amount of motors in VTOL vehicle.

The default value is 1, so the old description files will be valid in case of reuse it to describe the new VTOL copters.

This parameter is necessary because of without it you can't give a full description of the nonstandard VTOL vehicle type with several push or pull engines.

For the new parameter used reserved vehicle type MAV_TYPE_VTOL_RESERVED3, which may coverage most of future nonstandard VTOL types.

Additional context
Thanks to @jlecoeur for #11287.

The VT_PSH_MOT_COUNT (push / pull motors count) parameter specifies the
number of pushing / pulling motors for the copter.

The default value is 1, so the old description files will be valid.

This parameter is necessary because of without it you can't give a full
description of the nonstandard VTOL vehicle type with several push or
pull engines.

For the new parameter used reserved vehicle type MAV_TYPE_VTOL_RESERVED3,
which may coverage most of future nonstandard VTOL types.

Thanks to Julien Lecoeur for PX4#11287.
@irsdkv irsdkv changed the title New parameter VT_PSH_MOT_COUNT defined New parameter VT_PSH_MOT_COUNT Jun 4, 2019
@jlecoeur
Copy link
Contributor

jlecoeur commented Jun 4, 2019

You are welcome, this is a cleaner solution. Feel free to close my PR when this is in.

Regarding the parameters, what about this:

  • rename VT_MOT_COUNT to VT_MC_MOT_COUNT
  • rename VT_PSH_MOT_COUNT to VT_FW_MOT_COUNT
    ?

@irsdkv
Copy link
Contributor Author

irsdkv commented Jun 4, 2019

  • VT_MC_MOT_COUNT

Hello

Thank you, I think that the new names will be clearer.

Renamed these parameters and variables dependent on them.

Rename VT_MOT_COUNT to VT_MC_MOT_COUNT and
VT_PSH_MOT_COUNT to VT_FW_MOT_COUNT
for more accurately match their meaning.
@irsdkv irsdkv force-pushed the pr-vtol_sitl_push_motor_count_param branch 4 times, most recently from 3238c6e to 4cb84b2 Compare June 10, 2019 12:17
@irsdkv irsdkv force-pushed the pr-vtol_sitl_push_motor_count_param branch from 4cb84b2 to a2aa61c Compare June 10, 2019 12:20
@irsdkv irsdkv force-pushed the pr-vtol_sitl_push_motor_count_param branch from b51f439 to 9b44c27 Compare June 10, 2019 14:47
@irsdkv
Copy link
Contributor Author

irsdkv commented Jun 14, 2019

@jlecoeur should I do any additional improvements?
Or may be need to revoke commit MAVLink impl and later?

@irsdkv irsdkv changed the title New parameter VT_PSH_MOT_COUNT Allow more than 4 MC motors in VTOL Simulator Jun 14, 2019
@a6a3uh
Copy link

a6a3uh commented Jun 14, 2019

This is the PR we are looking for to be merged. 4 MC motors for VTOL is an annoying restriction. Dear maintainers pls let us know how do you see the change like this could be accepted..

@dagar
Copy link
Member

dagar commented Jun 16, 2019

We generally try to avoid renaming parameters because it breaks existing setups.

This feels like it could be a piece of metadata we should just be getting from a mixing system rather than a simple motor count (that's kind of a leaky abstraction).

@a6a3uh
Copy link

a6a3uh commented Jun 17, 2019

We generally try to avoid renaming parameters because it breaks existing setups.

This feels like it could be a piece of metadata we should just be getting from a mixing system rather than a simple motor count (that's kind of a leaky abstraction).

Hi, @dagar! Does that means you want to get rid of VT_MOT_COUNT as well? The solution proposed just extends the approache used before with VT_MOT_COUNT. So it is based on the architecture already used in the code.

I see 5 variants to solve this situation:

  1. Approach proposed in this PR with one new parameter VT_FW_MOT_COUNT and renaming one existent (VT_MOT_COUNT -> VT_MC_MOT_COUNT).
  2. Leaving previous parameter name VT_MOT_COUNT for compatibility but introduce new parameter VT_FW_MOT_COUNT.
  3. Hardcode the number of VT_FW_MOT_COUNT as it was hardcoded before to 1, but infer MC motors count from VT_MOT_COUNT instead of hardcoded number 4.
  4. Infer both MC motors count and FW motors count from mixers and get rid of VT_MOT_COUNT at all.
  5. Infer only FW motor count from mixer while leaving VT_MOT_COUNT for compatibility.

Could you pls let us know which variant is acceptable for you? Or suggest another approach?

@jlecoeur
Copy link
Contributor

@a6a3uh I think your problem was solved in #12352

@a6a3uh
Copy link

a6a3uh commented Jul 10, 2019

@a6a3uh I think your problem was solved in #12352

The problem was not solved I believe. Or putting it differently that PR solves different kind of problem.

The main problem we had was simulator does not support more than 4 MC motors for standard VTOL. Number 4 is hardcoded in mavlink_messages.cpp. Thus VTOL with more than 4 MC motors was producing incorrect thrust on motors with index > 5.

Some other downsides of approach in the PR you mentioned. No more than 8 MC motors are possible for VTOL. And in order to get quantity of MC motors one have to extract that number from VT_MOT_ID in some inconvenient way.

@jlecoeur
Copy link
Contributor

You are right @a6a3uh, this is not completely solved.

What I suggest:

  • convert VT_MOT_ID to a 16bits bitmask (for a maximum of 16 actuators)
  • add param VT_FW_MOT_ID
  • fix mavlink_messages.cpp and simulator_mavlink.cpp to scale the outputs based on the 2 parameters above

@stale
Copy link

stale bot commented Oct 8, 2019

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

@stale stale bot added the stale label Oct 8, 2019
@irsdkv
Copy link
Contributor Author

irsdkv commented Oct 10, 2019

I will create new PR using VT_MOT_ID after #12277 will done.

@irsdkv irsdkv closed this Oct 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants