Tom wrote: >I am using the Mesa 5i20/7i33 system to retrofit my knee mill. I just finished >installing a 500 line (2000 ppr) encoder on the spindle, it is connected to the >Enc03 quadrature inputs on P2. >My timing settings in my ini file are: >BASE_PERIOD = 35000 > > Unless you're using "fast" I/O on the parallel port or similar, you probably don't need the BASE thread at all.
>SERVO_PERIOD = 1000000 >TRAJ_PERIOD = 10000000 > > These are fine, though these days the TRAJ thread often gets run at the same rate as the servo thread (1ms). >My spindle is capable of turning at a max of about 6000 rpm. But above 3000 >rpm, >my floating point value on the hal pin: "rev-scaled" starts to bounce all over >the place. At full spindle speed my encoder is turning at the rate of 120,000Hz >(pulses per second). > > I think there's something off in your calculations :) 2000 counts/rev * 3000 revs/min = 6,000,000 counts/minute Dividing by 60 gives 100,000 counts/second at 3000 RPM, at 6000 RPM it would be 200 kHz. Are you sure the encoders are up to it? Do you have differential or single ended encoders? Is there noise filtering on the encoder lines? >My question is: Is this too fast for my servo thread? If so, is it possible to >read every other pulse? > > No, this isn't too fast. The Mesa board can count at 1 MHz (x4 = 4 million counts/sec) in single ended mode, or ~10 MHz (40 M counts/sec) in differential mode. The manual does have a note: "The maximum input frequency may be lower with encoders that have high value (>1K Ohm) pullup resistors on open collector outputs." The counter in the Mesa card shouldn't overflow between reads (at a 1ms servo rate) until you get to 32 million counts/sec (or 8 billion if it's 24 bits, I don't remember which it is :) ) - Steve ------------------------------------------------------------------------------ SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users