First Time Help

More
28 Jun 2011 04:49 #10910 by Todd Zuercher
This is my fist time trying to set up EMC2.
The machine I am trying to do this on had/has DOS PC with a 48 bit I/O card and step dir servo drives.
The I/O card is configured by dip switches and jumpers, and does not use any drivers (at least in this application). It does have some timer/counter compatibility but they are not being used. Here is a link to its manual.

www.artisan-scientific.com/info/advantech_pcl_720_manual.pdf

The card connects to the router with 4 20 pin ribbon cables 2 with 16 inputs and 2 with 16 outputs. It is currently configured to use IRQ5 and addresses 300-303 for the I/O. I know what the DOS program was configured for. But I don't know how to translate this to EMC2.

For example the X axis uses
300 bit 2 for step
300 bit 0 for dir
301 bit 2 for limit hi
301 bit 0 for limit low
303 bit 2 for enable (input from servo drive)

Do I have to write my own driver?

Or is there an easy way/place to input all this information?

Please Log in or Create an account to join the conversation.

More
28 Jun 2011 11:48 #10918 by BigJohnT
Replied by BigJohnT on topic Re:First Time Help
The first thing I'd do is to boot up with the live CD and check the latency and even if you can boot up with Ubuntu. If you have older hardware you might try the live CD with the 8.04 version of Ubuntu if the 10.04 version fails to boot.

Is the I/O card a pci card?

If the servo drives take step and direction inputs there is the option to ditch the I/O card and replace it with something that is supported by EMC all ready... or write your own driver for your card.

John

Please Log in or Create an account to join the conversation.

More
28 Jun 2011 12:06 #10920 by andypugh
Replied by andypugh on topic Re:First Time Help
Todd Zuercher wrote:

301 bit 0 for limit low
303 bit 2 for enable (input from servo drive)
Do I have to write my own driver?


I suspect that you will need to, yes.
The good news is that it probably isn't very difficult.

I think you could write the driver in comp
linuxcnc.org/docs/html/hal_comp.html

Something a bit like this:
component advantech "driver for advantech card";
pin out bit out x-step;
...
function read;
function write;
...
;;
FUNCTION(write){
   long reg300, reg 301;
   reg300 = x_dir >> 0 || x_step >> 2;
   reg301 = limi_hi >> 0 || lim_lo >> 2;
   outb(0x300, reg300);
   outb(0x301, reg301);
}
(and so on)

Please Log in or Create an account to join the conversation.

More
28 Jun 2011 12:37 #10921 by Todd Zuercher
Replied by Todd Zuercher on topic Re:First Time Help
The card is an ISA card (but there is a PCI version avalible)

What prompted the Idea of a change was a lightning strike that took out the old PC.
I have already installed 10.04 on the new PC.
Max Interval 1002113 Max Jitter13140 Base thread max interval 38164 max jitter 13383

I was hoping not to have to redo all the wiring that was already done and works. Its nice to have something that just plugs in.

Please Log in or Create an account to join the conversation.

More
28 Jun 2011 12:40 #10922 by BigJohnT
Replied by BigJohnT on topic Re:First Time Help
Andy,

I can follow most of your code but I'm stumped by this line:

reg300 = x_dir >> 0 || x_step >> 2;

Can you expand a bit on what this line does just for my education?

Thanks
John

Please Log in or Create an account to join the conversation.

More
28 Jun 2011 13:05 #10924 by andypugh
Replied by andypugh on topic Re:First Time Help
BigJohnT wrote:

I can follow most of your code but I'm stumped by this line:
reg300 = x_dir >> 0 || x_step >> 2;
Can you expand a bit on what this line does just for my education?


Well, looking at it again it probably needs to use << and possibly | instead of ||.

<< and >> are bit-shift operators, so if x_step is 1 then x_step << 2 == 4, or bit 2.
What the code is doinf is bit-shifting the pin values to the rcorrct positions, then bitwise-or-ing them together into one byte

Please Log in or Create an account to join the conversation.

More
28 Jun 2011 13:32 #10926 by BigJohnT
Replied by BigJohnT on topic Re:First Time Help
Ok, that makes sense... so you have "assemble" your bits into a byte then send it out.

Neat Stuff!
John

