There is a very simple solution, see last lines below (hint google " IC-MDTSSOP20")
Yes, But today I doubt anyone would design a PIC into a new product. Many modern microcontrollers have quadrature decoder hardware and can track an encoder without using the software. A cheap $2 STM32 M3 can do what the FPGA does. Then how to get this into the larger computer. Again no one would use a parallel port. They are dead slow. Likely the microcontroller would use SPI to connect. I'm actually working on a system now and our first revision will have about a dozen quadrature encoders. it is looking like the best solution is to place a small microcontroller physically near each quadrature encoder then connect all the micros with a CAN Bus The micros will write the encoder value to the CAN Bus at "X" times per second. The Raspberry Pi4 will have a external CAN controllers that connects to the Pi4 via SPI. This system has the simplest wiring, actually very little cable bulk and is very resistant to noise from all the high powered motors and it is faster than needed. The micro does more than just report the encoder. The servo loops that controls the motor run on the micro. Because the fastest loops and the step generation in on the micro and there is one micro per each motor the system should scale very well until the CAN Bus is saturated, then we add more CAN Busses. CAN FD can run at up to 8 Mbps and tolerate "insane" common mode voltages. This architecture really would work well for a machine tool. Basically, it is just one micro-controller per motor. Bt Linux EMC was designed back when computers were expensive and buying dozens of them was not reasonable. But today when a 32-bit computer literally costs $2 we can afford to use dozens of them. OK, back to today's Linux CNC. Yes, the simple way to read an encoder is to place a cheap microcontroller chip near the encoder then connect the micro with whatever serial interface you like. And even cheaper and simpler way is to not use a microcontroller but rather an Encoder chip. You can buy a hardware chip that will read an A.B quadrature encoder and then send the data over a serial interface. No software, it is all done in hardware. Look up "IC-MDTSSOP20" but there are other compr=eting products. On Sat, Jul 6, 2019 at 10:07 AM Roland Jollivet <[email protected]> wrote: > Hi all > > This might expose my ignorance ;-) and I'm not wanting anyone to do > in-depth calculations for me.. > > In the days of ISA cards, the 8255 was quite popular, but now we're onto > PCI and PCIe > > So, if one looks at the Mesa 5i25, it can read encoders because presumably > because the FPGA is doing the counting. > > Now, if I used one pci-bridge 8255 type card and used all the I/O (A,B,C) > to support 3 encoders, could I use, say a Pic processor to read the encoder > and convert to 8bit data, and then; > These 8bits are presented to the 8255 ports so Lcnc can do a snapshot read > of the encoder values to close a servo loop. > > With 8bit counters on the encoders, would Lcnc read the encoders fast > enough to run a servo based machine comparable to an open loop stepper > system? Obviously it has to read before roll-over or all is lost > > So, lets say the encoder provides 5um linear resolution on an axis, moving > at 10m/min (32ft/min or 0.05Furlong/min ;-) > = 10 000 000um/5um /min > = 2 000 000 counts/min > = 33 333Hz counter rate > > With a /256 pic counter, roll-over will be at 130Hz or every 7.7ms > Could Lcnc cope with that? > > Roland > > _______________________________________________ > Emc-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/emc-users > -- Chris Albertson Redondo Beach, California _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
