Notifications
Clear all

Prusa Mini with MK3S Extruder/Filament Sensor  

  RSS
djkirkendall
(@djkirkendall)
Trusted Member
Prusa Mini with MK3S Extruder/Filament 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 12:30 am
karl-herbert
(@karl-herbert)
Illustrious Member
RE: Prusa Mini with MK3S Extruder/Filament Sensor
Posted by: @djkirkendall

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.

 

Prusa Mini invert Sensor logic:

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

 

modified:

static void _cycle0() {

    if (gpio_get(PIN_FSENSOR) == 0) {

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

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

 

original (line 244):

//called only in fs_cycle

static void _cycle1() {

    //pulldown was set in cycle 0

    _set_state(gpio_get(PIN_FSENSOR) == 1 ? FS_HAS_FILAMENT : FS_NOT_CONNECTED);

    gpio_init(PIN_FSENSOR, GPIO_MODE_INPUT, GPIO_PULLUP, GPIO_SPEED_FREQ_VERY_HIGH); // pullup

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

}

 

modified:

//called only in fs_cycle

static void _cycle1() {

    //pulldown was set in cycle 0

    _set_state(gpio_get(PIN_FSENSOR) == 0 ? FS_HAS_FILAMENT : FS_NOT_CONNECTED);

    gpio_init(PIN_FSENSOR, GPIO_MODE_INPUT, GPIO_PULLUP, GPIO_SPEED_FREQ_VERY_HIGH); // pullup

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

}

 

Prusa Mini change esteps:

Configuration_A3ides_2209_MINI.h

original:

* Default Axis Steps Per Unit (steps/mm)

 * Override with M92

 *                                      X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]]

 */

//#define DEFAULT_AXIS_STEPS_PER_UNIT   { 100, 100, 400, 280 } //E0 280 295

#define DEFAULT_AXIS_STEPS_PER_UNIT \

    { 100, 100, 400, 325 } //E0 280 295

//#define DEFAULT_AXIS_STEPS_PER_UNIT   { 800, 800, 3200, 1120 } //E0 280 295

//#define DEFAULT_AXIS_STEPS_PER_UNIT   { 100, 100, 400, 1120 } //E0 280 295

 

modified:

* Default Axis Steps Per Unit (steps/mm)

 * Override with M92

 *                                      X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]]

 */

//#define DEFAULT_AXIS_STEPS_PER_UNIT   { 100, 100, 400, 280 } //E0 280 295

#define DEFAULT_AXIS_STEPS_PER_UNIT \

{ 100, 100, 400, 140 } //E0 280 295 // E -> 140=8 microsteps (280=16 microsteps)

//#define DEFAULT_AXIS_STEPS_PER_UNIT   { 800, 800, 3200, 1120 } //E0 280 295

//#define DEFAULT_AXIS_STEPS_PER_UNIT   { 100, 100, 400, 1120 } //E0 280 295

 

 
Statt zu klagen, dass wir nicht alles haben, was wir wollen, sollten wir lieber dankbar sein, dass wir nicht alles bekommen, was wir verdienen....
Posted : 14/02/2021 1:38 am
djkirkendall
(@djkirkendall)
Trusted Member
Topic starter answered:
RE: Prusa Mini with MK3S Extruder/Filament Sensor

@karl-herbert

The new firmware syntax is a little different, but the approach was the same:

 

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

 

I compiled, uploaded, and tested the new firmware and it checks GOOD! Thanks for the help. I've attached the resultant .bbf for anyone that wants to follow this. I'll put the link to TVerse here in a few.

 

...
Posted : 14/02/2021 4:46 am
djkirkendall
(@djkirkendall)
Trusted Member
Topic starter answered:
RE: Prusa Mini with MK3S Extruder/Filament Sensor

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

I put the firmware up as well. 

Enjoy!

...
Posted : 14/02/2021 5:01 am
karl-herbert
(@karl-herbert)
Illustrious Member
RE: Prusa Mini with MK3S Extruder/Filament Sensor

@djkirkendall

This is quite possible. I have made these and other changes in 4.2.0. But I hope that this still helped.
A small correction to the following line:

{ 100, 100, 400, 140 } //E0 280 295 // E -> 140=8 microsteps (280=16 microsteps)

I increased E from 16 to 32 microsteps (not from 8 to 16 as stated). Currently X/Y/E=32 microsteps, Z=16 microsteps

 

Interesting project and thanks for making it available in Thingiverse 👍 

 

 
Statt zu klagen, dass wir nicht alles haben, was wir wollen, sollten wir lieber dankbar sein, dass wir nicht alles bekommen, was wir verdienen....
Posted : 14/02/2021 12:45 pm
pear3d.ch
(@pear3d-ch)
Eminent Member
RE: Prusa Mini with MK3S Extruder/Filament Sensor

Hi Guys,

i am runing mk3s extruder since a while:

The project is here: https://www.prusaprinters.org/prints/37939-prusa-mini-mk3s-bear-ultra-upgraded

Best Regards

Posted : 15/02/2021 9:50 am
karl-herbert
(@karl-herbert)
Illustrious Member
RE: Prusa Mini with MK3S Extruder/Filament Sensor

@3dpgva

Well done 👍 
The new MK-Mini so to speak 😊 

Statt zu klagen, dass wir nicht alles haben, was wir wollen, sollten wir lieber dankbar sein, dass wir nicht alles bekommen, was wir verdienen....
Posted : 15/02/2021 12:00 pm
djkirkendall
(@djkirkendall)
Trusted Member
Topic starter answered:
RE: Prusa Mini with MK3S Extruder/Filament Sensor

@3dpgva

Neat!! 

I was looking to eat Bondtech's lunch with my design.

...
Posted : 15/02/2021 5:28 pm
djkirkendall
(@djkirkendall)
Trusted Member
Topic starter answered:
RE: Prusa Mini with MK3S Extruder/Filament Sensor

@3dpgva

Neat!! 

I was looking to eat Bondtech's lunch with my design.

...
Posted : 15/02/2021 5:28 pm
Share: