> Oops. Somehow a sentence below was trimmed. Fixed. > > > > But what happens when someone has a 2500 line encoder on the spindle > > > creating > > > 10,000 edges per rev. or 200,000 edges per second at 1200 RPM. Now that > > > 8 > > > threads deep hole is 1.6million. Again, not an issue with a 32 bit signed > > > counter but a problem with a 16 bit. > > > > Not an issue, the 16 bit hardware count is extended to 64 bits in the driver > > (every servo thread) this does limit you to a 16 MHz maximum count rate at > > a 1 > > KHz servo thread but thats way above the capabilities of most encoders... > > > > So let's see if I have the math right. At 16MHz we have an edge every 0.063 > MicroSeconds. At most then we'd see 16,000 in a hardware 16 bit register > ever 1 millisecond (the 1 khZ servo rate). This value is added to a 64 bit > integer. Is the hardware counter cleared again? If not 1 mS later it would > be 32,000 which is still positive. But on the next 1 mS check it's now > 48,000 which is -17536 as a signed number and adding that to the 64 bit > counter would decrease the distance travelled or suggest the spindle has > slowed dramatically. > > There are probably hardware quadrature encoder counters that can be set to > latch the value on command and clear the counter? I haven't checked the > encoder on the BeagleBone for example to see if it has that feature. > Certainly your FPGA stuff can be set up to do that.
Pretty sure Beagle bone have. Use ordinary Micro controllers of different brands and usually PWM counter could be used to trigger sampling of quadrature position counter at updater or similar regular interval. Quite often I also trigger interrupt for control loop from same signal but sometimes signal trigger ADC and in such case interrupt from ADC then sampling is done might be a better option. Regards Nicklas Karlsson _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users