Custom retract routine with a servo

I'm using the latest firmeware version.

I use a syringe extruder on my Prusa. It works quite well, but there is too much elasticity in the system.
I want to implement e vacuum-based retract method. For that solution i need a drive e servo with the G10/G11 command.
Is it possible to modificate the retract routine in commands.cpp such i can control the servo.

Could this work?:

#if FEATURE_RETRACTION && NUM_EXTRUDER > 0
    case 10: // G10 S<1 = long retract, 0 = short retract = default> retracts filament according to stored setting
  
    HAL::servoMicroseconds(1, 500, 0)

       
    case 11: // G11 S<1 = long retract, 0 = short retract = default> = Undo retraction according to stored setting

   HAL::servoMicroseconds(1, 2500, 0)

#endif
        break;

Thank you!


 






Comments

  • At least it would define position for second servo. Keep in mind that servos need some time to position but function returns immediately. So if the servo position does what you need it should work.
Sign In or Register to comment.