Mario. wrote: > But back to what Andreas proposes: I think that interrupt frequency in > direct pulse output such as the quadrature one may benefit from > interrupt frequency that will be variable withing certain limits. > The problem currently is that we have TWO loops - one at ~1kHz for > trajectory planner and the other at ~100kHz for pulse output. And we > have only one interrupt source and only ONE independent CPU. > If there were two CPUs each with its own interrupt source it would be > much easier.
One important thing to keep in mind: EMC2 is NOT a "software stepper only" CNC control. It is intended to be an "industrial quality" CNC controller. That means that is MUST support servos as well as steppers. While I'm sure there are ways to improve the performance of software based step generation, changing to a variable interrupt rate would have several bad consequences for EMC2 as a general purpose controller: 1) Increased reliance on hardware specifics. At the moment, no EMC code deals with the interrupt controller or other such hardware. We rely on RTAI for that. All we need is the ability to create a couple of fixed period real-time threads. With the PC architecture changing constantly, I don't know anyone on our software team who wants to dig deeper into the guts of motherboards in an attempt to do variable frequency interrupts. Getting it to work on one CPU+chipset combo is one thing - making it work on _all_ CPU+chipset combos is something else entirely. 2) Incompatibility with other input and output schemes. Today, a fairly common hobby-class lathe configuration uses software stepping for the axis motors, software PWM for spindle speed control, and software encoder counting for spindle feedback (for threading). Software PWM and software encoding require constant interrupt frequency. A variable interrupt approach that attempts to optimize step generation will break spindle speed control and spindle feedback. 3) Even the very best possible software step generation (variable interrupt rate or otherwise) can only achieve maybe 3-5x the step rates we are currently getting. Hardware stepping can go 20-100x faster without impacting the rest of the system. EMC2 _does_ have two "non-standard" approaches to improve step rate. The first is called doublestep - instead of using one interrupt to set a step bit and the next interrupt to clear it, doublestep sets it when the interrupt happens and then busy-waits until it is time to clear it. For drives that can accept short step pulses (one or two microseconds max) this lets you get one step every interrupt instead of one step every two interrupts. EMC2 can also generate quadrature output instead of step-dir. Quadrature output can _always_ do one step per interrupt instead of one step every two interrupts - the problem is that most stepper drives can't directly use quadrature. Regards, John Kasunich ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Emc-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-developers
