Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Sep 2001 17:45:01 -0700
From:      Greg Shenaut <greg@bogslab.ucdavis.edu>
To:        hackers@FreeBSD.ORG
Subject:   Re: precise timing 
Message-ID:  <200110010045.f910j1A47144@thistle.bogs.org>
In-Reply-To: Your message of "Sun, 30 Sep 2001 13:23:08 CDT." <200109301318.44290@EO> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <200109301318.44290@EO>, Bart Kus cleopede:
>On Sunday 30 September 2001 12:47, Greg Shenaut wrote:
>> Well, setitimer has a maximum rate of 100 Hz, with a slop factor
>> sometimes much greater than 10 ms.  This was the result of some
>> recent testing on a lightly-loaded standard 4.3 system.
>
>	That's not good enough. :/
>
>> How many stepper motors are you driving?  If it's only one at a time, then
>> maybe the speaker port on the motherboard (a programmable counter-timer)
>> would be more reliable.
>
>	I like the speaker port idea.  Can one program the speaker port to generate 
>an int/signal/un-block using bsd's kernel API?

I do not think that there is hardware support for interrupts from
the speaker port, but it seems to me that since it just sits there
putting out a square wave at whatever frequency was most recently
programmed into it, all one of the (relatively infrequent) less-than
10 ms timing glitches would do is to slow down the ramp sometimes,
which would never harm the stepper motor (but would slow down the
process a little bit).

>> Another idea is to use a fifo'ed UART's data out
>> line and fiddle with the baud rate to vary the speed of the pulses.
>
>	I don't think this will provide the "smoothness" I want.  Going from 
>2400->4800 steps/sec for example would be a huge jerk.  Need SMOOTH 
>transition (constant-acceleration).

I was thinking in terms of changing the baud rate in smaller
increments than that--the timing hardware inside the standard PC
UART is just a 16-bit programmable divider.  But a MCU is still
probably your best bet.  (I remember writing a stepper-motor driver
on a TI 9900 back in the 70's.)

Greg Shenaut

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200110010045.f910j1A47144>