From: Folderol on
The company I work for has a need for a control system that will use 6
digital inputs.

One will be a timing pulse with an absolute maximum frequency of 12kHz

There will be an reset pulse every 10,000 counts

We could probably work with 6kHz and 5,000 counts but the extra
resolution would be *really* nice as it would correspond to a
positioning accuracy of 0.1mm

There will also be 4 state inputs monitored at the timing rate

Provisionally I've thought of using the timing pulses under interrupts
to simply copy the 4 state inputs into an array, incrementing the array
index each time, unless there is a reset pulse as well in which case
zero the array index.

With this array constantly updated the rest of the control system can
manipulate bits of the data in a normal loop, do some basic graphics
and send RS232 data to 4 stepper drives.

What I want to know is whether this is a realistic proposition for a
linux based system.

Is there a fast enough I/O card with suitable linux drivers?

How much programming complexity would be involved?


I know this can be done with a PLC, but to do so (and have a reasonably
sized user-friendly display) is horrendously expensive, a pain in the
backside to program, and for all the PLC makers I've seen the
programming software will only run on windows and is more than twice
the cost of the hardware itself :(

--
Will J G
From: Tim Woodall on
On Sun, 23 Sep 2007 14:04:19 +0100,
Folderol <folderol(a)ukfsn.org> wrote:
> The company I work for has a need for a control system that will use 6
> digital inputs.
>
> One will be a timing pulse with an absolute maximum frequency of 12kHz
>
> There will be an reset pulse every 10,000 counts
>
> We could probably work with 6kHz and 5,000 counts but the extra
> resolution would be *really* nice as it would correspond to a
> positioning accuracy of 0.1mm
>
> There will also be 4 state inputs monitored at the timing rate
>
> Provisionally I've thought of using the timing pulses under interrupts
> to simply copy the 4 state inputs into an array, incrementing the array
> index each time, unless there is a reset pulse as well in which case
> zero the array index.
>
> With this array constantly updated the rest of the control system can
> manipulate bits of the data in a normal loop, do some basic graphics
> and send RS232 data to 4 stepper drives.
>
> What I want to know is whether this is a realistic proposition for a
> linux based system.
>
> Is there a fast enough I/O card with suitable linux drivers?
>
> How much programming complexity would be involved?
>
Did you mean 12kHz or 12MHz? And are we talking about input to the
computer or driving inputs from the computer.

12MHz you'll need some dedicated hardware but nothing particularly
complicated.

12kHz then the printer or serial port will do.

If it's inputs into the computer I'm not sure how many inputs there are
on a printer port but if there aren't enough (I think most printer ports
can now operate in bidirectional mode) you could handle 12kHz using
something like a 4014 and use either the parallel port or a serial port
to drive it. Clocking the latch at 12kHz means clocking the shift
register at 72kHz (or 96kHz) which is easily doable.

If there are enough inputs on the printer port then you'll probably just
need a latch (although you could easily simulate this in software)

If it's something being driven by the computer at 12kHz then just use
the printer port directly.

I've never done low level printer port programming and my low level
serial port programming is from back in the days of DOS but I can't
imagine it will need more than a few hundred lines of code to do what
you are asking.

Tim.


--
God said, "div D = rho, div B = 0, curl E = - @B/@t, curl H = J + @D/@t,"
and there was light.

http://tjw.hn.org/ http://www.locofungus.btinternet.co.uk/
From: anahata on
Folderol wrote:
> The company I work for has a need for a control system that will use 6
> digital inputs.
>
[snippage]
>
> I know this can be done with a PLC, but to do so (and have a reasonably
> sized user-friendly display) is horrendously expensive, a pain in the
> backside to program, and for all the PLC makers I've seen the
> programming software will only run on windows and is more than twice
> the cost of the hardware itself :(

This is a plug for my employers but might be worth a look:

http://www.microrobotics.co.uk

It's exactly the kind of thing we do. There's no linux content though.
Driving anthing bigger than a QVGA display might be a bit of a challenge
with the current system but we have made a custom board that drove
(IIRC) a 640x480x8bit display.

--
Anahata
anahata(a)treewind.co.uk -+- http://www.treewind.co.uk
Home: 01638 720444 Mob: 07976 263827
From: Folderol on
On Sun, 23 Sep 2007 13:38:29 +0000 (UTC)
Tim Woodall <devnull(a)woodall.me.uk> wrote:

> On Sun, 23 Sep 2007 14:04:19 +0100,
> Folderol <folderol(a)ukfsn.org> wrote:
> > The company I work for has a need for a control system that will use 6
> > digital inputs.
> >
> > One will be a timing pulse with an absolute maximum frequency of 12kHz
> >
> > There will be an reset pulse every 10,000 counts
> >
> > We could probably work with 6kHz and 5,000 counts but the extra
> > resolution would be *really* nice as it would correspond to a
> > positioning accuracy of 0.1mm
> >
> > There will also be 4 state inputs monitored at the timing rate
> >
> > Provisionally I've thought of using the timing pulses under interrupts
> > to simply copy the 4 state inputs into an array, incrementing the array
> > index each time, unless there is a reset pulse as well in which case
> > zero the array index.
> >
> > With this array constantly updated the rest of the control system can
> > manipulate bits of the data in a normal loop, do some basic graphics
> > and send RS232 data to 4 stepper drives.
> >
> > What I want to know is whether this is a realistic proposition for a
> > linux based system.
> >
> > Is there a fast enough I/O card with suitable linux drivers?
> >
> > How much programming complexity would be involved?
> >
> Did you mean 12kHz or 12MHz? And are we talking about input to the
> computer or driving inputs from the computer.
>
> 12MHz you'll need some dedicated hardware but nothing particularly
> complicated.
>
> 12kHz then the printer or serial port will do.

12kHz

I'm a long way from being any kind of expert but would be surprised if a
normal parallel port could keep up with this, and RS232 serial would
never manage a decent reliable rate. Besides which we would then have to
manufacture or source a serial encoder.
USB - don't even go there!


--
Will J G
From: Folderol on
On Sun, 23 Sep 2007 14:44:37 +0100
anahata <anahata(a)reply-to.address> wrote:

> Folderol wrote:
> > The company I work for has a need for a control system that will use 6
> > digital inputs.
> >
> [snippage]
> >
> > I know this can be done with a PLC, but to do so (and have a reasonably
> > sized user-friendly display) is horrendously expensive, a pain in the
> > backside to program, and for all the PLC makers I've seen the
> > programming software will only run on windows and is more than twice
> > the cost of the hardware itself :(
>
> This is a plug for my employers but might be worth a look:
>
> http://www.microrobotics.co.uk
>
> It's exactly the kind of thing we do. There's no linux content though.
> Driving anthing bigger than a QVGA display might be a bit of a challenge
> with the current system but we have made a custom board that drove
> (IIRC) a 640x480x8bit display.

Hmmm. Looks like a nice module, and reasonably cheap too, however the
graphic controls are nowhere near good enough.

I suppose I could get one of these to do all the number crunching then
spit results via RS232 to a lightweight computer acting as a display
manager and user interface.


--
Will J G