First Time Help
- Todd Zuercher
- Topic Author
- Offline
- Platinum Member
- Posts: 5007
- Thank you received: 1441
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.
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.
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);
}
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Topic Author
- Offline
- Platinum Member
- Posts: 5007
- Thank you received: 1441
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.
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.
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.
Neat Stuff!
John
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Topic Author
- Offline
- Platinum Member
- Posts: 5007
- Thank you received: 1441
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)
Please Log in or Create an account to join the conversation.
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.
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.