ESPRO at 50Hz in stead of 3Hz
This is a very nice project, and I was wondering if anyone has developed the 'FAST' mode DRO. My plan is to use this DRO as a closed-loop system to drive spindles at a determined speed, the feedback of 50Hz or faster would be ok, but the feedback of 3 Hz is too slow.
The 50Hz functionality is already built-in in all of these calipers by means of the hidden 'mode' button: Activating the mode button switches back and forth between fast reading and regular reading modes. The scale updates about every 20ms (50 Hz) in fast reading mode instead of every 300ms (3 Hz).

Personally I would use an interrupt function (since they are called upon independently) to determine the 'getpacket' (which is only returned if the packet is completed by the getbit() function (which would get its data from the ISR) . This means that the PACKET_READ_TIMEOUT would not matter anymore, since the complete packet is captured. (it would have a purpose still to use it of course, but the value would be around 20 ms) Then I would compare the new packet with the two previous ones to inspect for glitches Then use ESPNOW to send the data to another MAINESP32 which takes care of the readout and send through the server, since the process would be to fast now, to be concerned with the whole handshaking, acknowledging etc.
The DROX-esp3E2 (X axis) DROY-esp32(Y-axis) would then adapt the position/speed they received from MAINESP32.
Somebody gone this far already?
Interesting, I didn't know about this mode but it should be possible: ESP32 has a fast ADC mode via I2S, so it can go to 200KHz or more. It also have super high resolution (and low drift) clocks and timers via MCPWM if needed, but afaik (unlike STM32) the two cannot be synchronized on ESP32 (except by means of software tricks)
Hi Marius,
Did not really understand what you mean. You mean the speed of readout or the speed for adjusting speeds (a sort of PID at first) following the readout?
The esp32 reads the whole packet in a timespan of 15 ms (your PACKET_READ_TIMEOUT 250 ms ) the 'long' low time before and after the stream of bits not included. Changing the milliseconds to microseconds would be one of the first things to do. Simultaneously, we need to use the time left to adjust the speed and position of the spindle (once a PID is established, those values can be stored or transmitted at boot by the main computer (where the DRO will be displayed and the code is running and streaming the gcode positions to go to and wait for an ok of course). I would use one core of the ESP32 for readout and ESPNOW, the other one for motor control, they can work independently, so it should be perfectly possible. As said before there would be one ESP32 per axis, one Parent ESP32 which communicates with the computer(maybe even Mach3 of 4) and send data through and back and forth to the children.
This is totally unlike steppers doing xxx steps to go to a position, no, it's giving a position and 'be there at that time at that speed'. By that means any motor can be used, supposed the resolution/speed/reaction time is physically possible, To be clear, in this first setup, I'll be using DC gear motors with encoders (for redundancy, and also for backlash elimination)
I2S: you mean I2C?
I just don't know how to setup everything in microseconds, if you could give me a hint there, that would be a charm.
Oh yes, I rebuilt the calipers so they can read up to 1999,99 mm, ordered enough pcb (behind the masking tape, for 100 of those calipers)
Ах да, я переделал штангенциркули так, чтобы они могли считывать показания до 1999,99 мм, заказал достаточно печатной платы (под малярной лентой, для 100 таких штангенциркулей)
Hello Johan. Could you tell me how to modify the calipers so that they read such large readings?