> > 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.
-- 

Chris Albertson
Redondo Beach, California


_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to