# ArduSub SITL sends pwm: \[1000, ...\] for ~500 frames

**URL:** <https://discuss.bluerobotics.com/t/ardusub-sitl-sends-pwm-1000-for-500-frames/11768>\
**Category:** ArduSub\
**Created:** [March 17, 2022, 8:56pm UTC](https://discuss.bluerobotics.com/t/ardusub-sitl-sends-pwm-1000-for-500-frames/11768 "2022-03-17T20:56:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![clyde](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/clyde/32/8563_2.png) [@clyde](https://discuss.bluerobotics.com/u/clyde)\
**Post date:** [March 17, 2022, 8:56pm UTC](https://discuss.bluerobotics.com/t/ardusub-sitl-sends-pwm-1000-for-500-frames/11768/1 "2022-03-17T20:56:21Z")

</div>

Hello: I am working working with the [Ignition Gazebo variant of ardupilot\_gazebo](https://github.com/clydemcqueen/ardupilot_gazebo/tree/ignition-garden) adding support for the new [Buoyancy, Hydrodynamics and Thruster plugins](https://ignitionrobotics.org/api/gazebo/6.3/namespaceignition_1_1gazebo_1_1systems.html).

I have it working in SITL – but the startup is a bit rough. The first ~500 frames appearing on port 9002 have these values:

`[1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000]`

After ~500 or so frames they suddenly switch to the expected values:

`[1500, 1500, 1500, 1500, 1500, 1500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]`

What this means is that the sub goes nuts for a few seconds until the pwm values land at 1500. My workaround for now is to ignore any packets where the pwm values are \<= servo\_min (1100).

Is this a bug in ArduSub, or some parameter that I can tweak? Or perhaps it’s just a known behavior that doesn’t really affect any other system.

Thanks,  
/Clyde

P.S. – I uploaded the (very rough) underwater.world and bluerov2/model.sdf files here: [GitHub - clydemcqueen/bluerov2\_ignition: BlueROV2 model for Ignition Gazebo](https://github.com/clydemcqueen/bluerov2_ignition)

---

<div class="post-metadata">

**Author:** ![EliotBR](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/eliotbr/32/6937_2.png) [@EliotBR](https://discuss.bluerobotics.com/u/EliotBR)\
**Post date:** [March 18, 2022, 10:31am UTC](https://discuss.bluerobotics.com/t/ardusub-sitl-sends-pwm-1000-for-500-frames/11768/2 "2022-03-18T10:31:00Z")

</div>

Hi @clyde,

I’m not sure if that’s known behaviour, but given the results it could have it’s at least undesirable. I’ve passed it on to the lead ArduSub dev and will see what they say 🙂

> [@clyde](#):
>
> What this means is that the sub goes nuts for a few seconds until the pwm values land at 1500.  
> …  
> perhaps it’s just a known behaviour that doesn’t really affect any other system.

In a real vehicle, ESCs generally require a stable neutral signal before they arm and allow the thrusters to move. `1000` signals on startup could affect peripherals like a camera tilt servo, or a gripper, but shouldn’t have an impact on thrusters.

> [@clyde](#):
>
> Is this a bug in ArduSub, or some parameter that I can tweak?

Given it’s occurring at startup, it’s almost certainly a firmware issue rather than something that’s tunable by a parameter. My guess would be it’s a remnant of plane/copter code, perhaps intended to provide a ‘safe’ PWM signal while the autopilot starts up, since plane and copter motors are generally single-directional, and use 1000 as ‘neutral’.

---

<div class="post-metadata">

**Author:** ![clyde](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/clyde/32/8563_2.png) [@clyde](https://discuss.bluerobotics.com/u/clyde)\
**Post date:** [March 18, 2022, 2:51pm UTC](https://discuss.bluerobotics.com/t/ardusub-sitl-sends-pwm-1000-for-500-frames/11768/3 "2022-03-18T14:51:55Z")

</div>

This makes sense. Thanks for the quick reply.

---

<div class="post-metadata">

**Author:** ![clyde](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/clyde/32/8563_2.png) [@clyde](https://discuss.bluerobotics.com/u/clyde)\
**Post date:** [May 2, 2022, 9:59pm UTC](https://discuss.bluerobotics.com/t/ardusub-sitl-sends-pwm-1000-for-500-frames/11768/4 "2022-05-02T21:59:59Z")

</div>

A quick followup: I proposed a PR to fix this: [AP\_HAL\_SITL: init ArduSub pwm\_output to 1500 by clydemcqueen · Pull Request #20403 · ArduPilot/ardupilot · GitHub](https://github.com/ArduPilot/ardupilot/pull/20403)

---

<div class="post-metadata">

**Author:** ![EliotBR](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/eliotbr/32/6937_2.png) [@EliotBR](https://discuss.bluerobotics.com/u/EliotBR)\
**Post date:** [May 3, 2022, 12:33am UTC](https://discuss.bluerobotics.com/t/ardusub-sitl-sends-pwm-1000-for-500-frames/11768/5 "2022-05-03T00:33:45Z")

</div>

I took a look and have added a comment. If that gets resolved I’ll see if I can chase this up internally and get the fix merged 🙂
