Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Sep 2001 14:19:37 -0700
From:      Bakul Shah <bakul@bitblocks.com>
To:        Bart Kus <bsd@shell-server.com>
Cc:        hackers@freebsd.org
Subject:   Re: precise timing 
Message-ID:  <200109302119.RAA02358@marlborough.cnchost.com>
In-Reply-To: Your message of "Sun, 30 Sep 2001 13:17:52 CDT." <200109301311.5635@EO> 

next in thread | previous in thread | raw e-mail | index | archive | help
> 	Hrm, I was planning on investigating the RT capabilities of fbsd after I got 
> myself a decent timer mechanism.  I was hoping they would be enough to get 
> close to RT.  I have an SMP system I can use, so 1 CPU can be dedicated to 
> the task.

I doubt even an SMP system would help.

> > you are better off writing a device driver which can run
> > timing critical code while blocking out all other interrupts.

> 	Not an option.  It would stall the whole system during the (possibly 20 
> minute) drilling operation.  Maybe it'll be possible with SMPng, but not now.

I meant blocking other interrupts only during critical
periods.  For instance, when your s/w gets control, you find
out the current time and figure out what speed you want to
set.  Then you set timout for the next time you want to do
this and return.  Basically you are approximating a curve
and while doing this at regular interval is easier, you can
also approximate with an irregular interval (use Bresenham).

But this is just a generic suggestion; I do not know enought
details to do more than that.  One other thing you can do is
to increase clock tick rate to 1000 Hz from the default 100
Hz.

> > was suggested you may want to consider a dedicated cpu based
> > controller.  Thre are a number of solutions for hobbyists
> > (such as the handyboard, see www.handyboard.com).
> 
> 	Unfortunately, money is a big factor.  So that's not an option. :/

IIRC you can buy a kit (including a two sided PCB) for under
$100.  A few years ago I built the precursor to the Handy
Board (called Miniboard) from a kit for a lot less.  It had a
68hc11E2 (with a 2k EEPROM) + you can control upto 4 motors +
a bunch of sensors and digitial output control pins.  Someone
may still be selling it.

What I was thinking of was not a completely dedicated
controller.  You interface to something like the miniboard
via a serial port and do all the fancy computation on your
freebsd system and let the controller do the PWM by feeding
it precomputed parameters (at time t0 velocity v0, at time t1
set it to v1 and so on).

>	It's home brew, I'll forward you more details in personal email.

Thanks!

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?200109302119.RAA02358>