No pwm outputs when in HITL

In our company, we developed a VTOL simulator. I modified the X-plane link in qgroundcontrol to send data our defined format. Problem is, that on versions 1.8.0 (stable) or 1.9.0 (stable) in qgroundcontrol there are no updates of method QGCXPlaneLink::updateActuatorControls (method from QGroundControl, file:QGCXPlaneLink.cpp). Because of this, I am not able to get PWM outputs to the simulator. A few months ago I tried the latest master (commit:065f97e87ba76664b8db8b7a35507e3ecf2afec7) px4 firmware, where it magically started to update actuator controls. I tried to search for changes in code which cause that it works, but after a week of searching, I am to solve this problem.

Logs from simulated flight:

  1. working version: https://review.px4.io/plot_app?log=4499da89-5576-4f5d-9141-66d633b26203
  2. non working version - latest stable: https://review.px4.io/plot_app?log=378520da-7ee1-4234-ae16-2ae71191febb
  3. non working version - latest master: https://review.px4.io/plot_app?log=74ecc267-5d43-4f04-b488-c308fe645868

Already checked these things on every version:

  1. Pwm_out_sim is compiled and is running.
  2. Pixhawk has HITL mode enabled.
  3. QgroundControl is connected to a simulator
  4. Pixhawk is armed.

Maybe I will be able to find out how to solve this problem, but I need to know where to look for it. Anyone any idea?

Romek

My hunch is that this is connected to the introduction of lockstep simulation. I would suggest that you try disabling it and check if that helps: https://dev.px4.io/en/simulation/#disable-lockstep-simulation

You need to understand that it is hard for us to help you if you have modifications or custom simulation setups which are, presumably, not contributed back.

I changed only QGCXPlaneLink::updateActuatorControls method in qgroundcontrol. Everything else is without changes. PX4 is unmodified. I don’t understand, what should I do with disable-lockstep-simulation when it is used in SITL simulation and I use HITL. Right now, I search for commit, which made simulation not working.

Oh sorry, you’re right, I totally confused that.

Is the simulation with XPlane documented somewhere? If yes, I can try to reproduce it and debug it.

Yes. This problem is possible to reproduce with X-plane 10 or 11. HITL documentation is here: https://dev.px4.io/en/simulation/#disable-lockstep-simulation. As I said, I am trying to find the commit which makes this thing not working. I am between commit 1ef9b5e and 6feee7. 6feee7 works. In a few hours, I will find the problematic commit.

This is the link I shared, maybe your copy&paste didn’t work :smile:

https://dev.px4.io/en/simulation/hitl.html. Sorry. My mistake.

1 Like

Oh here it is, thanks.
https://dev.px4.io/en/simulation/hitl.html#using-x-plane-fixed-wing-only

Ok I’ll put that on my list, can’t promise when I get to it.

It looks like upgrading nuttx to version 7.2.8 causes the problem. All commits after commit 1ef9b5e make PWM output not working in HITL simulation. Commit 3859bbb worked for me. I tried to test next commits but I was not able to compile all commits after 3859bbb until commit 1ef9b5e. So the problem is somewhere between 1ef9b5e and 3859bbb.

If you look at the diff: https://github.com/PX4/Firmware/compare/3859bbb..1ef9b5e
you can see that also the ecl submodule was updated.

Could you check if the ecl update has anything to do with it or if it’s only the NuttX change?