From owner-freebsd-hackers Tue Apr 29 04:22:22 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id EAA11062 for hackers-outgoing; Tue, 29 Apr 1997 04:22:22 -0700 (PDT) Received: from hda.hda.com (hda-bicnet.bicnet.net [207.198.1.121]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id EAA11057 for ; Tue, 29 Apr 1997 04:22:18 -0700 (PDT) Received: (from dufault@localhost) by hda.hda.com (8.8.5/8.8.5) id HAA19011; Tue, 29 Apr 1997 07:20:28 -0400 (EDT) From: Peter Dufault Message-Id: <199704291120.HAA19011@hda.hda.com> Subject: Re: FreeBSD As Motor Controller? In-Reply-To: <199704290032.BAA00916@neophyte.dweeb.net> from "nbc@vulture.dmem.strath.ac.uk" at "Apr 29, 97 01:32:53 am" To: nbc@vulture.dmem.strath.ac.uk Date: Tue, 29 Apr 1997 07:20:28 -0400 (EDT) Cc: freebsd-hackers@freebsd.org, nbc@neophyte.dweeb.net X-Mailer: ELM [version 2.4ME+ PL25 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > I am currently in the process of implementing an embedded motor control > system using a well know real-time UNIX, which has turned out to > be slightly overkill. The system is soft real-time, which made > me wonder if FreeBSD would be up to the job - I envisage a stripped > down system, running on PC/104 hardware (already tested with F/BSD), > the drivers residing at device level, preferably in LKM format. > > At the moment we are using stepper motors, although this may change > in the future, driven by pulses generated from an I/O board on the > ISA bus. My major concern with FreeBSD is interrupt latency, which > is excellent with the current system. Given that we are using 100MHz > Cyrix 586 CPUs, I'd appreciate it if anyone could give me a ballpark > figure on the latency, and indeed the typical variations in such one > would expect from a lightly loaded system, or perhaps some way to > determine this for myself. I did this back in 386bsd by running the clock tick at 100 * HZ and microstepping the motor outside the OS (call the regular OS tick at HZ). Don't do much, and don't use any kernel services - this is OK if you're moving through a table and poking out a value. If you have a spare counter you can use that to detect overruns by loading up your deadline + 10% and checking for countdown. If you don't need your speaker you can probably use that. I was also running two servos off the interval clock of an A-D. Again, I had the ability to detect clock overruns - this is important so that you can prove that you're doing what you think you're doing. This was on a 20Mhz 386SX with 4MB RAM and a 40MB disk. -- Peter Dufault (dufault@hda.com) Realtime Machine Control and Simulation HD Associates, Inc. Voice: 508 433 6936