Prusa Mini with MK3S Extruder and Filament Runout Sensor
 
Notifications
Clear all

Prusa Mini with MK3S Extruder and Filament Runout Sensor  

  RSS
djkirkendall
(@djkirkendall)
Trusted Member
Prusa Mini with MK3S Extruder and Filament Runout Sensor

So I had an idea a couple of days ago, why spend the cash on the Bondtech and external sensor for the Prusa Mini when the MK3S extruder has both?

I worked up the STL files, and the installation went really well. I now have a MK3S extruder and sensor in place, and everything appears to fit great. 

I'm stuck on the firmware for the Mini, however. I pulled the git, and I have it compiling cleanly. I cut the appendix and uploaded the beta and all is well there. 

Specifically, I'm having trouble finding:

1.) Invert filament sensor logic for MK3S:

    - I found filament_sensor.cpp:

typedef enum {
M600_on_edge = 0,  
M600_on_level = 1,  
M600_never = 2         
} send_M600_on_t;

Q: Will this do it, or is there somewhere else to look? I'm in C:\Mini\Prusa-Firmware-Buddy-RELEASE-4.3.0\src

Secondly, I can't find a reference .h or .cpp for the mini (like configuration.h or the like that I'm used to seeing in other prusa/marlin folders) to change the e steps per mm to the needed 140. Anyone know where to change this at the firmware level?

 

I appreciate any help you good folks are willing to provide. Once I have the firmware up, tested & verified, and proven I'll share the extruder design up on thingiverse. All in all, the petg parts and gears/sensor only set me back about $25.

Posted : 14/02/2021 1:18 am
djkirkendall
(@djkirkendall)
Trusted Member
Topic starter answered:
RE: Prusa Mini with MK3S Extruder and Filament Runout Sensor

If anyone runs across this thread, here is the link: https://www.thingiverse.com/thing:4761746

I put the firmware up as well.  It works really well, and is super clean. 

Enjoy!

Posted : 14/02/2021 5:02 am
Turro75
(@turro75)
Estimable Member
RE: Prusa Mini with MK3S Extruder and Filament Runout Sensor

Line 660 of the file

 

For the sensor idk

Posted : 14/02/2021 9:52 am
Turro75
(@turro75)
Estimable Member
RE: Prusa Mini with MK3S Extruder and Filament Runout Sensor

now I know, same file line 1002 to set filament sensor

Posted : 14/02/2021 10:13 am
djkirkendall
(@djkirkendall)
Trusted Member
Topic starter answered:
RE: Prusa Mini with MK3S Extruder and Filament Runout Sensor

@turro75

I saw this too, but it looks like Prusa disbaled the Marlin filament runout sensor to make their own.

Best I can tell, they did it to allow for the event handlers to override from the front panel, and from the octoprint screen. 

Posted : 14/02/2021 3:04 pm
NickRno77
(@nickrno77)
Trusted Member
RE: Prusa Mini with MK3S Extruder and Filament Runout Sensor

I’m trying to use the Mini Filament sensor for the MK3s, I cant Find anywhere to invert the IR Sensor, any ideas ? 

 

https://forum.prusa3d.com/forum/original-prusa-i3-mk3s-mk3-hardware-firmware-and-software-help/using-a-prusa-mini-filament-sensor-on-a-mk3s/

I’m using a E3D Hemera extruder which doesn’t have a filament sensor, I trying to use a Prusa Mini Filament sensor. Trouble is when filament is loaded the switch is set to 0 so I need to toggle this on the Firmware. I could redesign the filament sensor housing but ideally I’d like to do this in FW

Can somewhere point where and what to change in the firmware.

Thanks”

 

This post was modified 3 years ago by NickRno77
Posted : 31/03/2021 6:06 pm
djkirkendall
(@djkirkendall)
Trusted Member
Topic starter answered:
RE: Prusa Mini with MK3S Extruder and Filament Runout Sensor

From @karl-herbert

static void _cycle0() {
if (fSensor.read() == Pin::State::low) {
fSensor.pullDown();
status.meas_cycle = 1; //next cycle shall be 1
} else {

static void _cycle1() {
//pulldown was set in cycle 0
_set_state(fSensor.read() == Pin::State::low ? fsensor_t::HasFilament : fsensor_t::NotConnected);
fSensor.pullUp();
status.meas_cycle = 0; //next cycle shall be 0

Posted : 01/04/2021 1:11 am
djkirkendall
(@djkirkendall)
Trusted Member
Topic starter answered:
RE: Prusa Mini with MK3S Extruder and Filament Runout Sensor

Original thread: https://forum.prusa3d.com/forum/user-mods-octoprint-enclosures-nozzles/prusa-mini-with-mk3s-extruder-filament-sensor/#post-371929

 

Posted : 01/04/2021 1:12 am
NickRno77
(@nickrno77)
Trusted Member
RE: Prusa Mini with MK3S Extruder and Filament Runout Sensor
Posted by: @djkirkendall

Original thread: https://forum.prusa3d.com/forum/user-mods-octoprint-enclosures-nozzles/prusa-mini-with-mk3s-extruder-filament-sensor/#post-371929

 

Thanks, for me I’m guessing the Mk3s firmware will be the opposite so I’ll need to change as follows? I may just make a sensor enclosure and pass the filament over the sensor directly doing away with the lever, magnets and ball  ? I’ll try this though  

————————————

filament_sensor.cpp

original (line 212):

static void _cycle0() {

    if (gpio_get(PIN_FSENSOR) == 1) {

        gpio_init(PIN_FSENSOR, GPIO_MODE_INPUT, GPIO_PULLDOWN,            GPIO_SPEED_FREQ_VERY_HIGH); // pulldown

        status.meas_cycle = 1;                                                             //next cycle shall be 1

 

 

Posted : 01/04/2021 6:27 am
EpicMount
(@epicmount)
New Member
RE: Prusa Mini with MK3S Extruder and Filament Runout Sensor

Found a way to get this to work in firmware version 4.3.3.

File: filament_sensor_photoelectric.cpp

Update the two functions FSensor::cycle0 and FSensor::Fcycle1 and switch HasFilament and NoFilament between the two functions.

 

Updated to flip the way the filament sensor reads should look like this: 

void FSensor::cycle0() {

    if (FSensorPins::Get()) {

       FSensorPins::pullDown();

        meas_cycle = 1; //next cycle shall be 1

    } else {

        set_state(fsensor_t::HasFilament); //it is filtered, 2 requests are needed to change state

        meas_cycle = 0;                   //remain in cycle 0

    }

}

void FSensor::cycle1() {

    //pulldown was set in cycle 0

    set_state(FSensorPins::Get() ? fsensor_t::NoFilament : fsensor_t::NotConnected);

    FSensorPins::pullUp();

    meas_cycle = 0; //next cycle shall be 0

}

Posted : 25/11/2021 4:10 am
Share: