# Differential encoder input

**URL:** <https://discourse.odriverobotics.com/t/differential-encoder-input/232>\
**Category:** Support\
**Created:** [September 15, 2017, 12:29am UTC](https://discourse.odriverobotics.com/t/differential-encoder-input/232 "2017-09-15T00:29:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Null](https://discourse.odriverobotics.com/letter_avatar_proxy/v4/letter/n/c68b51/32.png) [@Null](https://discourse.odriverobotics.com/u/Null)\
**Post date:** [September 15, 2017, 12:29am UTC](https://discourse.odriverobotics.com/t/differential-encoder-input/232/1 "2017-09-15T00:29:25Z")

</div>

Has anyone tried to connect a BLDC motor with an encoder that has differential (+ & -) outputs for each phase?  
In the past I have simply wired the positive side to VCC and the negative to the endpoint,

That does not appear to be working on the Odrive.

I can see the pulses on my scope peaking around 2.8775v.  
Is this high enough to trigger the input opto?  
Should I just input a higher clean voltage from 5V?  
Like this…

 ![differential connections](https://discourse.odriverobotics.com/uploads/default/original/1X/1ab8cdf77204b2ea63458fd04054b5339e322e17.png)

I don’t want to let the smoke out just yet, or I’d have tried it blindly.

---

<div class="post-metadata">

**Author:** ![Wetmelon](https://discourse.odriverobotics.com/user_avatar/discourse.odriverobotics.com/wetmelon/32/10_2.png) [@Wetmelon](https://discourse.odriverobotics.com/u/Wetmelon)\
**Post date:** [September 15, 2017, 4:10am UTC](https://discourse.odriverobotics.com/t/differential-encoder-input/232/2 "2017-09-15T04:10:45Z")

</div>

Just checked the schematic. The signals are all 3.3V based, but the encoder connector J4 has a 5V pin for powering each encoder. There is no opto on this board, the ENC pins are tied directly to the STM32! I don’t know if they’re 5V tolerant, but I wouldn’t risk it. The ENC pins are pulled up to 3.3V through a 3.3k ohm resistor to accommodate open collector encoders. 2.8775V should be more than enough to trigger it…

Can you give us more information on the motor (pole pairs, etc), and the encoder (ppr)?

---

<div class="post-metadata">

**Author:** ![Null](https://discourse.odriverobotics.com/letter_avatar_proxy/v4/letter/n/c68b51/32.png) [@Null](https://discourse.odriverobotics.com/u/Null)\
**Post date:** [September 15, 2017, 4:19am UTC](https://discourse.odriverobotics.com/t/differential-encoder-input/232/3 "2017-09-15T04:19:50Z")

</div>

I should have looked deeper at the schematic, I’m glad I did not try it blindly.  
For the motor, it is a BL Super P5 60 watt.  
I also have a few hundred 400 watt models.  
As best as I can determine both models have 4 pole pairs with a 2000 line/rev encoder.

---

<div class="post-metadata">

**Author:** ![Wetmelon](https://discourse.odriverobotics.com/user_avatar/discourse.odriverobotics.com/wetmelon/32/10_2.png) [@Wetmelon](https://discourse.odriverobotics.com/u/Wetmelon)\
**Post date:** [September 15, 2017, 4:37am UTC](https://discourse.odriverobotics.com/t/differential-encoder-input/232/4 "2017-09-15T04:37:00Z")

</div>

Okay, what actual error are you seeing? The motor just doesn’t run?

Do you have those values correctly input to the motor structs?

> [@Null](#):
>
> I also have a few hundred 400 watt models.

O.o Wanna send me a couple? I don’t have any motors to test with right now! Hah

If you want to chat on IRC, I’ll idle this channel: [https://webchat.snoonet.org/odrive](https://webchat.snoonet.org/odrive)

---

<div class="post-metadata">

**Author:** ![Null](https://discourse.odriverobotics.com/letter_avatar_proxy/v4/letter/n/c68b51/32.png) [@Null](https://discourse.odriverobotics.com/u/Null)\
**Post date:** [September 15, 2017, 4:49am UTC](https://discourse.odriverobotics.com/t/differential-encoder-input/232/5 "2017-09-15T04:49:41Z")

</div>

Correct, the motor runs in encoderless mode but when I connect everything up with positives to VCC and endpoints to negative I get nothing, no driver whine at all. The 400 watt model weighs about 12lbs! They are all surplus from 1998. Sadly they were stored somewhat poorly, quite a few have encoders that go tits up as soon as they see voltage.  
I have tested this particular motor on a 100 amp PY amplifier, and was able to get it to auto-tune (surprisingly) and move far more than the rated load.

---

<div class="post-metadata">

**Author:** ![Wetmelon](https://discourse.odriverobotics.com/user_avatar/discourse.odriverobotics.com/wetmelon/32/10_2.png) [@Wetmelon](https://discourse.odriverobotics.com/u/Wetmelon)\
**Post date:** [September 15, 2017, 5:16am UTC](https://discourse.odriverobotics.com/t/differential-encoder-input/232/6 "2017-09-15T05:16:02Z")

</div>

That’s very strange. All I can think is to double check you’ve set the “control\_mode” value correctly, and then to connect the USB debugger to the drive and check for any errors using the python script and API.

---

<div class="post-metadata">

**Author:** ![madcowswe](https://discourse.odriverobotics.com/user_avatar/discourse.odriverobotics.com/madcowswe/32/1138_2.png) [@madcowswe](https://discourse.odriverobotics.com/u/madcowswe)\
**Post date:** [September 16, 2017, 4:45am UTC](https://discourse.odriverobotics.com/t/differential-encoder-input/232/7 "2017-09-16T04:45:44Z")

</div>

> [@Null](#):
>
> In the past I have simply wired the positive side to VCC and the negative to the endpoint,

In most cases I have seen when interfacing differential signals to signle-ended inputs, it would be terminating the negative side to GND, and wiring the positive signal to the single-ended inputs. The rationale is that it’s common to use GND as the shared reference. Is there any reason you have elected to do it the other way around?

> [@Wetmelon](#):
>
> I don’t know if they’re 5V tolerant

All micro-controller inputs (GPIO, encoder, etc.) are 5V tolerant on V3.3.
