PWM output block in PX4 toolbox for Simulink, how does it work?

10 views (last 30 days)
What are the inputs in the PWM PX4 blocks? Are they rotors' velocities?Or something else? How does this block work? I have to perform the model validation (jmavsim simulator, newton and lagrangian mathematical models and a simscape model) of the iris drone using PX4 firmware, I want to performe a simulation in openloop(so without any controller) and store the states(position, velocities and accelaration) and then compare the four models.
The problem is, what are the inputs I have to give to the PX4 in order to get these state variables?Rotor velocities or something else?
Another question in a PX4 simulink demo ( https://it.mathworks.com/help/supportpkg/px4/ref/attitude-control-px4-external-input.html )in the "To actuator block" there a matrix moltiplication between the taus(tau_thrust,tau_pitch,tau_roll,tau_yaw) and a Mixer Matrix, but what is this mixer matrix? And what's moltiplication meaning? Is the result the square value of the rotors' velocities that are sent to the PX4 PWM block?

Accepted Answer

Walter Roberson
Walter Roberson on 12 May 2023
According to
  • The PX4 PWM Output block takes the individual rotational speed values and sends it to a particular actuator. Along with rotational speeds, the block also has input fields for Arm and Failsafe.
  • The PX4 PWM Output block expects values of uint16 datatype for rotational speeds, and each input can take a value between 1000 to 2000. A Gain block with Gain set to 1000 facilitates these requirements related to a compatible data type and scaling.
  1 Comment
Salvatore Matteo Mennea
Salvatore Matteo Mennea on 12 May 2023
Yes, I know, I've already read it. The input of this block are the Ton time where 900 ms is drone disarmed and then it ranges from 1000 to 2000. The problem is: How can I do to give to this block as inputs the rotor velocities? How can I map the PWM channels Ton values(1000-2000 ms) to rotor velocities?

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!