On Tuesday 12 March 2019 18:40:49 Chris Albertson wrote: > > > So a Pi with an external STM32 may well send step/dir signals or > > > SPI based messages to the driver but tracking that spindle encoder > > > for threading is a bit more intensive. > > The STM32 chip has hardware quadrature decoders. These are a set of > flip-flops and counters that exist on the chip but outside the CPU. > The CPU has access to the counters and can poll the count or reset > them. > > Because it uses hardware it can handle a few MHz. The larger STM32 > chips have several sets of quadrature decoders the blue pill device > only one usable decoder. > > I've also tried using interrupts Placing the A and B quadrature > signal on GPIO pins. I can control two motors this way (using four > interrupt pins) up to about 10,000 per second per pin. But the > hardware decoders at literally 1000 times faster and don't use up CPU > cycles. > > This is an important part of selecting a chip. Don't just look at > the CPU, RAM, and ROM. Most chips have a ton on peripheral hardware > that can be used pick one that hasthe stuff you need. > > > Which is what I'm doing on the Sheldon, with an alu bracket, curved > > to match the size of the bull gear on the spindle. Biggest problem > > was my math, getting the pair of ATS-667 hall effect sensors > > properly spaced to get a decent quadrature timed set of pulses out > > of it.
Here, I don't think I communicated that my problems were in the math to properly space the slots the ATS-667's were nestled in. Purely a mechanical mistake in carving the slots they hide in. I didn't grok that half a tooth spacing was actually 180 degrees, not 90. 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> _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users