After my change to the BIGTREETECH E3 RRF V1.1 control board on my Ender 5, I also wanted to add their smart filament sensor.
I am running RepRapFirmware (RRF) on the board, and one of the big challenges I had was the documentation on how to get the sensor configured, so here is my take on it.
Hardware
Connecting the sensor to the board is very simple. In the package for the sensor, you get a cable with a 4 pin connector on one end and a 3 pin connector on the opposite. The 4 pin goes into the sensor, and the 3 pin connector will fit into a connector labeled E0-STOP on the board.
Calibration
Before we can use the sensor, we need to calibrate it.
To define the sensor in RRF, we need to use the M591 command. Initially we just need to define what kind of sensor it is, and how it is connected.
D0 sets the sensor to 1work with Extruder 0, P7 sets the sensor to a pulse-generating sensor, C”e0stop” defines the pin the sensor is connected to. By default the sensor is monitored, but won’t stop the printer. This will allow us to have RRF help up find the values we need.
M591 D0 P7 C"e0stop"
So first we add this into the config.g file.
Save the file and restart the controller.
After the restart you can head over to the console and send
M591 D0
This will return something like
Pulse-type filament monitor on pin (e0stop,e0det), disabled, sensitivity 1.000mm/pulse, allowed movement 60% to 160%, check every 5.0mm, no data received
If you try to push filament through by hand, the message should change to
Pulse-type filament monitor on pin (e0stop,e0det), disabled, sensitivity 1.000mm/pulse, allowed movement 60% to 160%, check every 5.0mm, no calibration data
If the message changed from no data received to no calibration data RRF registered pulses from the sensor, but since it didn’t move the filament on its own, it has no idea what actually happened. So now we need to figure out how many mm/pulse the sensor is giving us.
To do this, simply start printing something.
After a few minutes of printing, head back to the console and send the M591 D0 command again. If the message still say no calibration data, let it print for a little while longer, then try again. If enough filament has passed through the sensor, the message should now say something like this
Pulse-type filament monitor on pin (e0stop,e0det), disabled, sensitivity 1.000mm/pulse, allowed movement 60% to 160%, check every 5.0mm, measured sensitivity 6.453mm/pulse, measured minimum 15%, maximum 16% over 25.8mm
For a more precise number, you can let it print some more, but this will probably be good enough.
Setup
Now we got our calibration data, so it is time to set up the sensor and enable it, head over to config.g again.
L we set to 6.453, which RRF told us earlier is how much filament goes through the sensor for each pulse.
E I have set to 3 times the L value, so 19.359, to allow it to get multiple pulses to compare between.
R defines how much deviation from the expected distance we allow. 70:130 will allow a +/- 30% deviation.
Last we add S1 to enable the sensor.
M591 D0 P7 C"e0stop" L6.453 E19.359 R70:130 S1
And that’s it! The sensor has shown us the values we need, and we have used those values to set up the sensor.
Save the file, restart the controller, and get back to printing!