Successful First Commands From Grbl ESP32 To Parker ZETA4
Once I could bring my breadboard prototype Grbl ESP32 controller into the shop where the salvaged XY stage lives, I was eager to hook up some wires to see if anything moves. While I put provisions for two axis on my breadboard, it felt like a good idea to start with just the X axis. It moved, but not accurately, because I had not configured the two components to match.
These stepper motors have 200 steps per revolution. ZETA4 controllers can easily handle full steps, but there are a lot of options for microsteps configurable with switches. The headache here is the lead screw: it is an old Imperial unit with a pitch of 5 revolutions per inch, but Grbl is a metric minded piece of software with everything in terms of millimeters. Using a conversion rate of 25.4 millimeters per inch, the most obvious ZETA4 microstep option that divided evenly is 25,400 steps per revolution.
The good news is that Grbl ESP32 appears fast enough to generate pulses at this speed, which is orders of magnitude beyond what I can generate with AccelStepper on an ATmega. But even with tests along a single axis, the system would halt at various times and I don't always understand why. For example: one of the halts gave an error of "Door Open" but Grbl configuration file explicitly said to ignore the door sensor switch, so why is it stopping motion? There are more to this system I don't yet understand.
So for the sake of eliminating potential problems, both the ZETA4 and ESP32 were configured for 2000 steps per revolution, or 10 micro steps in between whole steps. We know this is easily within the timing capabilities of the chip and, while it may introduce some error converting between Imperial and metric, it's not the biggest problem right now so we'll deal with it later.
These intermittent errors will likely continue as I run this system, and I will have to diagnose and debug as I go. In parallel with this, I've changed my plan: as my next step I will not connect the Y axis step/direction motion control pins. Instead, I will continue to refine X axis operation by getting position homing to work.
https://twitter.com/Regorlas/status/1161094071437279232