Two 50-pin connectors are used for general purpose IO, one 50-pin connector is used for 4-axis motion control.
The cards will accept standard 50-pin ribbon cables, I've made my own longer replacements to the ones provided with the card.
Optoisolator for general purpose IO
Each 50-pin connector provides 16 inputs and 8 outputs. I'm using the HCPL2630 optoisolator.
If you are making a pcb, using the mask below, make sure it prints out at the correct scale. The pcb outline should be 100x160 mm.
For some of the outputs I've provided ground connections just next to the input pins. The idea is to use these for switches. By providing a ground pin next to the input I can wire the two ends from the switch neatly to one place on the board.
Like any true engineer I've left out the actual component values from the drawings ! The decoupling caps should be about 100 nF, in my design the current limiting resistors for the LED side of the optoisolator are about 360 Ohms, and the pullups on the transistor side are XXX Ohm. Note that the Mesa 5i20 has internal pullup resistors, so for the inputs to the card, no separate pullup resistors are needed.
The PCB I made is one-sided. But the circuit requires a couple of connections on the component side too. These are marked in blue in the color figure below, and if you look at the picture above you can see that I've used 0 Ohm jumpers(the beige things) for the component-side connections.
Click the pictures to download higher resolution pdfs.
Optoisolator for motor control
This is the optoisolator for the motioncontrol connector. As you can see there are six optoisolators for inputs and six for outputs which makes for a total of 12 inputs and 12 outputs, or 3 inputs (encoder A,B,Index) and 3 outputs(PWM, Dir, Enable) per axis.
In this first attempt at an optoisolator card I thought I'd save on components and not include decoupling capacitors. That was dead wrong, the card won't work at all without them. So I had to solder them directly to the legs of the chips...
Instructions like above: resistor and capacitor values as above. When building, remember the component side jumpers, and check the 100x160mm boardsize from the printout before making a pcb.
- This is supposed to be an isolator. Don't connect together ground or power (+5V) from the two sides. If you look at the schematic I've used the normal ground symbol for the m5i20 side, and I've called the other side MGND (Motor Ground). Similarly the +5V supplies are separate, '+5V' on the mesa side, and MPWR (motor power) on the other side.
- For optoisolating the general purpose IO, Mesa Electronics also makes a board called the 7I37:
It's much nicer looking than my homemade attempt, and sells for $69.
- The design presented above is probably not very efficient or particularly fast and/or smart. I asked for some comments on cnczone, and Mariss Freimanis (of Geckodrive fame) replied with this circuit idea:
Mariss writes: "the HCPL-2531 is cheaper, uses less current and is fast enough. The HCPL-2531 collector current is a paltry 330uA (3.3V / 10K). The PN2222A purpose is to minimize the Miller Effect on the HCPL-2531 transistor by keeping that transistor's collector voltage swing to under 0.6V (Miller Effect is the collector to base capacitance negative feedback that slows the voltage rate on the collector). The PN2222A has a 1mA collector current, adequate for a 1 MHz bandwidth. The isolated-side current consumption is 1mA for logic '0' and 330uA for a logic '1'."