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

Motor Setup #12312

Merged
merged 1 commit into from
Jan 20, 2025
Merged

Motor Setup #12312

merged 1 commit into from
Jan 20, 2025

Conversation

Godeffroy
Copy link
Contributor

Motor Setup

Change the motor setup page :
Instead of a slider for each motor with the difficulty to know how many power you put in, i made a slider to choose the power with fine tuning, a button for each motor to test them, a button to start all motor and a button to stop them all at once.


Tested on an hexa copter with Ardupilot Copter 4.5

Checklist:

Related Issue

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@Godeffroy
Copy link
Contributor Author

I commited all translation files because of the text changes. I don't know if i need to remove the *.ts files ? or do something to synchronize the translation ?

I also change the *.md file for the documentation with a new picture.

@DonLakeFlyer
Copy link
Contributor

It all seems quite a bit more complicated than it was before. Is there a reason you need to know how much exact power you are putting?

@Godeffroy
Copy link
Contributor Author

It all seems quite a bit more complicated than it was before. Is there a reason you need to know how much exact power you are putting?

Yes, i'm working with QGC on a tablet size screen and with a big finger, you can put too much power by mistake ! This is also veryusefull when you want to compare each motors rotation (detection of noise during rotation for example) : you need to have the same input power to be able to compare.

@Godeffroy
Copy link
Contributor Author

It is how it's done in Mission Planner, there even is the rotation time available to change the default 3s.

@Godeffroy
Copy link
Contributor Author

I can put 5% or 7% by default to the power slider so you have less click to start a test motor ?

@DonLakeFlyer
Copy link
Contributor

Hmm, ok. Can you use the new ValueSlider control then. This allows for everything you want and more. Including typing in a specific value. Example usage from battery toolbar indicator:
Screenshot 2025-01-14 at 8 36 14 AM

@Godeffroy
Copy link
Contributor Author

The ValueSlider is so cool, thanks for the tip !

Here is the new visual :
image

About the documentation, i'm not able to translate the english version into Chinese, Korean and Turkish (with docs\en\qgc-user-guide\setup_view\motors.md)

@DonLakeFlyer
Copy link
Contributor

About the documentation, i'm not able to translate the english version into Chinese, Korean and Turkish (with docs\en\qgc-user-guide\setup_view\motors.md)

Oh, sorry. Forgot to talk about that. You should only modify the english version as needed. You don't need to do the other languages.

@DonLakeFlyer
Copy link
Contributor

Also I don't think you don't need the plus/minus buttons. That sort of thing isn't anywhere else in the UI for these types of sliders. If you want that much direct control of motor value then just click number indicator and type in a value.

@Godeffroy
Copy link
Contributor Author

Ok, thanks for the feedback, i'm on it 👍

@Godeffroy
Copy link
Contributor Author

Should i remove all the modification of *.ts files in the dir ..\translations\ ?

@Godeffroy
Copy link
Contributor Author

Looks like this now
image

@DonLakeFlyer
Copy link
Contributor

You should only update the english version and leave the rest alone. They will get updated through an automated process

@DonLakeFlyer
Copy link
Contributor

I didn't realize this not only a ui change but also changes the way the slider/motor selection works. Now the motor is only commanded to a speed when you press a button. Whereas before the slider would adjust the motor speed. There was also a timeout of 3 seconds which would turn off the motors as a safety feature. I'm not convinced the new mechanism is better with respect to having to press the button to get the motor to spin. What's the reasoning behind changing the user model behind how it work. I thought all you wanted was more tunability to the exact motor percentages? Want to understand why this is better.

A second thing is that I hadn't realized that there was a ArduPilot variant of the control as well as a common variant of this control. The code for both is 99% exactly the same. Do you think you can help out and clean this up as well? The only different between the two is motor numbers version motor letters. Could you create a base class which holds all the guts of the control and calls up to a motorIndexToString function. Then two classes CommonMotorComponent and APMMotoComponent which use CommonMotorComponent as base class and provide that function.

@DonLakeFlyer
Copy link
Contributor

I'm thinking more along the lines that the motor buttons which be like checkboxes. Pick which motors you want to test then slide the slider to crank them up.

@DonLakeFlyer
Copy link
Contributor

@bkueng Can you comment on this? Wondering what you think about the click the button to make the motor go model, versus the slider the slider way it used to work. Would be good to make this consistent with the Actuators page as well. I'm assuming you did a pile of real world testing with motors/actuators page so can comment on what you think is the better way.

@Godeffroy
Copy link
Contributor Author

I didn't realize this not only a ui change but also changes the way the slider/motor selection works. Now the motor is only commanded to a speed when you press a button. Whereas before the slider would adjust the motor speed. There was also a timeout of 3 seconds which would turn off the motors as a safety feature. I'm not convinced the new mechanism is better with respect to having to press the button to get the motor to spin. What's the reasoning behind changing the user model behind how it work. I thought all you wanted was more tunability to the exact motor percentages? Want to understand why this is better.

There are two main reason for this change :

  • The way it worked was a little concerning when you have big UAV with big propeller because you had to slide to enable the motor and a little mistake could put way too much power than you wanted (eg : It's cold, you're shivering, you have big fingers and you slipp...). Choosing the power, then enable the motor rotation is, for me, a better way in term of security.
  • Also, we use it to detect any flaw in the rotation : we want to test each motor with the exact same amount of power in order to listen and hear if there could be any probleme with the rotation.

@Godeffroy
Copy link
Contributor Author

I'm thinking more along the lines that the motor buttons which be like checkboxes. Pick which motors you want to test then slide the slider to crank them up.

That won't do : we can always slip by mistake on the engine power.

@Godeffroy
Copy link
Contributor Author

A second thing is that I hadn't realized that there was a ArduPilot variant of the control as well as a common variant of this control. The code for both is 99% exactly the same. Do you think you can help out and clean this up as well? The only different between the two is motor numbers version motor letters. Could you create a base class which holds all the guts of the control and calls up to a motorIndexToString function. Then two classes CommonMotorComponent and APMMotoComponent which use CommonMotorComponent as base class and provide that function.

Wow, i was not aware that Ardupilot use letters for motors instead of numbers like PX4 !
It could be good indeed to clean up a little bit.

I can try.
If you know another component which do this, show me.

@DonLakeFlyer
Copy link
Contributor

If you know another component which do this, show me.

Don't worry about it. I'll clean it up. I'll merge this in now.

@DonLakeFlyer DonLakeFlyer merged commit e4b5c7c into mavlink:master Jan 20, 2025
10 checks passed
@Godeffroy
Copy link
Contributor Author

Thank you very much for the merge :)

@Godeffroy Godeffroy deleted the MotorSetup branch January 21, 2025 08:28
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.

2 participants