Please Log in or Create an account to join the conversation.

More
28 Jun 2011 17:00 - 28 Jun 2011 19:22 #10928 by Todd Zuercher
Replied by Todd Zuercher on topic Re:First Time Help
I am not sure if I am up to the task of writing this. I really don't know anything about programing langueges.

Would anyone be interested in writing something up for me. I am sure we could arrange some kind of payment for your work.

If I can't make this work then I will have to try setting up something off of a couple of paralell ports

Here is what I gathered from our old programs configuration file. (there is a lot of stuff that isn't used on our machine though)

Address bit I/O Description

300 0 Out X Direction
300 1 Out Y Step
300 2 Out X Step
300 3 Out Y Direction
300 4 Out Z Direction
300 5 Out W Step (not used?)
300 6 Out Z Step
300 7 Out W Direction (not used?)

301 0 Out routers on (not used)
301 1 Out
301 2 Out dust boot (not used)
301 3 Out
301 4 Out
301 5 Out
301 6 Out Z tool bar up/down (not used)
301 7 Out

302 0 Out Z forward (not used)
302 1 Out Z spindle on (not used)
302 2 Out Z speed 13A (not used)
302 3 Out
302 4 Out Z speed 13B (not used)
302 5 Out W speed 13B (not used)
302 6 Out Z speed 13C (not used)
302 7 Out W speed 13A (not used)

303 0 Out Vacuum
303 1 Out W forward (not used)
303 2 Out spare 5VDC CPU SIGNAL
303 3 Out W spindle on (not used)
303 4 Out dust collector (not used
303 5 Out spare 5VDC CPU SIGNAL OR NEC OPTO
303 6 Out spare 5VDC CPU SIGNAL
303 7 Out spare 5VDC CPU SIGNAL OR NEC OPTO

300 0 In Z servo enable
300 1 In tool 6 (not used)
300 2 In servo enable (not used)
300 3 In tool 5 (not used)
300 4 In W low limit (not used?)
300 5 In tool bar up (not used)
300 6 In W hi limit (not used?)
300 7 In tool bar down (not used)

301 0 In X low limit switch
301 1 In Z hi limit switch
301 2 In X hi limit switch
301 3 In Z low limit switch
301 4 In Y low limit switch
301 5 In ?
301 6 In Y hi limit switch
301 7 In Master Enable Off

302 0 In tool in changer (not used)
302 1 In
302 2 In clamp (not used)
302 3 In Z spindle up to speed (not used)
302 4 In fan over temp (not used)
302 5 In tool 4 (not used)
302 6 In Laser (not used)
302 7 In tool 3 (not used)

303 0 In Y servo enable
303 1 In tool 2 (not used)
303 2 In X servo enable
303 3 In tool 1 (not used)
303 4 In W servo enable (not used)
303 5 In tool 8 (not used)
303 6 In servo enable (not used)
303 7 In tool 7 (not used)
Last edit: 28 Jun 2011 19:22 by Todd Zuercher.

Please Log in or Create an account to join the conversation.

More
28 Jun 2011 18:13 #10929 by andypugh
Replied by andypugh on topic Re:First Time Help
Your latency looks good.
It should be fairly easy to make a driver, I will try to do one later tonight.

In the meantime it is probably worth you going through the steps to make sure that "comp" works. I think you need to follow steps 1.3 here
wiki.linuxcnc.org/emcinfo.pl?Contributed..._install_a_component
It is probably worth checking that one of the simple example files in the comp page compiles and installs properly too.

Please Log in or Create an account to join the conversation.

More
28 Jun 2011 21:36 #10933 by btvpimill
Replied by btvpimill on topic Re:First Time Help
Andy, I am following this with great intrest. If I understand what you are doing, you will have a driver to talk to the parallel port in a protocal that the OP's I/O board is looking for. ie: step/dir in reg 300,...

I am very intrested in creating a driver myself for a custom board, but have tons of questions. I will wait to ask them until after we see the driver you create here.

After which, if its OK with you, I would like to start a thread in a more appropiate section and dissect your driver for the OP. So is this OK, and what section do you suggest?

Please Log in or Create an account to join the conversation.

Time to create page: 0.172 seconds
Powered by Kunena Forum