Pwm test not working & preflight fail error

Hi,

I have a pixhawk 4 and have installed latest release 1.8.2. I tried doing this

pwm arm
pwm test -a -p 1500 -v

on mavlink console but nothing happens on the i/o pwm . I am guesing that the pwm is not armed . On the QGC screen i get a preflight failed : mag inconsistent and it is DISARMED is what it says.

I have two question, is this DISARMED the reason that i am not seeing the output i want to see?
Or is it the something else ?

and also how do I resolve the preflight failed : mag inconsitent ? is it by disablling CAL_MAG_EN0 or changing COM_ARM_MAG value to some higher value (btw this is what i got after looking for - “Preflight failed : mag inconsitent”).

Thanks in advance .

1 Like

I believe I have seen errors like this with Pixhawk 4 before and I remember that the issues were resolved in master. Can you try with latest master?

I have posted one of the solution(in the above thread) mentioned in the topics in master. but i am not certain if should do that ?
Also i wanted to know that ::
pwm arm;
pwm test -a -p 1500 -v

work only when the system is armed? because i am not getting out for these commands when i put it on MAVlink.

Can you point me to the topic concerning “preflight fail error”?, because i am having a lot of threads discussin on that .

I apologise for creating a duplicate thread. I guess I just got a little impatient.

Can you paste the link for the first problem? So we can follow up there.

And what’s the thread for the preflight error?

Sure ,
This is the link that i refered to for preflight failed : mag sensor inconsitent.
https://github.com/PX4/Firmware/issues/8475 .
From that what i got was that we can disable the CAL_MAG_EN0 or change the COM_ARM_MAG to different value. Please intimate me if i am producing something wrong from this linked.

Can you share a log of a flight when it hapens?

Sure.
Here’ the screen shot of it .

I would require an actual flight log, see: https://docs.px4.io/en/getting_started/flight_reporting.html

I’ve been struggling to get “pwm test” working too. When I finally got it working, it didn’t need to be armed in QGroundControl. Although my hardware was different, a Pixhawk 2.4.6 That difference could be significant, because the Pixhawk 4 doesn’t appear to have the same safety switch arrangement.

In my experience, “pwm arm” and “pwm disarm” didn’t do anything helpful. All I needed to do was press the safety switch (until it double blinked). After that, the “pwm test” command would work. (Not armed in QGroundControl and didn’t use the “pwm arm” command).

Although operation was strange. If you first tested only a single channel (say with “pwm test -c 1 -p 1200”), then you couldn’t test any other channel after that, although you could could test that particular channel again. However, if you first tested all channels (with “pwm test -a -p 1200”), after that you could test each individual channels. In fact, if you issued the command to test all channels before you pressed the safety switch (in which case nothing would appear to happen), then pressed the safety switch, you could then test individual channels.

A reboot is then needed after testing.

@JulianOes sorry for very late reply on the flight logs . Here is the link to my flight logs,
Apparently, error about mag sensor inconsistent was taken care off after calibrating it again.

But new error telling about ‘Preflight checks failed’ pop-up when arm switch is pressed.

Here’s the Flight log report ;- https://logs.px4.io/plot_app?log=c328f571-7af2-4f1f-8701-4f0e9749e914 ,

https://logs.px4.io/plot_app?log=717cdda2-a408-4da4-b9ea-a66c5b0d74dd.

I am not able to discern what are the problems. Shall I recalibrate all the things ?

Does the warning happen for both log files? And what exactly was the error? Or which preflight check failed?

@JulianOes , the warning said Critical : preflight Check failed
Critical : Arming denied .

But after pressing the safety switch on the gps it successfully armed . I am not sure what the problems was but now the quadcopter gets armed . Also once armed the pwm test command did work perfectly .

Please let me know what might be the reason for preflight failed or was it that the safety switch was not pressed that why it was showing preflight failed ?

It sounds like the arming button was causing the preflight check to fail. However, it’s a bit odd that there is no indication saying that.