How to (maybe) design a PCI or Parallel I/O board? Or suitable alternatives

More
15 Dec 2016 20:56 #84220 by gaguilar
Hello all! I'm a new user to the forum! And I intend in being a very active member. I'm here to learn and share what I know (even though it's not much).

I'm relatively new to the CNC world, I have worked with small CNC machines controlled with GRBL and Mach 3. Nothing big. But my end goal is to make a bad ass CNC machine.

Given the specifications of my "ideal" project, I've concluded that I need a closed loop control for controlling servos and receiving data from rotary encoders. I do need extended I/O capabilities. I intend to design a way of interfacing my LinuxCNC PC with a CNC machine as described before. The intention is to NOT use any commercial card or system in order to reduce costs.

All that is pretty nice (in though). But looking at the commercial PCI/ISA cards in the supported hardware page of the Wiki I have come up with a few questions. I intend in replacing a commercial card with something "free" (or libre), but I don't know where to start. If somehow I came up with a PCI or Parallel port card that can do all I need how would I make it talk with LinuxCNC and its tools to have it do something similar to what other commercial cards do? I know this will involve some Linux kernel module code and understanding, I believe there is sufficient information about this in a lot of places. But regarding LinuxCNC as a whole I'm not so sure.
Where can I start looking for this kind of information?
Is this overkill? Can I do what I want in other (maybe easier) way?
What would be involved in other kinds of interfacing LinuxCNC in the formerly described way?

I thank you all in advance for you time!

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

More
15 Dec 2016 23:54 #84231 by andypugh
To see a very simple driver (actually for an ISA card, but the principles are just the same for a PCI card) have a look here:

github.com/LinuxCNC/linuxcnc/blob/master.../drivers/pcl720.comp

You can compile and install such a module separately, without recompiling LinuxCNC or the kernel.
linuxcnc.org/docs/2.7/html/hal/comp.html

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

More
16 Dec 2016 01:33 #84239 by gaguilar
Thanks @andypugh, as I understand it the component described interfaces HAL (which in a sense is LinuxCNC?) with the card it self.
As I see in the lines 40-42 it loads the card address

modparam dummy ioaddr """Base address of card. Separate each card base address
with a comma but no space to load more than one card. eg
loadrt pcl720 ioaddr=0x200,0x200. use 0xNNN to define addresses in Hex""";

Exactly what does this "loadrt pcl720" line do? Is it calling something else?

Is this hal component all someone would need to make the card work?

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

More
16 Dec 2016 01:44 #84242 by andypugh
loadrt is the HAL command that loads a realtime kernel module to act as the hardware driver.

linuxcnc.org/docs/2.7/html/hal/tutorial.html

Once the driver is loaded and has created HAL pins, it can work like any other bit of supported hardware.

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

Moderators: PCWjmelson
Time to create page: 0.093 seconds
Powered by Kunena Forum