Hello Guest it is September 28, 2020, 07:00:19 AM

Author Topic: noob - help on breakout card and parallel port card  (Read 11086 times)

0 Members and 1 Guest are viewing this topic.

noob - help on breakout card and parallel port card
« on: May 16, 2009, 04:30:39 PM »
help - i have a cnc4pc c11 breakout card and I cant seem to get the charge pump to work

so far, i have the following working via the card with no issues. (jumper set to ignore charge pump)
... pins 2,3,4,5,6,7 as step/ dir pins on the x,y,z axis (output)
... pin 10 working as an input for e- stop

I can't seem to get the following working
...pin 1 as an output (tried to use this as a step for x axis and failed)
...pin 16,17 working as an output (i tried setting them as enable outputs in Mach 3)
.... charge pump doe not work when set to card 1 pin 17 in pins and ports )

i read somewhere ( i think it was on one the mach 3 forums) that some parallel port cards can't sink enough current on certain pins to drive the opto isolators

can anyone help fill in the blanks for me?  is this correct? what do i do about it?

Offline jimpinder

  •  1,232 1,232
  • Wakefield, West Yorks, UK
    • View Profile
Re: noob - help on breakout card and parallel port card
« Reply #1 on: May 17, 2009, 02:26:13 AM »
The 25 pin LPT1 port is actually three ports in one.

The main data port is 2,3,4,5,6,7,8,9 at address &H378. The input side of the port is pins 10,11,12,13 and 15 at address &H379 and the four secondary outputs are pins 1,14,16 and 17. Pins 18 to 25 are signal return wires. A bit of a mismash.

You should be able to use any outputs with any other, but depending how your CNC4PC breakout board is wired internally, you are better to use (as you have done) pins 2,3 - 4,5 and 6,7 as the axis outputs. Make sure, however, that each section of the board has a signal return wire connected (if required)

You will eventually require - outputs for your spindle motor, and your limit/home switches, and will soon come up against a shortage of pins. I do not bother with the charge pump - it is easier to turn the computer on, and when I have Mach up and running, then turn on the supply to the lathe electronics. Neither do I bother with the enable wires to the various axis - I can't see why you need them. If you are using the machine, they would be on anyway.

The only exception is I have an enable to my milling head because I have a combined lathe and mill - but that is a manual switch and does not use up input pins.

The way to test your outputs reliably is to go to Ports and Pins/Spindle set up and untick "disable spindle relays". Set the output for M3 to #1 and the output for M4 to #2. If you now go to  Ports and Pins/Output signals then you will see you can allocate Output #1 or #2 to any pin you wish.

