From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,cd9e5d2534af13d4 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-14 09:54:14 PST Message-ID: <3E4D2C7E.2010306@cogeco.ca> From: "Warren W. Gay VE3WWG" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Driving Servos (was: Great opportunity for Ada application) References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 14 Feb 2003 12:50:54 -0500 NNTP-Posting-Host: 198.96.47.195 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 1045245055 198.96.47.195 (Fri, 14 Feb 2003 12:50:55 EST) NNTP-Posting-Date: Fri, 14 Feb 2003 12:50:55 EST Organization: Bell Sympatico Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!torn!webster!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail Xref: archiver1.google.com comp.lang.ada:34104 Date: 2003-02-14T12:50:54-05:00 List-Id: Marin David Condic wrote: > Ada code to control servo motors? Yeah. Unclassified source exists to do > that. But that doesn't mean that a company would give it to you. Most would > consider it to be "proprietary" in some way. Besides, the code would likely > be very specific to the particular servo in question and to the particular > application. Unless you are talking about "standard stepping controller chip" hardware, I doubt that much source code would be useful anyway. > It depends on what you want. The actual control laws that drives a given > actuator is typically rather small. You get a request, it does some rate and > range limiting, you have some kind of transfer function and you generate an > output. There's a bit more to it when you get into the minor loop closure, > but that is also very device and application specific. Most of the code goes > into failure detection and accommodation which again is very device and > application specific. Beyond that, you have an even larger hunk of code that > deals with the I/O and scheduling of your control laws - the Operating > System, if you will. Possibly you can use something off the shelf there, but > it depends a lot on what the box that is going to hold the whole thing looks > like. > > MDC Back when I used to wire MC68705 microcontrollers to old floppy disk drive stepper motors (5.25 inch at the time), I just used 3 pairs of transistors (2N2222 I think, or maybe it was a pair of PNP and NPN -- I forget now..) to do the driving, with 6 pairs inputs to the base of the driver transistors. IIRC, most of the floppy seek mechanisms for 5.25 drives, used a 3 winding stepping motor. The drivers were a bit more complicated than this, because there are issues with "back EMF" when the coil winding is switched off. If you use a straight diode for this, motor speed is very limited (slow), but with the appropriate use of diode + resistor, I think I met an appropriate compromise (there are more advanced ways to do this "right" however). The assembly language code had to carefully raise or lower inputs on those transistors according to strict guidelines (for example you could not allow both of the + and - inputs at the same time, since with my arrangement, the current would short through the top and bottom pair of drivers, not a healthy event!) Then there was timing to consider too, since you cannot always do things at the speed of software ;-) I used onboard timer(s), that then provided interrupts that would indicate when the next "step" was needed etc. Of course the process of going in one direction or the other, required some other orchestrations to occur. The point of this post is really that if you have a fairly custom driver arrangement, no off the shelf code is likely to be of much help. Especially if you're dealing with resource constrained chips like the MC68705 series chips. I believe the PIC chips are still rather limited, though I've not kept in touch. If only I could retire and do fun things like that again.. But it's hard to imagine an Ada95 program fitting into a 2KB EPROM however.. -- Warren W. Gay VE3WWG http://home.cogeco.ca/~ve3wwg