ESP32 control a linear actuator with pulse feedback

You should probably use the rotary encoder platform instead.

You have 2 internal hall sensors and thats how direction and speed feedback are tracked, by uaing both sensors.

If for examlple the motor rotates CW and extends actuator, it will be like this. Say sensor1 is A and sensor2 is B for example.

On CW you would see see pulses like this…
AB, AB, AB, AB… each AB is 1 revolution of.the motor and the time between A and B is how you calculate speed if thats something you want to know or need to adjust.

On CCW or retract, the sequence will be backwards like thia.
BA, BA, BA, BA…

Thia ia exactly how a rotary encoder works also.