The M3 (#1) will output if M3 is written in the MD1 (or if the spindle start button is pressed) and #2 will output if M4 is written in the MDI line (M5 cancels both outputs) By allocating these two outputs in turn you can test each output pin on your CNC4PC board with a volt meter. I think the CNC4PC board inverts the signals, so an output may appear as a zero (when on) and 5v when off. You can reverse that by ticking active low on the Ports and Pins page.

The other thing I seem to remember is that the CNC4PC board also had different common return wires that could be wired with the various sets on inputs/outputs. This makes it difficult to set up, becasue it tries to be all things to all people.

You should, however, using the method above be able to trace the signal from the computer, along to the "input" side of the breakout board (this should be a +5 volt signal. You should then be able to trace it through the board to the output side (where it could be a 0v signal).

The inputs and outputs of all the pins are shown on the diagnostic page of Mach 3 to start you off - if it appears there it is, at least getting out of the computer.

Not me driving the engine - I'm better looking.
Re: noob - help on breakout card and parallel port card
« Reply #2 on: May 17, 2009, 03:39:36 PM »
Thanks Jim. that gave me a definite way of checking.(I've never used any cnc progs/machines before - complete noob)

the point was to get the output pins to work and using the charge pump would have allowed me to check pin 17 easily- I thought. 

I've yet to implement limits, homes. spindle speed, suds pum, pdirection or any others(probe!) yet. in fact I've only connected up the one axis. once the second axis is connected then I cannot use the mill manually.

so... following your excellent advice...

in mach 3  I enabled motor spindle as output 1 and 2 then assigned these outputs to each output pin on card one in turn using the commands m3,m4 (m5 to switch off) .  this showed that

pins 2,3,4,5,6,7,8,9,14 worked - could switch them on and off

pins 1,16,17 did not work

in all cases the diagnostic screen in mach 3 showed that it had enabled the relevant output

this was tested using the led  (on the card)and in case the led buffers had blown I also put a meter from these pins to ground to check for a voltage - none.

further info
...this was still after the opto isolators
... tested the parallel cable to ensure all pins wired and yes they are
...checked the port address and there are no conflicts
...there is a second parallel port which is connected to a hand-wheel (which I built) and this works fine
.... can't swap to the other port as I modified the pci card to pass +5v to the hand-wheel using 2 of the common(ex) ground leads
....have not checked directly on the p port to see if there are any signals there yet... job for the morning

any other ideas?
« Last Edit: May 17, 2009, 03:55:19 PM by bpgoa »
Re: noob - help on breakout card and parallel port card
« Reply #3 on: May 18, 2009, 07:23:38 AM »
ok...   checked on the cable at the point it enters the card and all pins

... 1,16,17

are switching to +5v amd +0.01v

 guess there must be a fault on the card...   

I Hate it when brand new kit doesn'tr work :(

Re: noob - help on breakout card and parallel port card
« Reply #4 on: May 18, 2009, 08:58:23 AM »
one more piece of info - all input pins work ok.

Offline jimpinder

  •  1,232 1,232
  • Wakefield, West Yorks, UK
    • View Profile
Re: noob - help on breakout card and parallel port card
« Reply #5 on: May 21, 2009, 04:52:32 AM »
Faults are not unknown on new cards - you are obviously quite competant around electronics, therefore I would say you are ready to roll.
I can't see why there should be a hidden "enable" or earth return for 1,16 and 17 especially if 14 works.

The only thing you need, to enable you to at least "dabble" some more in the mysteries of CNC is to set up two axis.
I dont know what drivers you have chosen - if it is a "set" from CNC4PC then the explanation and diagrams from them should be clear enough.

To go back to Mach, then only thing then is to set up your "steps per unit" and "acceleration" on the motor tuning page.
First set up your "master" units on Config/Select Native Units if you have not already done so. This has no relation to what units you might use while cutting, (which can be changed by instruction) but is the units in which you set up the system. If you mill is calibrated in "imperial" use imperial, if "mm s" use metric.

Steps per units (Config/Motor tuning) is worth setting up before you try and get the motors turning. A stepper motor has 200 steps per rev, your driver might use 8 or 10 micro steps (if you have a choice, use 8 or ten) if you have any gearing between your leadscrew and the stepper (I had a 3 to one reduction) and finally the leadscrew - mine was 10 turns to the inch. If you multiply these all out you get 200 x 10 x 3 x 10 = 60,000 steps per inch. Even ignoring the microstep multiplier, I would still have 6 divisions for 1/1000th of an inch.I say ignoring the microsteps, becasue these are an electronic division, not a mechanical one, and while you must add them into your calculation (and they improve the smoothness and reliability), the exact position they settle in cannot be guaranteed i.e. they are not spaced out evenly over one step.

I recently replaced my leadscrew with a metric ball screw, and had to reset all my machine in metric - same calculation 200 x 10 x 3 i.e. 6000 up to the leadscrew, by one rotation of the leadscrew moved the table 5 mm, so divide by 5 - 1,200 steps per millimeter.

Set your velocity at a modest speed e.g. 4 inche or 100 mm per min and then your acceleration at say 1 inch or 10mm per sec per sec which will get you started.

You should be then able to jog you machine up and down, and then enter commands in the MDI line to move the  cutter.

Get up to that and you are almost ready

Not me driving the engine - I'm better looking.
Re: noob - help on breakout card and parallel port card
« Reply #6 on: May 21, 2009, 10:13:40 AM »

got the chip datasheets out and traced the circuits.

the circuit is like this

The input pin is conected directly to a lt847 optocoupler..

the output transistor has its input pin at 5v and this is fed to an inverting schmit trigger (74ls14n)

when a voltage is passed (pport pin goes high) the optocoupler produces light and this activates the phototransistor of the output stage which in turn sinks the voltage to ground. the amount of voltage it sinks to ground depends on the input current.

so.... the input to the schmit inverter is high when no current passes on the input to the optocoupler... when enough current passes on the input to the optocoupler it feeds the gate and drops the voltage from 5v to near 0v.  This is then inverted at a clean crossover point by the schmit inverter an produces a 5v (isolated) on its output.  This output is then buffered twice - first to drive the led and second to drive the optocoupled and buffered output to your designated use.

my deduction from the results below is that the optocoupler input (from the Pport) is not providing enough current to get the output transistor to sink enough voltage to feed the schmit inverter with a 0v (logic low signal)

Results below...

got the meter out..

started with the LT847 optocoupler

output set Low to p-port  pin 16

pin7 voltage (taken from pc powered ground) is 0.01v

pin10 voltage (taken from pc powered ground) is 5.15v

output set high to p-port  pin 16

pin7 voltage (taken from pc powered ground) is 1.06v

pin10 voltage (taken from pc powered ground) is 2.63v

onto the 74ls14n

with the output on pin 16 switched on  traced the 2.63 v to pin 13 .

pin 12 it's inverted output (of the pair) is still held low (0.17v)

my conclusion from this is that

The chips are fine

pport pin 16 isn't providing enough current to drive the gate (via light) in the optoisolator  to the point where it sinks the voltage on its output low enough to trigger the schmit inverter.

from that i can only deduce that i need a new pport card .   

can anyone confirm my ramblings?
Re: noob - help on breakout card and parallel port card
« Reply #7 on: May 21, 2009, 10:18:03 AM »

These are my calculations for the sttepping...  do they make sense? are the figures ok?

Resolution required
All the design work is in the metric format therefore it is proposed to allow work to be manipulated to an accuracy of one thousandth of an mm.
Step accuracy required = 0.001mm or 10 microns
The X axis
The x axis (side to side as viewed from the front) is linked via a 2:1 belt drive to a stepper motor.
Each revolution of the machine spindle moves the table 2mm; therefore each motor revolution causes the table to move 1 mm.
The stepper motors move at 1.8 degrees of movement per step therefore has 200 steps per revolution.
This gives a table movement of 0.005mm per step.
Micro step setting
Micro stepping can be set up to allow the following configurations for the X axis
steps   Multiplier   Table movement per step
200 (no micro step)   1   0.005mm
400   2   0.0025mm
800   4   0.00125mm
1600   8   0.000625mm

Configuration of stepper motor driver
It has been decided to configure the micro step settings to 4 giving a movement of 0.00125mm as a starting position.
The motors have a maximum current rating of 2.5A and the drivers can be configured for either 2.4A or 2.7A. As a starting point we will set the driver up to deliver 2.4A
Connection to the breakout card
The X STEP signal is connected to pin 2
The X DIR signal is connected to pin 3
The driver is active low therefore mach 3 has to output a logic 1 (+5v) to count as a pulse.

Offline jimpinder

  •  1,232 1,232
  • Wakefield, West Yorks, UK
    • View Profile
Re: noob - help on breakout card and parallel port card
« Reply #8 on: May 22, 2009, 02:22:32 PM »
Seems OK to me - I would use 8 microstep position thought. It achieves your required accuracy straight away, and Mach can calculate that fast anyway. You must realise, however, that your accuracy cannot be guaranteed if you are relying on microsteps. Over the eight microsteps, the positions are not necessarily equally spaced between each other. They are accurate at position 0,(within the parameters of the motor) but could vary slightly between the others - but then again - what are you machining that requires that accuracy - aeroplane parts.

Set up your pulses per unit (mm's) at whichever microstep you decide to use, and you should be away.
Not me driving the engine - I'm better looking.
Re: noob - help on breakout card and parallel port card
« Reply #9 on: May 25, 2009, 03:33:48 PM »
I should say at this point.... 

That CNC4PC confirmed the results of my electronics testing above. 

Their  c11v8 cards (current release) will work with the current being delivered from my parallel port card..

a new parallel port card is only £10

Even though this is not their fault, they are rectifying the issue.

Their support throughout (I started this post on a Friday night in the UK as I knew they would not be in the office till Monday and wanted to work on it over the weekend) has been second to none.

to me, the indication of a quality organisation is how they deal with you when things go wrong.

Thanks everyone.