Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

An Artist in Real(-time) Trouble

1 view
Skip to first unread message

Peter Gingold

unread,
Apr 20, 2003, 8:16:18 AM4/20/03
to
I am making a kinetic sculpture. By the standards of this group it is
simple - a single-axis stepping motor driving a device not unlike a
complex pendulum. Motor control is from a combination of geometric
and dynamic calculations informed by real-world position input. Dead
simple, no networks, scarcely even any users! (I did an engineering
degree in the dim and distant past, hence my (modest) familiarity with
the technology!)

Following reading up within this group I believe this is a 'hard
real-time' system. It is absolutely imperative that motor control is
accurate. If not, the sytem won't fail, but it won't do what it
should, and motion could become chaotic. I think I need time
resolution, both in terms of motor position control and data input, of
1 mS or better, and I want to send new motor commands every 10mS or
so, 25mS worst case. I have done some experimentation with Windows
XP, RS232 links, a shareware package called Liberty Basic, etc, and do
not believe that this OS can hack it - for reasons which you will
understand better than I. So I think I have two choices:

A) Go back 10 or 15 years to a DOS based machine, with QBasic or some
such.

B) Adopt a RTOS and whatever is the simplest development tool I can
find.

I lean against the first because I am not sure that would give me
adequate time resolution, and also because I have high hopes for this
project and do not want to use a static technology. Can anyone help
me choose:

(i) A simple and cheap RTOS (single-user is fine), and
(ii) a similar software language (all it needs is some simple
arithmetic and geometric functions and the ability to read-write to a
port)?

I will be eternally grateful if you can!

Peter

Norm Dresner

unread,
Apr 20, 2003, 11:33:37 AM4/20/03
to
"Peter Gingold" <pe...@gingold.com> wrote in message
news:8867568b.03042...@posting.google.com...

> So I think I have two choices:
>
> A) Go back 10 or 15 years to a DOS based machine, with QBasic or some
> such.
>
> B) Adopt a RTOS and whatever is the simplest development tool I can
> find.
>
> I lean against the first because I am not sure that would give me
> adequate time resolution, and also because I have high hopes for this
> project and do not want to use a static technology. Can anyone help
> me choose:
>
> (i) A simple and cheap RTOS (single-user is fine), and
> (ii) a similar software language (all it needs is some simple
> arithmetic and geometric functions and the ability to read-write to a
> port)?
>
> I will be eternally grateful if you can!

Since the time quantum in a DOS-system (the conventional 18.2 Hz clock)
can be reprogrammed to (almost) any reasonable value -- I've used up to 10
KHz myself though most of my programs run in the 1-2KHz region -- the time
resolution of a DOS-machine shouldn't be a problem. There are a few tricks
to using a speeded up clock but you should be able to find enough in the WWW
to do everything you need that way. Since you seem to be presenting a
description of a single-task program I see no need for anything more complex
than a special-purpose program on top of DOS.
Of course you could go the RTOS route and "do it right". One that's
"free" is the Real-Time Linux variant that runs "on top of" ordinary Linux
by making some subtle alterations in the kernel's scheduling. It can
produce truly industrial quality code that runs -- in the most complex
system I've done to date -- 12 user-programs (most multi-threaded) and 11
custom device drivers simultaneously. It is quite complex to learn but it
might prepare you for a better paying job than "artist".

Norm


Bruce

unread,
Apr 20, 2003, 8:10:39 PM4/20/03
to
In comp.realtime
pe...@gingold.com (Peter Gingold) wrote:

Dude, this seems trivial in DOS. Speed up the system timer to your desired
rate of 1mSec, chain your motor control ISR to it, call the DOS timer at
the appropriate interval, done. Get a free copy of Turbo C++ 3.1 from
Borland and get busy. Forget QBASIC. If you want to make it MORE
difficult, get UCOS-II for free, but I don't think it is necessary at all.

Bruce

Frank-Christian Kruegel

unread,
Apr 21, 2003, 7:40:01 AM4/21/03
to
On 20 Apr 2003 05:16:18 -0700, pe...@gingold.com (Peter Gingold) wrote:

>I am making a kinetic sculpture. By the standards of this group it is
>simple - a single-axis stepping motor driving a device not unlike a
>complex pendulum. Motor control is from a combination of geometric
>and dynamic calculations informed by real-world position input. Dead
>simple, no networks, scarcely even any users! (I did an engineering
>degree in the dim and distant past, hence my (modest) familiarity with
>the technology!)

