Skip to main content
Added images in-line.
Source Link
Transistor
  • 180.3k
  • 14
  • 193
  • 417

I am working with a motor control board which controls a DC motor (speed and direction). This board uses two SPDT relays for direction, and some sort of PWM for speed.

Here's an abbreviated schematic, including my own circuit.

enter image description here

I need to feed the motor direction to a MCU using TTL levels.

I tapped the circuit at point "A", which outputs 0V when relay is not energized and 0.8V when energized. This corresponds with the motor directions.

I amplified this signal to TTL levels using the circuit shown.

This works perfectly, except when the motor is running slowly (heavy PWM applied to motor outputs). In this state there are repeated spikes at point A and B (see this example) which cause the MCU to think the pin has changed state.

Screen grab of voltage a point A.

You can see the low-pass filter intended to attenuate anything above 2 Hz. But it doesn't filter these spikes for some reason.

Does anyone have any suggestions for cleaning up this signal?

The controller and my circuit share a common ground.

Thank you for any advice!

I am working with a motor control board which controls a DC motor (speed and direction). This board uses two SPDT relays for direction, and some sort of PWM for speed.

Here's an abbreviated schematic, including my own circuit.

I need to feed the motor direction to a MCU using TTL levels.

I tapped the circuit at point "A", which outputs 0V when relay is not energized and 0.8V when energized. This corresponds with the motor directions.

I amplified this signal to TTL levels using the circuit shown.

This works perfectly, except when the motor is running slowly (heavy PWM applied to motor outputs). In this state there are repeated spikes at point A and B (see this example) which cause the MCU to think the pin has changed state.

You can see the low-pass filter intended to attenuate anything above 2 Hz. But it doesn't filter these spikes for some reason.

Does anyone have any suggestions for cleaning up this signal?

The controller and my circuit share a common ground.

Thank you for any advice!

I am working with a motor control board which controls a DC motor (speed and direction). This board uses two SPDT relays for direction, and some sort of PWM for speed.

Here's an abbreviated schematic, including my own circuit.

enter image description here

I need to feed the motor direction to a MCU using TTL levels.

I tapped the circuit at point "A", which outputs 0V when relay is not energized and 0.8V when energized. This corresponds with the motor directions.

I amplified this signal to TTL levels using the circuit shown.

This works perfectly, except when the motor is running slowly (heavy PWM applied to motor outputs). In this state there are repeated spikes at point A and B (see this example) which cause the MCU to think the pin has changed state.

Screen grab of voltage a point A.

You can see the low-pass filter intended to attenuate anything above 2 Hz. But it doesn't filter these spikes for some reason.

Does anyone have any suggestions for cleaning up this signal?

The controller and my circuit share a common ground.

Thank you for any advice!

deleted 50 characters in body
Source Link
Ryan Griggs
  • 2.7k
  • 2
  • 34
  • 56

I am working with a motor control board which controls a DC motor (speed and direction). This board uses two SPDT relays for direction, and some sort of PWM for speed.

Here's an abbreviated schematicabbreviated schematic, including my own circuit.

I need to feed the motor direction to a MCU using TTL levels.

I tapped the circuit at point "A", which outputs 0V when relay is not energized and 0.8V when energized. This corresponds with the motor directions.

I amplified this signal to TTL levels using the circuit shown.

This works perfectly, except when the motor is running slowly (heavy PWM applied to motor outputs). In this state there are repeated spikes at point A and B (see this example) which cause the MCU to think the pin has changed state.

You can see the low-pass filter intended to attenuate anything above 2 Hz. But it doesn't filter these spikes for some reason.

Does anyone have any suggestions for cleaning up this signal?

The controller and my circuit share a common ground.

Thank you for any advice!

I am working with a motor control board which controls a DC motor (speed and direction). This board uses two SPDT relays for direction, and some sort of PWM for speed.

Here's an abbreviated schematic, including my own circuit.

I need to feed the motor direction to a MCU using TTL levels.

I tapped the circuit at point "A", which outputs 0V when relay is not energized and 0.8V when energized. This corresponds with the motor directions.

I amplified this signal to TTL levels using the circuit shown.

This works perfectly, except when the motor is running slowly (heavy PWM applied to motor outputs). In this state there are repeated spikes at point A and B (see this example) which cause the MCU to think the pin has changed state.

You can see the low-pass filter intended to attenuate anything above 2 Hz. But it doesn't filter these spikes for some reason.

Does anyone have any suggestions for cleaning up this signal?

The controller and my circuit share a common ground.

Thank you for any advice!

I am working with a motor control board which controls a DC motor (speed and direction). This board uses two SPDT relays for direction, and some sort of PWM for speed.

Here's an abbreviated schematic, including my own circuit.

I need to feed the motor direction to a MCU using TTL levels.

I tapped the circuit at point "A", which outputs 0V when relay is not energized and 0.8V when energized. This corresponds with the motor directions.

I amplified this signal to TTL levels using the circuit shown.

This works perfectly, except when the motor is running slowly (heavy PWM applied to motor outputs). In this state there are repeated spikes at point A and B (see this example) which cause the MCU to think the pin has changed state.

