# AUX OUT PWM rangefinder distance scaling not working in copter 4.07 cube orange

**URL:** <https://discuss.cubepilot.org/t/aux-out-pwm-rangefinder-distance-scaling-not-working-in-copter-4-07-cube-orange/6710>\
**Category:** Cube Autopilot\
**Created:** [28 June 2021 08:33 UTC](https://discuss.cubepilot.org/t/aux-out-pwm-rangefinder-distance-scaling-not-working-in-copter-4-07-cube-orange/6710 "2021-06-28T08:33:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RAZOR15000](https://discuss.cubepilot.org/user_avatar/discuss.cubepilot.org/razor15000/32/4139_2.png) [@RAZOR15000](https://discuss.cubepilot.org/u/RAZOR15000)\
**Post date:** [28 June 2021 08:33 UTC](https://discuss.cubepilot.org/t/aux-out-pwm-rangefinder-distance-scaling-not-working-in-copter-4-07-cube-orange/6710/1 "2021-06-28T08:33:51Z")

</div>

since i2c bus is entirely useless with the CAN bus system active. i moved to pwm input in the AUX outs. my sensor is VL53L1X time of flight sensor which can measure upto 400cm.  
using arduino board i got a pwm out map to the sensor values.  
 ![image](https://discuss.cubepilot.org/uploads/default/original/2X/4/40b45defc1dbb03bc9c274739a4cfcc6264d503e.png)

and measurement are reading correctly with the cube. but it only display upto 200cm only.  
i tried changing all of the max/min , scaling and offset parameters in cube. but nothing seems to work effectively. it almost like there is no reaction to any changes i made in the parameter list. these are my parameters

 ![image](https://discuss.cubepilot.org/uploads/default/original/2X/f/fa0c63716d6210870a5ac3f99558fe77cdb211f4.png)  
 ![image](https://discuss.cubepilot.org/uploads/default/original/2X/3/32a3eb51b4636c6528b9c22459c1cd79beb67d80.png)

can you help me to figure this out. i need the full capability of the sensor to be utilised.  
@MadRC @rmackay9 @Anubis  
thanks in advance.  
best reagrds

---

<div class="post-metadata">

**Author:** ![rmackay9](https://discuss.cubepilot.org/user_avatar/discuss.cubepilot.org/rmackay9/32/1319_2.png) [@rmackay9](https://discuss.cubepilot.org/u/rmackay9)\
**Post date:** [28 June 2021 10:54 UTC](https://discuss.cubepilot.org/t/aux-out-pwm-rangefinder-distance-scaling-not-working-in-copter-4-07-cube-orange/6710/2 "2021-06-28T10:54:10Z")

</div>

[Looking at the driver](https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_RangeFinder/AP_RangeFinder_PWM.cpp#L50) it seems that the pwm to distance conversion is hard-coded to work for the Lidar Lite which has perhaps been the only lidar that we know of that uses PWM.

```auto
reading_cm = value_us/10; // correct for LidarLite. Parameter needed? Converts from decimetres -> cm here

```

So I guess the best thing to do would be to raise an enhancement request on the [issues list](https://github.com/ArduPilot/ardupilot/issues). I wish I had better news but I think you may be the first to try this… certainly the first to report it as far as I know.

P.S. I don’t monitor support on the CubePilot forums much. I do monitor the ArduPilot forums especially for [4.1 beta testing reports](https://discuss.ardupilot.org/c/arducopter/copter-41/159).

---

<div class="post-metadata">

**Author:** ![RAZOR15000](https://discuss.cubepilot.org/user_avatar/discuss.cubepilot.org/razor15000/32/4139_2.png) [@RAZOR15000](https://discuss.cubepilot.org/u/RAZOR15000)\
**Post date:** [28 June 2021 11:00 UTC](https://discuss.cubepilot.org/t/aux-out-pwm-rangefinder-distance-scaling-not-working-in-copter-4-07-cube-orange/6710/3 "2021-06-28T11:00:50Z")

</div>

thank you very much.
