0

I'm trying to pair a motor controller, and a bi-directional logic level converter to feed a microcontroller with a motor speed signal.

Some signals have already been successfully converted, but a digital out frequency signal of the motor controller still poses problems.

Here is a schematic (motor controller within the slashed line):

enter image description here

Observations:

  1. Reading the signal between pin 10 (GND) and pin 18 (motor frequency) directly from the motor controller without being connected to the logic level converter is a clean, plausible frequency signal, alternating between 0 and 5 V.
  2. When pin 18 is attached to HV1 of the logic level converter, the signal degenerates to a signal alternating between 3.8V and 5V with 0.435 VAC RMS (see scope below). enter image description here
  3. Supply voltage on LOW side of the logic level converter was measured to be 3.3 VDC (between LV and GND).
  4. Supply voltage on HIGH side of the logic level converter was measured to be 5 VDC (between HV and GND).
  5. If a constant 5 VDC signal is fed to the logic level converter on HIGH side, 3.3 VDC can be read on the LOW side.

Motor frequency is in the range 0..8000 Hz.

Question: Is there a flaw in wiring, or is the logic level converter inappropriate for the task?

I've already read this entry, but I was not able to relate it to my problem.

Max Herrmann
  • 103
  • 3
  • 1
    How did you validate Ro of sensor – Tony Stewart EE75 Apr 06 '21 at 10:47
  • 1
    So, what is the question you want answered? And yes, according to scope and how it works matches the schematics. Which basically means, the level converter and the motor controller output are not compatible with each other. – Justme Apr 06 '21 at 10:47
  • @TonyStewartEE75: I didn't validate Ro of the motor controller, since I would expect the data sheet to match the real behavior. – Max Herrmann Apr 06 '21 at 10:53
  • @Justme: How come you know that readings and schematics match? Have you simulated the network? – Max Herrmann Apr 06 '21 at 11:00
  • No, I did not simulate it - it's rather simple. You have a 47k output impedance, so the line is pulled high and low via it. Then you have the 10k pulling up. Already that explains why the voltage is either 5V, or near 4V. Then there is the extra pull-up on the 3.3V side. 47k output impedance is not enough at any level to bring voltage down to 0V if there is 5k pulling it up. – Justme Apr 06 '21 at 11:10
  • You have a 10:1 potential divider attenuating the logic level. All is working as it should. (If you want better logic levels, increase R1 and R2. A lot). –  Apr 06 '21 at 16:44

4 Answers4

2

5V CMOS logic is approx 50 Ohms not approx 50k. Your Digital level shifter is pulling up (attenuating) Ro to 5V with 10k. So your response is as expected.

To make 0 to 5V via 47k down 0 to 2.5V (which ought to work for 3.3V logic) requires a 47k load to ground ONLY. You can always do something different to get 3.2V.

By replacing the level shifter and invert the signal with 5V to 0V and 0V inverted with pullup to 3.3 by;

  • using any transistor BJT or FET as a switch.
Tony Stewart EE75
  • 1
  • 3
  • 54
  • 185
1

There is no flaw in the wiring. The level converter is just not compatible with the motor controller that has a weak output impedance pulling the wire low.

Justme
  • 147,557
  • 4
  • 113
  • 291
1

From the Maxon motor controller operating manual: -

enter image description here

The monitor output you wish to interface with has a 47 kΩ output resistance and you have a 10 kΩ pull-up resistor hence, you will get what you actually see,

Andy aka
  • 456,226
  • 28
  • 367
  • 807
0

Reflecting the answers of Tony Stewart EE75 and Justme, I realized that, if the signal Monitor_n is set to 0/GND, we have a voltage divider, s.t.

$$V_{nHI} = V_{cc} \frac{R_o}{R_o + R_2} = 4.13V,$$

given the value of resistor representing the transistor is comparably large. This corresponds to the lower voltage level \$3.83V\$ I'm observing.

I then tried out Tony Stewart EE75's advice and set up a KiCad simulation of cascaded PN2222A BJTs. The first one converting the input voltage of 5V to 3.3V (and unintentionally inverting it), the second one inverting it once more to get the desired conversion behavior:

enter image description here

The simulation results match the specs:

enter image description here

Thanks to John Woolsey for his Performing A Circuit Simulation In KiCad tutorial!

Max Herrmann
  • 103
  • 3