# Pwm test not working & preflight fail error

**URL:** <https://discuss.px4.io/t/pwm-test-not-working-preflight-fail-error/10361>\
**Category:** Pixhawk\
**Created:** [April 8, 2019, 1:42pm UTC](https://discuss.px4.io/t/pwm-test-not-working-preflight-fail-error/10361 "2019-04-08T13:42:59Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tej\_R](https://discuss.px4.io/letter_avatar_proxy/v4/letter/t/f17d59/32.png) [@Tej\_R](https://discuss.px4.io/u/Tej_R)\
**Post date:** [April 8, 2019, 1:42pm UTC](https://discuss.px4.io/t/pwm-test-not-working-preflight-fail-error/10361/1 "2019-04-08T13:42:59Z")

</div>

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 .

---

<div class="post-metadata">

**Author:** ![JulianOes](https://discuss.px4.io/user_avatar/discuss.px4.io/julianoes/32/30_2.png) [@JulianOes](https://discuss.px4.io/u/JulianOes)\
**Post date:** [April 10, 2019, 9:46am UTC](https://discuss.px4.io/t/pwm-test-not-working-preflight-fail-error/10361/2 "2019-04-10T09:46:49Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Tej\_R](https://discuss.px4.io/letter_avatar_proxy/v4/letter/t/f17d59/32.png) [@Tej\_R](https://discuss.px4.io/u/Tej_R)\
**Post date:** [April 10, 2019, 11:11am UTC](https://discuss.px4.io/t/pwm-test-not-working-preflight-fail-error/10361/3 "2019-04-10T11:11:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![JulianOes](https://discuss.px4.io/user_avatar/discuss.px4.io/julianoes/32/30_2.png) [@JulianOes](https://discuss.px4.io/u/JulianOes)\
**Post date:** [April 10, 2019, 11:15am UTC](https://discuss.px4.io/t/pwm-test-not-working-preflight-fail-error/10361/4 "2019-04-10T11:15:55Z")

</div>

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

And what’s the thread for the preflight error?

---

<div class="post-metadata">

**Author:** ![Tej\_R](https://discuss.px4.io/letter_avatar_proxy/v4/letter/t/f17d59/32.png) [@Tej\_R](https://discuss.px4.io/u/Tej_R)\
**Post date:** [April 10, 2019, 11:24am UTC](https://discuss.px4.io/t/pwm-test-not-working-preflight-fail-error/10361/5 "2019-04-10T11:24:42Z")

</div>

Sure ,  
This is the link that i refered to for preflight failed : mag sensor inconsitent.  
[https://github.com/PX4/Firmware/issues/8475](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.

---

<div class="post-metadata">

**Author:** ![JulianOes](https://discuss.px4.io/user_avatar/discuss.px4.io/julianoes/32/30_2.png) [@JulianOes](https://discuss.px4.io/u/JulianOes)\
**Post date:** [April 10, 2019, 12:21pm UTC](https://discuss.px4.io/t/pwm-test-not-working-preflight-fail-error/10361/6 "2019-04-10T12:21:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Tej\_R](https://discuss.px4.io/letter_avatar_proxy/v4/letter/t/f17d59/32.png) [@Tej\_R](https://discuss.px4.io/u/Tej_R)\
**Post date:** [April 11, 2019, 6:29am UTC](https://discuss.px4.io/t/pwm-test-not-working-preflight-fail-error/10361/7 "2019-04-11T06:29:43Z")

</div>

Sure.  
Here’ the screen shot of it .

 ![](https://discuss.px4.io/uploads/default/original/2X/9/9bec11237f6f5f2cd5065549c9f0286c3fb47351.PNG)

---

<div class="post-metadata">

**Author:** ![JulianOes](https://discuss.px4.io/user_avatar/discuss.px4.io/julianoes/32/30_2.png) [@JulianOes](https://discuss.px4.io/u/JulianOes)\
**Post date:** [April 11, 2019, 8:58am UTC](https://discuss.px4.io/t/pwm-test-not-working-preflight-fail-error/10361/8 "2019-04-11T08:58:19Z")

</div>

I would require an actual flight log, see: [https://docs.px4.io/en/getting\_started/flight\_reporting.html](https://docs.px4.io/en/getting_started/flight_reporting.html)

---

<div class="post-metadata">

**Author:** ![dmclane](https://discuss.px4.io/letter_avatar_proxy/v4/letter/d/dfb087/32.png) [@dmclane](https://discuss.px4.io/u/dmclane)\
**Post date:** [April 12, 2019, 11:58pm UTC](https://discuss.px4.io/t/pwm-test-not-working-preflight-fail-error/10361/9 "2019-04-12T23:58:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Tej\_R](https://discuss.px4.io/letter_avatar_proxy/v4/letter/t/f17d59/32.png) [@Tej\_R](https://discuss.px4.io/u/Tej_R)\
**Post date:** [April 22, 2019, 6:11am UTC](https://discuss.px4.io/t/pwm-test-not-working-preflight-fail-error/10361/10 "2019-04-22T06:11:55Z")

</div>

@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=c328f571-7af2-4f1f-8701-4f0e9749e914) ,

[https://logs.px4.io/plot\_app?log=717cdda2-a408-4da4-b9ea-a66c5b0d74dd](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 ?

---

<div class="post-metadata">

**Author:** ![JulianOes](https://discuss.px4.io/user_avatar/discuss.px4.io/julianoes/32/30_2.png) [@JulianOes](https://discuss.px4.io/u/JulianOes)\
**Post date:** [April 23, 2019, 11:30am UTC](https://discuss.px4.io/t/pwm-test-not-working-preflight-fail-error/10361/11 "2019-04-23T11:30:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Tej\_R](https://discuss.px4.io/letter_avatar_proxy/v4/letter/t/f17d59/32.png) [@Tej\_R](https://discuss.px4.io/u/Tej_R)\
**Post date:** [April 23, 2019, 11:50am UTC](https://discuss.px4.io/t/pwm-test-not-working-preflight-fail-error/10361/12 "2019-04-23T11:50:56Z")

</div>

@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 ?

---

<div class="post-metadata">

**Author:** ![JulianOes](https://discuss.px4.io/user_avatar/discuss.px4.io/julianoes/32/30_2.png) [@JulianOes](https://discuss.px4.io/u/JulianOes)\
**Post date:** [April 23, 2019, 11:53am UTC](https://discuss.px4.io/t/pwm-test-not-working-preflight-fail-error/10361/13 "2019-04-23T11:53:04Z")

</div>

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.
