Giter VIP home page Giter VIP logo

Comments (14)

Jaeyoung-Lim avatar Jaeyoung-Lim commented on May 27, 2024

@manumerous https://github.com/PX4/PX4-SITL_gazebo/blob/05e2cd9c03ffa77f0c0d5bd3e788d33e06480b25/src/gazebo_motor_model.cpp#L278

where the reference is set from https://github.com/PX4/PX4-SITL_gazebo/blob/05e2cd9c03ffa77f0c0d5bd3e788d33e06480b25/src/gazebo_motor_model.cpp#L188

from data-driven-dynamics.

manumerous avatar manumerous commented on May 27, 2024

Okay thanks, so the first link just seems to set the link to the computed down-scaled velocity to retrieve it in the next function call.

The second link I am not to sure. I find this a bit confusing. Is it just taking the minimum between the current rotor velocity and the max rotor velocity?

I guess the real magic is happening in this updateFilter here. However I could not find where this FirstOrderFilter object used to generate the pointer in the header file is defined.

from data-driven-dynamics.

Jaeyoung-Lim avatar Jaeyoung-Lim commented on May 27, 2024

@manumerous The second link is storing the command values from PX4. This comes from https://github.com/PX4/PX4-SITL_gazebo/blob/05e2cd9c03ffa77f0c0d5bd3e788d33e06480b25/src/gazebo_mavlink_interface.cpp#L452

I guess the real magic is happening in this updateFilter here. However I could not find where this FirstOrderFilter object used to generate the pointer in the header file is defined.

It doesn't matter - it is just smoothing the commands out incase there are jumps to simulate the PID controller of the ESCs. It is defined here: https://github.com/PX4/PX4-SITL_gazebo/blob/97c167d17564a34d1f0985409b153c91de3cca45/include/common.h#L122

If you are using vscode, you can search the repo with ctrl+shift+f to find if certain methods are defined

from data-driven-dynamics.

manumerous avatar manumerous commented on May 27, 2024

Thank you for your answer. Good to know that the filter is really just a filter. sorry for the confusion.
So could it be that ref_motor_rot_vel_ denotes directly the actuator output between 0 and 1 instead of the angular velocity?

from data-driven-dynamics.

Jaeyoung-Lim avatar Jaeyoung-Lim commented on May 27, 2024

Not necessarily, There are scalings that are done in the plugin.(defined in the sdf)

e.g. https://github.com/PX4/PX4-SITL_gazebo/blob/05e2cd9c03ffa77f0c0d5bd3e788d33e06480b25/models/iris/iris.sdf.jinja#L512

If you are curious, you can print out the values while running the sim

from data-driven-dynamics.

manumerous avatar manumerous commented on May 27, 2024

Thanks, that is good to know. I always thought it was angular velocity.

from data-driven-dynamics.

Jaeyoung-Lim avatar Jaeyoung-Lim commented on May 27, 2024

@manumerous It kind of is right? just not [0, 1] or [min_pwm, max_pwm]

from data-driven-dynamics.

manumerous avatar manumerous commented on May 27, 2024

Yes up to a scale factor. Interesting that they do not use an offset and linear therm.

As real brushless dc + esc combination usually do not turn until a ceretain pwm value but then immediatly start at around 200 rpm and not at 0.

from data-driven-dynamics.

Jaeyoung-Lim avatar Jaeyoung-Lim commented on May 27, 2024

@manumerous That is simulated on the firnware side. If you are disarmed it is just sending 0

from data-driven-dynamics.

manumerous avatar manumerous commented on May 27, 2024

Okay, I guess they omit that effect then. Because it actually happens independently of whether the aircraft is armed or not. This can be seen by just using motors and ESCs without px4.
I guess people just dont care because the motors are usually used at much higher pwm values. I therefore now compared the values around 0.5 input.

But I think my model for the vertical rotors somehow produces no meaningful results. The one for the forward rotor seems much better here.

If I calculated the gazebo force correctly, the forward rotor should produce around 65N while my model produced around 60 N. So that seems close enough.

I will investigate why the vertical forces do not work that well.

from data-driven-dynamics.

Jaeyoung-Lim avatar Jaeyoung-Lim commented on May 27, 2024

@manumerous Right, but it doesnt happen if you have your ESCs calibrated no? These are all simulation specific, so things that doesnt need to be tested are likely missing

from data-driven-dynamics.

manumerous avatar manumerous commented on May 27, 2024

No it has nothing to do with ESC calibration according to my understanding. Most ESCs control the bushless DC motors by estimating the rotors position using the third motor phase, which is not powered at the moment, to measure zero crossing of the back-emf (voltage induced by the permanent magnets on rotors). This is then used to time the voltage switches of the three phases. For this a sufficiently large angular velocity is needed to get a good signal to noise ratio.

But anyways, this is usually much lower than the normal operation point of the motor and i think it is therefore mostly irrelevant.

from data-driven-dynamics.

manumerous avatar manumerous commented on May 27, 2024

I would guess that the difference looks something like this if the ESC is well calibrated.

PXL_20210414_182814715

from data-driven-dynamics.

Jaeyoung-Lim avatar Jaeyoung-Lim commented on May 27, 2024

@manumerous Ahah, now I see what you mean. So we need a min thrust check https://github.com/PX4/PX4-SITL_gazebo/blob/05e2cd9c03ffa77f0c0d5bd3e788d33e06480b25/src/gazebo_motor_model.cpp#L204

AFAIK, this is something also not considered in your rotor model though, right?

from data-driven-dynamics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.