0
\$\begingroup\$

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.

\$\endgroup\$
6
  • 1
    \$\begingroup\$ How did you validate Ro of sensor \$\endgroup\$ Apr 6, 2021 at 10:47
  • 1
    \$\begingroup\$ 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. \$\endgroup\$
    – Justme
    Apr 6, 2021 at 10:47
  • \$\begingroup\$ @TonyStewartEE75: I didn't validate Ro of the motor controller, since I would expect the data sheet to match the real behavior. \$\endgroup\$ Apr 6, 2021 at 10:53
  • \$\begingroup\$ @Justme: How come you know that readings and schematics match? Have you simulated the network? \$\endgroup\$ Apr 6, 2021 at 11:00
  • \$\begingroup\$ 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. \$\endgroup\$
    – Justme
    Apr 6, 2021 at 11:10

4 Answers 4

2
\$\begingroup\$

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.
\$\endgroup\$
1
\$\begingroup\$

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.

\$\endgroup\$
1
\$\begingroup\$

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,

\$\endgroup\$
0
\$\begingroup\$

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!

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.