# Motors spinup momentarily on arming

**URL:** <https://discuss.px4.io/t/motors-spinup-momentarily-on-arming/6839>\
**Category:** Flight Testing & Log Analysis\
**Created:** [June 8, 2018, 7:33pm UTC](https://discuss.px4.io/t/motors-spinup-momentarily-on-arming/6839 "2018-06-08T19:33:11Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![pleschinski](https://discuss.px4.io/user_avatar/discuss.px4.io/pleschinski/32/5465_2.png) [@pleschinski](https://discuss.px4.io/u/pleschinski)\
**Post date:** [June 8, 2018, 7:33pm UTC](https://discuss.px4.io/t/motors-spinup-momentarily-on-arming/6839/1 "2018-06-08T19:33:11Z")

</div>

Hi everyone,

I’m making an experimental aircraft using the stock PX4 multicopter code. However, the ESCs I’m using are reversible, i.e. PWM 1500µs is stopped, 2000µs is full up and 1000µs is full reverse. In order to make this work, I’ve made a custom airframe and mixer; I’ve pasted the first motor output mixer below. PWM\_DISARMED is set to 1500, and my throttle stick is sprung to centre. I’m not using any auto functions - only stabilise mode.

Now, my problem is, that about 60% of the time, when I arm, the motor output shoots to 1000µs for half a second or so, then back to 1500µs, where my stick is. This causes the motors to spin in full reverse momentarily upon arming. Very scary!

The logs didn’t show anything on OUT0\_Out0, but I did discover that if I activate the kill switch, then arm, the motor waits until I deactivate the kill switch, then they spin up momentarily. and allows it to be captured by the logs.

Does anybody have any idea what’s going on? Any help would be much appreciated!

Thank you,  
Patrick

M: 2  
O: 10000 10000 0 -10000 10000  
S: 3 0 10000 10000 0 -10000 10000  
S: 0 3 -20000 -20000 10000 -10000 10000

 ![](https://discuss.px4.io/uploads/default/original/2X/b/b0abfff3c03f786b4fd5de170744c8820bbbc791.png)

---

<div class="post-metadata">

**Author:** ![Antiheavy](https://discuss.px4.io/user_avatar/discuss.px4.io/antiheavy/32/6398_2.png) [@Antiheavy](https://discuss.px4.io/u/Antiheavy)\
**Post date:** [June 9, 2018, 11:25pm UTC](https://discuss.px4.io/t/motors-spinup-momentarily-on-arming/6839/2 "2018-06-09T23:25:04Z")

</div>

I’m curious what ESC you are using? I’ve been looking for a reversible ESC for a while and they are surprisingly few of them (other than the car ones with the extra wire). Sorry I’m not much help on the PWM glitches…

---

<div class="post-metadata">

**Author:** ![pleschinski](https://discuss.px4.io/user_avatar/discuss.px4.io/pleschinski/32/5465_2.png) [@pleschinski](https://discuss.px4.io/u/pleschinski)\
**Post date:** [June 10, 2018, 12:28am UTC](https://discuss.px4.io/t/motors-spinup-momentarily-on-arming/6839/3 "2018-06-10T00:28:00Z")

</div>

3D ESCs are surprisingly few, until we realised something… read on…

We started out using [HobbyWing Xrotor Pro 4A 3D](https://hobbyking.com/en_us/hobbywing-xrotor-pro-40a-3d-muti-rotor-esc-opto.html?gclid=EAIaIQobChMIgerD_-nH2wIVEdbACh0KgApjEAAYAiAAEgIYifD_BwE&gclsrc=aw.ds) ESCs. The worked pretty well, however they have an annoying “soft start” if you leave the throttle at neutral for a few seconds, so now we use [Cobra S-class 80A HV](http://innov8tivedesigns.com/cobra-80a-high-voltage-6-12-cell-esc) ESCs with BLHeli installed.

Any ESC that supports BLHeli can be programmed to be reversible, even if it doesn’t say it in the description. Make sure you get the appropriate USB programmer, then load up BLHeli Suite, and set the direction to bi-directional. Boom, you have a reversible ESC 🙂

---

<div class="post-metadata">

**Author:** ![bkueng](https://discuss.px4.io/letter_avatar_proxy/v4/letter/b/2bfe46/32.png) [@bkueng](https://discuss.px4.io/u/bkueng)\
**Post date:** [June 11, 2018, 6:14am UTC](https://discuss.px4.io/t/motors-spinup-momentarily-on-arming/6839/4 "2018-06-11T06:14:26Z")

</div>

Hi @pleschinski

What you see is most likely the PWM ramp up logic, which is here: [https://github.com/PX4/Firmware/blob/master/src/modules/systemlib/pwm\_limit/pwm\_limit.c#L136](https://github.com/PX4/Firmware/blob/master/src/modules/systemlib/pwm_limit/pwm_limit.c#L136).  
The code has not beed designed for your use-case, but I’m generally interested in adding support to PX4 for reversible ESCs.

You can test skipping the ramp up by setting `PWM_LIMIT_STATE_ON` in [https://github.com/PX4/Firmware/blob/master/src/modules/systemlib/pwm\_limit/pwm\_limit.c#L82](https://github.com/PX4/Firmware/blob/master/src/modules/systemlib/pwm_limit/pwm_limit.c#L82).

---

<div class="post-metadata">

**Author:** ![pleschinski](https://discuss.px4.io/user_avatar/discuss.px4.io/pleschinski/32/5465_2.png) [@pleschinski](https://discuss.px4.io/u/pleschinski)\
**Post date:** [June 11, 2018, 1:06pm UTC](https://discuss.px4.io/t/motors-spinup-momentarily-on-arming/6839/5 "2018-06-11T13:06:49Z")

</div>

Thank you so much @bkueng, that seems to have fixed it!

---

<div class="post-metadata">

**Author:** ![bkueng](https://discuss.px4.io/letter_avatar_proxy/v4/letter/b/2bfe46/32.png) [@bkueng](https://discuss.px4.io/u/bkueng)\
**Post date:** [June 12, 2018, 11:05am UTC](https://discuss.px4.io/t/motors-spinup-momentarily-on-arming/6839/6 "2018-06-12T11:05:43Z")

</div>

Good! Do you want to open an upstream issue ([https://github.com/PX4/Firmware/issues](https://github.com/PX4/Firmware/issues)), so we can discuss a general solution?  
Do you require other changes?

---

<div class="post-metadata">

**Author:** ![Vavooon](https://discuss.px4.io/user_avatar/discuss.px4.io/vavooon/32/3523_2.png) [@Vavooon](https://discuss.px4.io/u/Vavooon)\
**Post date:** [June 12, 2018, 8:31pm UTC](https://discuss.px4.io/t/motors-spinup-momentarily-on-arming/6839/7 "2018-06-12T20:31:07Z")

</div>

I’m not sure but it can be related to a bug I’ve found [Throttle spike on arming (is it a bug?)](http://discuss.px4.io/t/throttle-spike-on-arming-is-it-a-bug/5731) . In my case autopilot sent bigger PWM to ESCs a second after arming and then returned values to expected ones.

---

<div class="post-metadata">

**Author:** ![pleschinski](https://discuss.px4.io/user_avatar/discuss.px4.io/pleschinski/32/5465_2.png) [@pleschinski](https://discuss.px4.io/u/pleschinski)\
**Post date:** [July 16, 2018, 3:25pm UTC](https://discuss.px4.io/t/motors-spinup-momentarily-on-arming/6839/8 "2018-07-16T15:25:03Z")

</div>

I’ve opened an issue. The aircraft is working beautifully, I don’t believe any other changes are required.  
Thanks again!

---

<div class="post-metadata">

**Author:** ![bkueng](https://discuss.px4.io/letter_avatar_proxy/v4/letter/b/2bfe46/32.png) [@bkueng](https://discuss.px4.io/u/bkueng)\
**Post date:** [July 20, 2018, 4:47pm UTC](https://discuss.px4.io/t/motors-spinup-momentarily-on-arming/6839/9 "2018-07-20T16:47:44Z")

</div>

Cool - do you have a video? 🙂

---

<div class="post-metadata">

**Author:** ![pleschinski](https://discuss.px4.io/user_avatar/discuss.px4.io/pleschinski/32/5465_2.png) [@pleschinski](https://discuss.px4.io/u/pleschinski)\
**Post date:** [July 23, 2018, 8:11pm UTC](https://discuss.px4.io/t/motors-spinup-momentarily-on-arming/6839/10 "2018-07-23T20:11:25Z")

</div>

I have heaps of videos 🙂 None that I’m allowed to show, unfortunately. Intellectual property. Sorry!

---

<div class="post-metadata">

**Author:** ![rollys](https://discuss.px4.io/user_avatar/discuss.px4.io/rollys/32/2081_2.png) [@rollys](https://discuss.px4.io/u/rollys)\
**Post date:** [July 23, 2018, 9:58pm UTC](https://discuss.px4.io/t/motors-spinup-momentarily-on-arming/6839/11 "2018-07-23T21:58:47Z")

</div>

Just a suggestion of maybe point you to how it’s handled in a different application… Checkout Vertical Technologies’ DeltaQuad [airframe setup](https://docs.px4.io/en/airframes/airframe_reference.html). Reverse thrust is setup in a different PWM port.

Good luck.

---

<div class="post-metadata">

**Author:** ![pleschinski](https://discuss.px4.io/user_avatar/discuss.px4.io/pleschinski/32/5465_2.png) [@pleschinski](https://discuss.px4.io/u/pleschinski)\
**Post date:** [July 24, 2018, 1:44pm UTC](https://discuss.px4.io/t/motors-spinup-momentarily-on-arming/6839/12 "2018-07-24T13:44:48Z")

</div>

That’s really interesting… how do they reverse the motor using a different port?

---

<div class="post-metadata">

**Author:** ![rollys](https://discuss.px4.io/user_avatar/discuss.px4.io/rollys/32/2081_2.png) [@rollys](https://discuss.px4.io/u/rollys)\
**Post date:** [July 25, 2018, 12:45am UTC](https://discuss.px4.io/t/motors-spinup-momentarily-on-arming/6839/13 "2018-07-25T00:45:14Z")

</div>

> [@pleschinski](#):
>
> how do they reverse the motor using a different port?

I don’t know but I’m sure it’s in the code. You may want to try to get with @sanderux who’s the maintainer of that airframe.

Good luck.
