integrating sensoray pci card with linuxcnc

More
19 May 2015 10:29 #58850 by fit2cnc
Hi guys,

Sorry if my english is off the standard as it is not my first language.

I am building a laser printer using galvo

The two component that I am currently using are as below:
- an class 0 galvo that take in +-10V analog voltage
- sensoray 826 PCI interface card

The idea of having the interface card is to allowed output of +- 10V analog voltage as a position control signal for the galvo and also modulation for the laser.

The problem that I could not get my head around are as below:

1) Is there a way to translate the xy coordinate to a signal value that can be sent/read/wire to an PCI interface card so the interface card know what analog voltage to sent to the galvo.

2) and would I need a hal driver so that linuxcnc know how to pass this value to the PCI interface card?

I had install the given driver from sensoray website. When I run 'lsmod' in terminal I could see the module is running but I am not sure how to make linuxcnc talk or sent a signal to the PCI interface card.

Please advise.

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

More
19 May 2015 21:44 #58861 by andypugh

I had install the given driver from sensoray website. When I run 'lsmod' in terminal I could see the module is running but I am not sure how to make linuxcnc talk or sent a signal to the PCI interface card..


I would be surprised if the supplied driver was a LinuxCNC realtime driver, though it is not impossible.

Do you absolutely have to use the Sensoray card? There are other options for +/- 10V output that already work.

Do you have any documentation for the card or the driver? It can often be surprisingly easy to write a new HAL driver.

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

More
20 May 2015 12:46 #58883 by fit2cnc

Do you absolutely have to use the Sensoray card? There are other options for +/- 10V output that already work.


Not limited to that card, since I got this card with me, I want to try what I can before moving to alternative as I am aware there are alternative out there.

I know that this would be a challenging task but I am willing to face it, but at the moment I can't seem to progress any further cos I am not sure how to get linuxcnc to sent signal back and forth with this card.

Do you have any documentation for the card or the driver? It can often be surprisingly easy to write a new HAL driver.


Here's a S826 card Technical Manual can be found on this link: www.sensoray.com/downloads/man_826_hw_3.0.5.pdf

I was worried that it would be difficult task to write a HAL driver.

Where do I start looking into writing HAL driver for this card? :pinch:

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

More
20 May 2015 16:15 #58888 by andypugh

Where do I start looking into writing HAL driver for this card? :pinch:


The manual you just posted looks like a good start.
The documentation for the hal component generator is here:
linuxcnc.org/docs/html/hal/comp.html
It might be called halcompile on your system, we changed the name.

A HAL driver written in .comp might look a bit like this.
component senso826 "A driver fo the Sensoray 826 board";
description "Only does analog out at the moment";
pin in float analogout-#[8] ;

option extra_setup yes;
option extra_cleanup yes;

function _;

license "GPL";

;;
// This might need the explicit path to the file
#include 826api.h 

FUNCTION(_){
int i;
int ret;
u16 v; /
for (i =0 ; i <8 ; i++){
    v = (analogout(i) + 10) *3276.8
    ret =  S826_DacDataWrite(0, i, v, 0);
}

EXTRA_SETUP(){
    S826_SystemOpen();
}

EXTRA_CLEANUP(){
   S826_SystemClose();
}

This is very minimalist, and probably won't work, but shows the basics and might be a basis for elaboration (value checking, more setup, add the DIO, support for boards other than board 0, handle error returns, etc etc.

It is probably worth a try just to see what happens.

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

More
21 May 2015 20:09 #58916 by fit2cnc


The manual you just posted looks like a good start.
The documentation for the hal component generator is here:
linuxcnc.org/docs/html/hal/comp.html
It might be called halcompile on your system, we changed the name.


Thanks andy, that's a good starting point. I am wondering does the linuxcnc dev version matter when I complied the driver and use it in older version of linuxcnc? and does installing linuxcnc-dev in terminal overlap the current linuxcnc I have my pc?

This is very minimalist, and probably won't work, but shows the basics and might be a basis for elaboration (value checking, more setup, add the DIO, support for boards other than board 0, handle error returns, etc etc.

It is probably worth a try just to see what happens.


Thanks for the heads up. I know what I need to work on for now. Thanks andy!

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

More
27 Jan 2016 20:08 #69165 by TechnoGuru
A register map is available for the 826 board here: www.sensoray.com/downloads/man_826_register_map.pdf

A quick review of the their Linux SDK sources indicates they have paid close attention to real-time issues, so I would expect porting to be straightforward. Between the register map, manual and SDK (includes driver and middleware source) there should be sufficient information to port it.

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

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