count extruder motor pulses


I want to read and count the pulses sent to the NEMA-17 stepper motor that controls the Lulzbot Taz 6 extruder, so I can calculate the pulse rate and monitor the extrusion rate in real-time during a print. Does anyone know how I can monitor each pulse/ step of the extruder motor?

I want to monitor the extrusion rate in real-time without interfering with the print, so my plan was to read the pulses into an external data acquisition (DAQ) device, which I will use to monitor and calculate the extrusion rate (of course, other ideas of how to monitor extrusion rate in real-time are welcome, too).

I have had two ideas, but I have not been able to figure out how to implement either:

  1. Have the firmware output an additional pulse to a separate pin, and have it do this simultaneous to each output pulse sent to the extruder motor. I could then feed this separate pin to my DAQ to count the pulses. However, I cannot find the location in the firmware that sends out each motor pulse in real-time. Does anyone have any recommendations how to do this?

  2. Connect a wire in parallel to the pulse wire that runs from the micro-controller to the motor, and feed this wire to my DAQ. However, I am concerned about doing this because it may affect how well the printer operates. Additionally, the motors use a four-wire pulsing system, which complicates the matter.

If anyone has any recommendations to assist with either of these points, or if anyone has any other ideas, I would appreciate it.

Thank you,