Engineering Notes by Oriental Motor

Control Basics: The Difference Between Sink and Source Logic

[fa icon="calendar"] Apr 30, 2020 9:16:14 PM / by Johann Tang

Johann Tang

For someone who has never had experience wiring I/O for motion control, it can be scary the first time.  If devices are not wired correctly, it can cause a range of issues from a motor simply not doing what's expected to irreversible product damage.  I still get that nervous feeling before I press the START button on a demo.  Murphy's Law, anyone?

The difficulty starts when engineers or manufacturers use different wiring terminology.  How can you be sure that you're talking apples to apples?  For example, is a sourcing logic the same as a PNP logic?  "Are we sinking or taking a sinked source?"  In our experience supporting motion control applications, we've heard it all.

Most of the time, tech support engineers will direct you to a wiring diagram and advise you to follow it.  What does sink logic and source logic really mean?  Let's start with some basic terminology.

Terminology

Electronic Circuit (Digital)

An electronic circuit contains electronic components, such as resistors, transistors, capacitors, inductors and/or diodes.  These are connected by conductive wires or traces on a PCB.  It requires a voltage and ground, where ground acts as earth to measure the potential voltage.  A digital electronic circuit uses DC voltage and discrete values (on/off).  A DC power source flows from positive to negative. 

I/O

I/O is defined as inputs/outputs, which in its simplest terms, is anything that executes an output based on an input.  It could be a keyboard (input) and a monitor (output).  In this case, I/O describes the signal communication between two devices (such as a PLC and a stepper driver) using on/off binary logic.

Electrical Load

An electrical load is an electrical component or portion of a circuit that consumes electric power.  This is the opposite of a power source, such as a battery or generator, which produces power.  Examples of loads are light bulbs and motors.  In this case, we're talking about an input circuit.  

Logic Circuit

A logic circuit is defined as an electric circuit (I/O) whose output is a function of the input.  It can include one or more binary inputs (on/off) and a single binary output.  It can consist of any binary electric or electronic devices, including switches, relays, solid-state diodes, and transistors.

Sink Logic vs Source Logic

Sink and source logic circuits are commonly associated with PLC I/O signals, and they only apply to DC circuits.  They differ by the type of component used and define the current flow.

  • Logic is defined by the type of components in the circuit.
  • Logic defines current flow in the circuit.
  • Whatever logic you use for the output, the opposite is required for the input.

Sink Logic

For a sink logic, an NPN transistor provides a path to ground for the electrical load.  For an NPN transistor circuit to work, it must be connected to a PNP transistor circuit.  In other words, a sink logic circuit needs to be connected to a source logic circuit.

Figure 1 shows a sinking digital output that is connected to a sourcing digital input.  The input circuit is connected between the positive power supply side (Vcc) and NPN transistor.

Example of sink logic

Source Logic

For a source logic, a PNP transistor provides a path to voltage for the electrical load.  For a PNP transistor circuit to work, it must be connected to a NPN transistor circuit.  In other words, a source logic circuit needs to be connected to a sink logic circuit.

Figure 2 shows a sourcing digital output that is connected to a sinking digital input.  The input circuit is connected between the PNP transistor and power supply GND (0v).
 
Example of source logic
A useful mnemonic trick is to think of a source logic circuit as the voltage source (it provides a path to the source), and sink logic circuit as sinking towards the ground (it provides a path to ground).
 
TIP 1 : Compare wiring diagrams side by side

When dealing with wiring I/O between a PLC and a servo or stepper driver, a helpful trick that has worked for me is to print out the wiring diagrams from both the PLC and the driver, then put the two side by side.  This helps you visualize the current flow from the voltage source to load to the ground.  

 
Trace the Current Flow

A lot of my support was done remotely on the phone.  That made wiring support very challenging.  To be sure that I don't damage my customers' PLCs, I used to print the wiring diagrams out and then trace the current flow from the voltage source, to the electrical load, all the way to ground.  I have not heard of any complaints.  By supporting remotely, I also learned that it was very important to know exactly which side of the I/O the customer is referring to.

In order for a PLC sourcing output to trigger a sinking input on the driver, we need to make sure that everything has the power it needs.  Sufficient voltage and current need to enter a positive terminal from the PLC side, through the output circuit, to the input circuit (electric load), and then exit out from another terminal back to ground of the power supply to complete the circuit.  On a PLC, each individual I/O signal should provide 2 terminals for connection: one for current going in, and one for going out.  In order to save space, sometimes terminals are grouped together and thus called "common".  This "common" could either be the voltage source, or ground.  More info later.

TIP 2: Don't forget 
It's also important to pay attention to voltage and current requirements for both inputs and outputs.  If the output calls for current-limiting resistors, use Ohm's Law to calculate your external resistance, but don't forget about the internal resistance.  Remember that you have to meet both the voltage and current requirement of the input.

Which is Safer?

It's important to pay attention to the type of logic or transistor in order to determine the correct wiring method.  In addition, there is also a difference with regard to safety.  If by any chance something happens to the customer's device and causes an I/O signal line earth leakage or short circuit of the ground (0v) line, it could be potentially dangerous.

Sink logic short circuit

However, if the source logic was used, the input circuit is not directly connected to the positive power side (Vcc), therefore earth leakage or short circuit of a signal line would not turn the input on.  That's why it's considered as one of the safer connection methods.

Source logic short circuit

Summary

Sink and Source are terms used to define the flow of direct current in an electric circuit.  

  • A sinking input or output circuit provides a path to ground for the electric load.
  • A sourcing input or output provides the voltage source for the electric load. 

Logic is defined by the type of components in the circuit.

  • A sourcing input or output circuit requires a PNP transistor.
  • A sinking input or output circuit requires an NPN transistor.

A simple electronic circuit consists of one digital input connected to a digital output.  To power the circuit, a voltage source, a ground, and a load is necessary.

  • A sourcing input or output circuit provides the necessary voltage for the circuit.
  • A sinking input or output circuit provides the necessary ground for the circuit.
  • The digital I/O provides the electrical load required for the circuit to work.

 

For Flexibility, Use Products That Offer Both Sink and Source Logic

Certain products in the market offer both sink and source logic for flexibility in connections.  What makes this possible are the bidirectional diodes wired in parallel.  Photo couplers also help minimize wiring damages.  Use these products if flexibility is desired, or if you plan to repurpose them later.  

Bidirectional diodes & photo coupler

Here's what the actual wiring diagrams look like for the BLE2 Series brushless motor drivers.    There is one diagram for connecting sink logic outputs and another diagram for source logic outputs.  The PLC, or "Programmable Controller", is on the left, and the motor driver on the right.  The INx designations are inputs, and the OUTx designations are outputs. 

Take a look at the first input "IN-COM0" (Inputs Common).  On the top wiring diagram, it's connected to 24 VDC, and the input has a path to ground.  On the bottom diagram, the "IN-COM0" is connected to the 0v, and the input has a path to the voltage source. The bidirectional diodes in the input circuits allow this.

BLE2 sink, source wiring diagrams

Hopefully this helps.  Please comment if you have other sink and source tricks or info.  Thanks for reading this far and check back for my next post!

 

Topics: AC Motors, Stepper Motors, Alphastep Hybrid Control, Linear & Rotary Actuators, Speed Control, BLDC Motors, Servo Motors

Johann Tang

Written by Johann Tang

Johann Tang is a Product Specialist at Oriental Motor USA Corp. with over 15 years of knowledge and experience supporting applications of various types of electric motors, gearheads, actuators, drivers, and controllers.