My Mill has an 80 speed gearboxes to give speeds from a slow 1000rpm to a _really_ slow 45rpm. The VFD lets me up those speeds by 50%, luckily.
I was thinking of fitting switches to the levers so that the system knows which gear is selected, but then I had an idea. Cars typically detect which gear is engaged simply by comparing the engine rpm to the wheel speed (using two sensors that need to exist anyway). Then the ratio of the two speeds is passed into a 1D lookup table, and the output is the selected gear. It would be easy to do the same with a machine tool, with the output of the lookup table being the required ratio between spindle speed request and pwm request. In the case of my milling machine I don't have a sensor on the gearbox input shaft (though it would be pretty easy to add one, and the result would be better). Instead I am using the duty cycle sent to the VFD as a proxy for the motor speed. Yes, this does mean that the pwm duty cycle request is a function of the pwm duty cycle request… I recently added a 2D lookup table to Master, so that part is easy enough. It can be seen as a curve a bit like a flight of stairs, and anywhere on one step is considered to be a single gear. I found that I needed to limit both the rate at which gears were seen to change, and the value of the ratio measured (or occasionally I would see 10E+14 type numbers, and the system would take a while to sort itself out. I also needed to cap the motor speed request, or the calculations go wrong (above max motor speed the calculation is wrong, and it hangs-up in the top gear). Here is the code that is working for me. It might need some way to "lock in" to gear for tasks like rigid tapping. # Spindle handler loadrt abs names=abs.0,abs.1,gear_abs loadrt limit2 count=2 # Gear detection loadrt lincurve count=1 personality=16 loadrt invert count=1 loadrt mult2 count=2 addf spindle-interlock.0 servo-thread addf abs.0 servo-thread addf limit2.0 servo-thread addf limit2.1 servo-thread addf abs.1 servo-thread addf lincurve.0 servo-thread addf invert.0 servo-thread addf mult2.0 servo-thread addf mult2.1 servo-thread # Resolver and PWM are both scaled in RPM. # Maxmotor speed is 2250rpm net spindle-speed-abs abs.1.out invert.0.in net ratio-denom invert.0.out mult2.0.in0 net spindle-speed-cmd-abs mult2.1.in1 net speed-ratio mult2.0.out limit2.0.in net speed-ratio-filt limit2.0.out lincurve.0.in net spindle-command-gain lincurve.0.out mult2.1.in0 net spindle-command-raw mult2.1.out limit2.1.in net final-spindle-duty limit2.1.out mult2.0.in1 hm2_5i23.0.pwmgen.00.value # 0 speed setp lincurve.0.x-val-00 0 # Gear 1000rpm setp lincurve.0.x-val-01 .5 setp lincurve.0.x-val-02 1.9 # Gear 639rpm setp lincurve.0.x-val-03 2 setp lincurve.0.x-val-04 2.75 # Gear 409rpm setp lincurve.0.x-val-05 3 setp lincurve.0.x-val-06 4 # Gear 288rpm setp lincurve.0.x-val-07 4.25 setp lincurve.0.x-val-08 6.75 # Gear 156rpm setp lincurve.0.x-val-09 7 setp lincurve.0.x-val-10 9 # Gear 100rpm setp lincurve.0.x-val-11 10 setp lincurve.0.x-val-12 17 # Gear 64rpm setp lincurve.0.x-val-13 18 setp lincurve.0.x-val-14 25 # Gear 45rpm setp lincurve.0.x-val-15 26 # 0 speed setp lincurve.0.y-val-00 10 # Gear 1000rpm setp lincurve.0.y-val-01 1.5 setp lincurve.0.y-val-02 1.5 # Gear 639rpm setp lincurve.0.y-val-03 2.347 setp lincurve.0.y-val-04 2.347 # Gear 409rpm setp lincurve.0.y-val-05 3.667 setp lincurve.0.y-val-06 3.667 # Gear 288rpm setp lincurve.0.y-val-07 5.208 setp lincurve.0.y-val-08 5.208 # Gear 156rpm setp lincurve.0.y-val-09 9.615 setp lincurve.0.y-val-10 9.615 # Gear 100rpm setp lincurve.0.y-val-11 15.0 setp lincurve.0.y-val-12 15.0 # Gear 64rpm setp lincurve.0.y-val-13 23.44 setp lincurve.0.y-val-14 23.44 # Gear 45rpm setp lincurve.0.y-val-15 33.333 #VFD set up a bit funny... setp hm2_5i23.0.pwmgen.00.scale 5000 setp hm2_5i23.0.pwmgen.00.output-type 2 setp hm2_5i23.0.resolver.03.scale -1 setp hm2_5i23.0.resolver.03.velocity-scale -60 setp limit2.0.min 0 setp limit2.0.max 40 setp limit2.0.maxv 2 setp limit2.1.min 0 setp limit2.1.max 2240 setp limit2.1.maxv 2 -- atp If you can't fix it, you don't own it. http://www.ifixit.com/Manifesto ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