>A) Go back 10 or 15 years to a DOS based machine, with QBasic or some


>such.
>
>B) Adopt a RTOS and whatever is the simplest development tool I can
>find.

I'd choose a small and simple 8 bit microcontroller - an AVR for example. It's a
closed system where you control every bit, it's easy enough to get around
without an operating system, and it's reliable and doesn't need much port and
space.


Mit freundlichen Grüßen

Dipl.-Ing. Frank-Christian Krügel

Steve

unread,
Apr 21, 2003, 9:57:13 AM4/21/03
to
I wouldn't rule out XP without doing a little more digging. Look into
"priorities" under XP. Giving your program a higher priority may give you
more consistant response times, which might be good enough.

There is also a system call you can make to change the system clock from 10
msec to 1 msec (can't rememeber what it's called right off hand).

If you find you cant make Windows work for you, then I'd suggest taking a
look at RTEMS (http://www.oarcorp.com). It's a free RTOS.

I have seen some inexpensive single board computers show up on ebay that may
work well for your application (since it sounds like you're looking for
inexpensive).

If you want to check out the Linux route, look into RTAI.

If you haven't done much programming, I think you'll find the learning curve
on Ada to be easier than C or C++. This makes Gnat/Rtems a good choice.

I hope this helps,
Steve
(The Duck)


"Peter Gingold" <pe...@gingold.com> wrote in message
news:8867568b.03042...@posting.google.com...

Walter Mallory

unread,
Apr 21, 2003, 12:39:37 PM4/21/03
to
"Steve" <nospam_...@attbi.com> wrote in
news:ZMSoa.552431$3D1.303699@sccrnsc01:

> I wouldn't rule out XP without doing a little more digging. Look into
> "priorities" under XP. Giving your program a higher priority may give
> you more consistant response times, which might be good enough.

I would agree. If the XP system doesn't really need an graphical
interface, then a full screen console display with priority set to
REALTIME should make XP behave *close* to an old dedicated DOS machine.



> There is also a system call you can make to change the system clock
> from 10 msec to 1 msec (can't rememeber what it's called right off
> hand).

Then again, if this motor app is the only application needing to run and
there's nothing else complicated going on, he could also just write a
simple main loop to do whatever he wants and then use a
QueryPerformancCounter call to wait around so he synchronizes to the
desired time period (10 msec, 25 msec, whatever).

At first glance his app seems so simple that he doesn't need any
interrupts or timers so much as just a time source to keep his loop
running at the right frequency.

<other good suggestions snipped>

<original post snipped>

--
Walter Mallory walter....@mbda-us.com
All opinions expressed are my own and not my employer's.

Chris Hills

unread,
Apr 21, 2003, 5:08:00 PM4/21/03
to
In article <3ea4d7dc...@uaxe.intern.istda.com>, Frank-Christian
Kruegel <usene...@istda.com> writes

>On 20 Apr 2003 05:16:18 -0700, pe...@gingold.com (Peter Gingold) wrote:
>
>>I am making a kinetic sculpture. By the standards of this group it is
>>simple - a single-axis stepping motor driving a device not unlike a
>>complex pendulum. Motor control is from a combination of geometric
>>and dynamic calculations informed by real-world position input. Dead
>>simple, no networks, scarcely even any users! (I did an engineering
>>degree in the dim and distant past, hence my (modest) familiarity with
>>the technology!)
>
>>A) Go back 10 or 15 years to a DOS based machine, with QBasic or some
>>such.
>>
>>B) Adopt a RTOS and whatever is the simplest development tool I can
>>find.
>
>I'd choose a small and simple 8 bit microcontroller - an AVR for example.

Use an 8051.... there are more tools (free and commercial) and a lot
more example code floating around.

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/\
/\/\/ ch...@phaedsys.org www.phaedsys.org \/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Victor Yodaiken

unread,
Apr 21, 2003, 6:22:55 PM4/21/03
to
XP is going to cause you endless nightmares: timing is vague and the
device driver interface is horrible.

RTLinuxFree is, as you might guess, free. RTLinuxPro is
pretty cheap - you probably qualify for a educational license-
and a lot less work to configure.
See www.fsmlabs.com


"Steve" <nospam_...@attbi.com> wrote in message news:<ZMSoa.552431$3D1.303699@sccrnsc01>...

0 new messages