On Tuesday 26 December 2017 15:26:53 Nicklas Karlsson wrote:

> On Tue, 26 Dec 2017 15:16:06 -0500
>
> Gene Heskett <[email protected]> wrote:
> > Greetings all;
> >
> > My original config for this had hal connections in all 4 axis like
> > this: loadrt        [KINS]KINEMATICS
> > loadrt      [EMCMOT]EMCMOT servo yadda + numdio=12
> > later...
> > net z-pos-cmd       joint.2.motor-pos-cmd
> > net z-pos-cmd       pid_z.command
> > net z-vel-cmd       joint.2.vel-cmd
> > net z-vel-cmd       pid_z.command-deriv
> >
> > But somehow, this joint.2.vel-cmd has a huge high vel spike as it
> > approaches zero velocity, jumping to the same offset in the other
> > polarity, then decays back to where it would intersect a straight
> > line continuation of the original trace, at which point it then
> > continues upwards as if its a position command. ...
>
> It seems there are some offset in the middle. I think there a re
> something at zero speed to compensate for zero friction, baskslash or
> similar.

Whatever, but its way too much and gawdawfull fast, no stepper or servo 
on this planet could track it.  And its not what I hear the stepper 
doing.

I have now traced the encoder.position output out, and can show it as:
# switches closed to gnd only when fully seated in that gear
net     gear-sw-high    hm2_5i25.0.gpio.033.in_not mux4cmd.sel0 mux4vel.sel0
net     gear-sw-high    mux4tach.sel0 mux4pos.sel0
net     gear-sw-low     hm2_5i25.0.gpio.020.in_not mux4cmd.sel1 mux4vel.sel1
net     gear=sw-low     mux4tach.sel1 mux4pos.sel1

net     pos_source      hm2-5i25.0.encoder.00.position scale_pos.in mux4pos.in1
net     scaled_pos_s    scale_pos.out mux4pos.in2
net     position_scaled mux4pos.out     motion.spindle.revs

net     vel_source      hm2_5i25.0.encoder.00.velocity scale_vel.in mux4vel.in1
net     scaled_vel_s    scaled_vel.out mux4vel.in2
net     scaled_vel      mux4vel.out pid_s.feedback
net     scaled_vel      motion.spindle-speed-in
        
All the above has scale_"name".gain settings such that when shifting 
gears, which changes the mux4's such that if I call for 300 revs, 
nothing changes but the motors speed, and I get exactly 300 revs at the 
spindle regardless of the gear selected. The only thing that changes is 
the spindle top speed, nominally 3000 in high, and nominally 1500 in low 
gear. In both cases the pwmgen in the 5i25 is running at 98%.

The encoder scale remains at 7161.61 for both gears but in low gear the 
pid_s.command is scaled up by 1.96818033933710437, to speed the motor 
up, and since the encoders A/B are on the motor and it needs scaled dwn 
to restore the tach's accuracy, the scale_down is needed so the tach and 
such are correct is 0.508083522639397134. Those figures are of course 
the reciprocal of each other.

This all isolated from motions direction reversals in order to bring 
those reversals about in a long enough time that the Z motor can keep 
up. But its getting that huge, accel at 3000+ bump from motion at the 
pid_s.derivative input, straddling the zero speed crossover. Which in 
turn is screwing up the Z velocity, more than enough to break a tap.

But this is north of 600 LOC and I'm getting lost hunting for it.

Thanks for any suggestions.

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

Reply via email to