On Monday 30 October 2017 22:58:06 Chris Albertson wrote: > On Mon, Oct 30, 2017 at 7:13 PM, Gene Heskett <[email protected]> wrote: > > On Monday 30 October 2017 19:52:00 Chris Albertson wrote: > > > I think I see a reason why advice about PIDs used an axis and a > > > spindle might differ. The axis servo will have a huge about of > > > gearing so the motor will run fast and the controller will see a > > > lot of edges per PID loop interval. > > > > > > If Gene is using a gear tooth sensor on an 80 tooth gear and > > > running at 1000 RPM then he is only seeing 1333 gear teeth per > > > second. > > > > On the Sheldon, its ats667's on the bull gear which is 60 teeth, so > > I am seeing 240 edges per revolution. However, there is no servo > > pid, and the only thing the encoder is really doing is feeding its > > position into motion for rigid tapping. Works well even at 25 rpm > > in backgear. At that speed, the vfd can reverse the chuck in under a > > revolution. Brutal reversal but it works. The chuck has clamp rings > > fitted to keep it from unscrewing itself. I've cut air at 500 rpms > > doing a rigid tap, but there the biggest problem is the nearly 6 > > turns of overshoot at the bottom of the hole as it reverses. Since > > I don't own stock in Hanson, I don't do that. :) > > > > On this mill, there are 278 edges per spindle revolution. And the > > quantization noise will excite too much Pgain pretty fast. > > > > > I > > > hope he is not running the PID loop at 1KHz or he sees either 1 or > > > 2 teeth per interval. We call this an extreme case of > > > quantization error. In this case needs to be measuring > > > microseconds per tooth or a MUCH higher resolution sensor. > > > > Encoder sampling is running at 50 megahertz in either case. At that > > speed, waiting for the next edge is as bad as watching paint dry. > > Sorry no what I meant. How often do you compute the error and adjust > the motor current? 50MHz is the clock resolution. > > Look at a really bad case: You want to run at a sped to gives 20 gear > teeth per second and you decide to adjust the motor speed 20 times per > second. By dumb luck in one period you see no gear tech so the PID > bumps the speed up by a lot because it sees a 100% speed error. Next > period the PID sees two gear tech which is another 100% error so it > cuts the motor current in half. Same result with a set point of > 1333 teeth per second and you compute the current 1000 times a second. > You will NEVER count 1.3 teach. You awl get 1 then 2 then 1 then 2 > and even if the spindle speed is dead-on perfect the PID controller > will always see a large error. Just rig it so a + or - 1 count is > only a tiny 1% or less problem. > Setting up a 4 stage fifo, and averaging them for the feedback works pretty good, reduceing the step noise to 25% of what it would be w/o it.
On a reversal, I clear the wind up in the whole thing by firing a straight thru cycle at the next edge after the stop. > > > For a spindle I think a longer control loop period is in order. > > > Unless you are doing rigid tapping all you car about is speed > > > stability. But I am doing rigid tapping on 3 of these. Never did figure out how to put an encoder on the x1's spindle and its all plastic gears so hall effects are out of the running. It probably couldn't drive a 4-40 tap anyway, only a 200 watt spindle motor. I saved the 400 watter off TLM, and if I don't fall over first, I'll finish making a 2 speed timing belt drive for it at some point. But low will be low enough to drive a 10-24 tap, and high will be fast enough to carve a circuit board at 5+ ipm. Thats the plan anyway. And if I use timing belts, I can put the encoder on the motor shaft and change the scale with a switch. All I'd need on the spindle would be an index pulse. A strip of paint can do that. Or a long setscrew in the hub of the pulley on the spindle. > > > On Mon, Oct 30, 2017 at 4:29 PM, Peter C. Wallace > > > <[email protected]> > > > > wrote: > > > > On Mon, 30 Oct 2017, Gene Heskett wrote: > > > > > > > > Date: Mon, 30 Oct 2017 18:44:49 -0400 > > > > > > > >> From: Gene Heskett <[email protected]> > > > >> Reply-To: "Enhanced Machine Controller (EMC)" > > > >> <[email protected]> > > > >> To: [email protected] > > > >> Subject: Re: [Emc-users] Spindle pid problems > > > >> > > > >> > > > >> On Monday 30 October 2017 15:20:35 andy pugh wrote: > > > >> > > > >> On 30 October 2017 at 17:49, Gene Heskett > > > >> <[email protected]> > > > > wrote: > > > >>>> Which is computationally less cpu usage 1, a 6 pack of > > > >>>> mux2's, or another pid with separate settings and just one > > > >>>> mux2 to select which pid gets sent to the spindle servo? > > > >>> > > > >>> PID is not very CPU intensive, neither is mux2. I wouldn't > > > >>> really worry about either. > > > >>> > > > >>> You can see how much CPU time each module uses in HAL. > > > >>> > > > >>> The "lincurve" component was intended specifically for this > > > >>> type of situation, which is why it has outputs of the r/w > > > >>> style that can be connected directly to the pre-2014 PID gain > > > >>> pins (which for no good reason were bidirectional) > > > >>> > > > >>> But in this case mux2 seems more appropriate if it is a simple > > > >>> switch between states. > > > >>> > > > >>> Between pid.sh.output and pid.sl.output. When I get everything > > > >>> else > > > >> > > > >> working again. Probably not yet tonight as I had to come and do > > > >> something about an empty skillet for dinner. > > > >> > > > >>> However, I suspect that your problem is that you are trying to > > > >>> use P on a controller that only really needs FF0 and I. > > > >> > > > >> A dc powered spindle is a velocity servo I think, so I been > > > >> trying to follow John Thorntons wiki article from 2012 where he > > > >> describes tuning a axis servo in the velocity mode. Is this the > > > >> wrong approach for a spindle that needs to have quite stiff > > > >> control? > > > >> > > > >> And I just found his other description of spindle tuning, where > > > >> its all FF0 and Igain. That one however doesn't describe the > > > >> hardware setup at all, nor does it have any halscope pictures. > > > >> I suspect that the spindle John was calibrating was being > > > >> driven by a vfd, which is inherently a pretty stiff drive. > > > >> > > > >> But when I get it back to where I can run it (I'm in the middle > > > >> of moving the spindle power control sequencer from the 5i25 P3 > > > >> to the same on P2, which feeds a different bob in a different > > > >> box. And reconnecting it to where I can use an A axis with > > > >> those pins, and while I am up on the ladder, I'll get the > > > >> individual boxes bolted together to prevent another short that > > > >> blew a chain of 5i25's). > > > >> > > > >> I really ought to build another, even bigger box, at least > > > >> another 3" deeper, and 4 or 5" taller so the A driver could fit > > > >> inside it. Unforch that would take another half a sheet of 1/8" > > > >> alu plate to go with the close to half a sheet I have on hand. > > > >> > > > >> So many projects, so little 'extra' time. :) > > > >> > > > >> Cheers, Gene Heskett > > > >> -- > > > >> "There are four boxes to be used in defense of liberty: > > > >> soap, ballot, jury, and ammo. Please use in that order." > > > >> -Ed Howdershelt (Author) > > > >> Genes Web page <http://geneslinuxbox.net:6309/gene> > > > >> > > > >> ------------------------------------------------------------ > > > >> ------------------ > > > >> Check out the vibrant tech community on one of the world's most > > > >> engaging tech sites, Slashdot.org! http://sdm.link/slashdot > > > >> _______________________________________________ > > > >> Emc-users mailing list > > > >> [email protected] > > > >> https://lists.sourceforge.net/lists/listinfo/emc-users > > > > > > > > As Andy mentioned, Spindle tuning is normally done with mostly > > > > FF0 and then some I > > > > > > > > Johns tutorial is for tuning a position mode loop with velocity > > > > PID output, but your spindle is a velocity mode loop with > > > > velocity PID output > > > > > > > > > > > > > > > > Peter Wallace > > > > Mesa Electronics > > > > > > > > (\__/) > > > > (='.'=) This is Bunny. Copy and paste bunny into your > > > > (")_(") signature to help him gain world domination. > > > > > > > > > > > > > > > > ------------------------------------------------------------ > > > > ------------------ > > > > Check out the vibrant tech community on one of the world's most > > > > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > > > > _______________________________________________ > > > > Emc-users mailing list > > > > [email protected] > > > > https://lists.sourceforge.net/lists/listinfo/emc-users > > > > Cheers, Gene Heskett > > -- > > "There are four boxes to be used in defense of liberty: > > soap, ballot, jury, and ammo. Please use in that order." > > -Ed Howdershelt (Author) > > Genes Web page <http://geneslinuxbox.net:6309/gene> > > > > ------------------------------------------------------------ > > ------------------ > > Check out the vibrant tech community on one of the world's most > > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > > _______________________________________________ > > Emc-users mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/emc-users Cheers, Gene Heskett -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) Genes Web page <http://geneslinuxbox.net:6309/gene> ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