You can see the low-pass filter intended to attenuate anything above 2 Hz. But it doesn't filter these spikes for some reason.

Does anyone have any suggestions for cleaning up this signal?

The controller and my circuit share a common ground.

Thank you for any advice!

Shortened for easier reading per Andy aka
Source Link
Ryan Griggs
  • 2.7k
  • 2
  • 34
  • 56

I am working with a motor control board which controls a DC motor. The motor can be reversed (speed and the speed can be controlled by the boarddirection).

  This board uses two SPDT relays for reversingdirection, and some sort of PWM to controlfor speed.

I have drawnHere's an abbreviated schematic of how I think this system works, as well asincluding my own circuitrycircuit.

My task isI need to determine which directionfeed the motor is being run. I need to input this informationdirection to a single binary digital pin on a standalone microcontrollerMCU using TTL levels.

I determined that the controller energizes one relay for each direction of rotation. The output of the controller ASIC appears to be 5V TTL logic level. However, after the signal passes throughtapped the resistors, it can be measuredcircuit at point "A" as, which outputs 0V when relay is not energized and 0.8V (energized relay) and 0V (de-energized relay)when energized. This corresponds with the motor directions.

I would prefer to avoid tapping this circuit in front of the resistor, because it's a SMD chip and the relay is very close to the chip, leaving very little room for soldering. So I connected using an existing via at point "A" instead, and decided to amplifyamplified this signal back to TTL levels using the circuitrycircuit shown.

This works fineperfectly, except when the motor begins to apply heavy PWM to the control circuitis running slowly (when running theheavy PWM applied to motor slowlyoutputs). The relay remains energized duringIn this operation, but I can see largestate there are repeated spikes appear at point A, which are amplified to point B, and B (see this example) which cause the microcontroller to detect changes in value. Thus, the Direction value beginsMCU to oscillate whenthink the motor runs slowlypin has changed state.

I observed these spikes with an oscilloscope and decided that I needed aYou can see the low-pass filter to attenuate them.

I looked up the appropriate resistor/capacitor valuesintended to attenuate frequenciesanything above 2Hz, and you can see the results shown on the schematic2 Hz.

However the problem is that this But it doesn't work: thefilter these spikes are still present, and continue to confuse my MCUfor some reason.

Does anyone have any suggestions for cleaning up this signal or blocking these spikes to ensure a clean digital 0V/5V TTL level is passed to the MCU?

Did I implement the high-pass filter incorrectly? Why doesn't it block these spikes?The controller and my circuit share a common ground.

Thank you for any advice!

I am working with a motor control board which controls a DC motor. The motor can be reversed and the speed can be controlled by the board.

  This board uses two SPDT relays for reversing, and some sort of PWM to control speed.

I have drawn an abbreviated schematic of how I think this system works, as well as my own circuitry.

My task is to determine which direction the motor is being run. I need to input this information to a single binary digital pin on a standalone microcontroller.

I determined that the controller energizes one relay for each direction of rotation. The output of the controller ASIC appears to be 5V TTL logic level. However, after the signal passes through the resistors, it can be measured at point "A" as 0.8V (energized relay) and 0V (de-energized relay).

I would prefer to avoid tapping this circuit in front of the resistor, because it's a SMD chip and the relay is very close to the chip, leaving very little room for soldering. So I connected using an existing via at point "A" instead, and decided to amplify this signal back to TTL levels using the circuitry shown.

This works fine except when the motor begins to apply heavy PWM to the control circuit (when running the motor slowly). The relay remains energized during this operation, but I can see large spikes appear at point A, which are amplified to point B, and cause the microcontroller to detect changes in value. Thus, the Direction value begins to oscillate when the motor runs slowly.

I observed these spikes with an oscilloscope and decided that I needed a low-pass filter to attenuate them.

I looked up the appropriate resistor/capacitor values to attenuate frequencies above 2Hz, and you can see the results shown on the schematic.

However the problem is that this doesn't work: the spikes are still present, and continue to confuse my MCU.

Does anyone have any suggestions for cleaning up this signal or blocking these spikes to ensure a clean digital 0V/5V TTL level is passed to the MCU?

Did I implement the high-pass filter incorrectly? Why doesn't it block these spikes?

Thank you for any advice!

I am working with a motor control board which controls a DC motor (speed and direction). This board uses two SPDT relays for direction, and some sort of PWM for speed.

Here's an abbreviated schematic, including my own circuit.

I need to feed the motor direction to a MCU using TTL levels.

I tapped the circuit at point "A", which outputs 0V when relay is not energized and 0.8V when energized. This corresponds with the motor directions.

I amplified this signal to TTL levels using the circuit shown.

This works perfectly, except when the motor is running slowly (heavy PWM applied to motor outputs). In this state there are repeated spikes at point A and B (see this example) which cause the MCU to think the pin has changed state.

You can see the low-pass filter intended to attenuate anything above 2 Hz. But it doesn't filter these spikes for some reason.

Does anyone have any suggestions for cleaning up this signal?

The controller and my circuit share a common ground.

Thank you for any advice!

Source Link
Ryan Griggs
  • 2.7k
  • 2
  • 34
  • 56
Loading