From owner-freebsd-hackers Sun Sep 30 14:23:27 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from marlborough.cnchost.com (marlborough.concentric.net [207.155.248.14]) by hub.freebsd.org (Postfix) with ESMTP id 3A7C337B40D for ; Sun, 30 Sep 2001 14:19:43 -0700 (PDT) Received: from bitblocks.com (adsl-209-204-185-216.sonic.net [209.204.185.216]) by marlborough.cnchost.com id RAA02358; Sun, 30 Sep 2001 17:19:38 -0400 (EDT) [ConcentricHost SMTP Relay 1.14] Message-ID: <200109302119.RAA02358@marlborough.cnchost.com> To: Bart Kus Cc: hackers@freebsd.org Subject: Re: precise timing In-reply-to: Your message of "Sun, 30 Sep 2001 13:17:52 CDT." <200109301311.5635@EO> Date: Sun, 30 Sep 2001 14:19:37 -0700 From: Bakul Shah Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > 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