Jump to content

Driving a servo or stepper with an HSO output

Recommended Posts

  • MVP 2023

I was contacted about how to connect the HSO outputs on a V130 to control a not-to-be-named brand of servo.

If you're controlling a servo / stepper with the HSO outputs you're going to be giving it pulses and direction, so it's effectively a stepper.  A servo controller has the added bonus of position feedback, but that's not important for this discussion.

I tried to quickly find a post on the forum that covered properly connecting an HSO to the pulse input and I had a hard time finding what I really wanted with the forum search  function.  I decided it was a topic worth posting and pinning.

Here's a pretty typical input to a servo / stepper control:


The people who put these diagrams together assume you will be pushing the controller with a 5V line driver, which is why it's shown like this.  

The connection shown above tells us nothing about how to connect this to a PLC system.  If you try to drive the PULS and SIGN input with 24V PLC signals you will blow this thing up.

When you're connecting components together from different manufacturers, you have to have an understanding of basic electricity.  There's no way around it.  Ohm's Law combined with Kirkoff's Voltage Law (sum of voltage drops = 0)  always wins.

 Let's dive in with some basic facts about optocouplers.  This is the optocoupler part:


It works by passing current through the LED which makes the LED light up.  That turns on the transistor, which is made so that it's optically sensitive.

Notice I said CURRENT.  LEDs will start working after some forward bias voltage is applied and then get brighter as more current is supplied.  The voltage drop will remain about the same, and eventually if you apply too much current the LED will burn out, just like a light bulb.  A typical absolute maximum input current for an optocoupler is 50 mA.

I always use a voltage drop of 1.2V and a supply current of 10 - 20 mA for optocouplers.

Now let's look at the above circuit designed to run on a 5V pulse input with it's internal 150 ohm resistor and apply math:


As you can see, the current going through the optocoupler is 25 mA.  Well within the specification.

Moving on, the Unitronics HSO output is an open collector N-type Mosfet.  "Open Collector" is manufacturer-speak for "we didn't connect one side of the device.  That's up to you."  They do this to get the speed needed to call it a High Speed Output.  That's another discussion.

Just think of an NPN / Open Collector / Sinking Output as a relay contact to 0V.  You've got to provide the high side.

Here's how the servo / stepper gets connected to the HSO Output:



I've re-done the voltage equation to include the extra parts.  For bonus points you can see if you can come up with the equations yourself.

In addition to connecting the parts together correctly, an extremely important component in the circuit is the pull-up resistor.

Let's say you're trying to hook this up and your boss and/or customer is riding your butt and you don't have a resistor.  So you just connect your +24V to the (+) on the servo and connect the rest as shown.  

Let's do the math:

i = (24 - 1.4) / (0 + 150) = 150 mA

You will blow up the servo, the PLC, or both probably after about 10 pulses.  Less if your output gets stuck on.

If you've read my other posts on connecting stuff to open collector outputs you may remember that my go-to resistor I carry with me is a 2.2K (1/2W).  Let's put a 2.2K resistor in for Rp:

i = (24 -1.4) / (2200 + 150) = 9.6 mA

Right in range.  Yay!


For the answers to these and other impossible questions remember that Google is your friend.

Joe T.




  • Like 1
  • Upvote 3
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...