Welcome! Log In Create A New Profile

Advanced

Plotter + Marlin firmware + servomotor as E axis

Posted by AAC 
AAC
Plotter + Marlin firmware + servomotor as E axis
March 15, 2017 11:26AM
Hello everyone,

i built a plotter and i'm running marlin firmware on my arduino mega, but i'm not sure what are the modifications that i need to do in the configuration.h file to use a servo motor to move a pen up and down.

Any thoughts?

Thanks, AAC
Re: Plotter + Marlin firmware + servomotor as E axis
March 15, 2017 01:11PM
Change the number of servos from 0 to 1 and that will turn on the servo code. Then take a look at the bool set_probe_deployed(bool deploy) function in Marlin_main.cpp

That deploys and stows the probe which is very often done with a servo.

In that function block you will see the line of code:
servo[Z_ENDSTOP_SERVO_NR].move(z_servo_angle[deploy ? 0 : 1]);

If you have your servo on the connector for servo #0, you could say servo[0].move(45); To get the servo to position at 45 degrees.
Sorry, only registered users may post in this forum.

Click here to login