Welcome! Log In Create A New Profile

Advanced

Marlin Hack

Posted by willenbrook 
Marlin Hack
August 04, 2015 05:11PM
Im currently using Rich Cattell's version of Marlin, and I want to make a small change to the program, but not to sure where to start, please help!

For the auto level probe im using a micro switch on the end of the servo. Everything works fine, apart from I get really bad servo jitter.

I know I can use ferrite beads on the motor cables to try and reduce it, but I thought i would take the opportunity to try my first marlin hack.

Iv read that in other versions of Marlin there is an option to disable the servo while moving, but I cant find this option in Rich Cattell's version. (I think you can guess where im going with this)

Basically what I want to do is cut the relevant bit of code from the relevant version of marlin, and paste it into Rich Cattell's version.

Im a mechanical engineer by day, so programming isn't really my strong point, but I really want to learn!
Iv been through the Arduino tutorials a few months ago, so i have a basic understanding of the language.

Can someone point me in the right direct just to get me going with this.
Are there any decent tutorials to read through?
What is the best program to use for editing the code? Im currently using the default Arduino editor.
Is what I want to do even possible, or easy to do?

Any help would be much appreciated.
Re: Marlin Hack
August 05, 2015 04:21AM
Can´t help with the Marlin hack, but wanted to ask, if your servo has a decent 5V power supply?
The 5V regulator usually isn´t up to the task...
-Olaf
Re: Marlin Hack
August 10, 2015 10:44AM
I've attached a zip file with two files you need. This includes a patch for servo leveling taken from Marlin main stream.

Give it a try and let me know if it works or doesn't smiling smiley I'll be able to officially test this later tonight on my kossel.

Cheers,
Mark aka thetazzbot

PS

Don't use the configuration_servo_leveling.h file as is, you need to open it up and look for theselines and copy them into your "servos" section of your existing configuration.h file

//If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk
//The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it.
// You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile.

// #define PROBE_SERVO_DEACTIVATION_DELAY 300

You should rename your existing marlin_main.cpp file to marlin_main_backup.cpp and then copy my patched version into the same folder and rename it to Marlin_main.cpp

Edited 1 time(s). Last edit at 08/10/2015 10:46AM by thetazzbot.
Attachments:
open | download - Rich-Cattell-Marlin-Servo-Levelling.zip (37.8 KB)
Re: Marlin Hack
August 12, 2015 11:02PM
Guess you didn't need it after all..
Re: Marlin Hack
August 13, 2015 08:57AM
Thank thetazzbot, I'm away from home at the moment but will definitely give this a go and let you know how I get on when I'm back!
Re: Marlin Hack
August 14, 2015 12:47PM
Cool. Let me know how it goes!
Sorry, only registered users may post in this forum.

Click here to login