Welcome! Log In Create A New Profile

Advanced

MKS base 1.2 and auto bed leveling

Posted by laazarus 
MKS base 1.2 and auto bed leveling
April 12, 2015 01:17PM
Having a bit of trouble getting this board to drive a servo. As far as I can tell it should make use of pin A11 (it only has A11 and A12 as free pins), I've checked through the marlin config files and the associated pins_***.h file and all looks ok, by default it's pointing at pin 11. (tried it on 65 as well in case its using the arduino numbering for mapping an analog pin to digital). tried all the equivelent pin variation for A12, still nothing. started to try and get creative at this point and started trying to use the max endstop pins for the axis and even a couple in aux1, not a dickie bird.

checked there is 5v at the various point the servo was connected, all good there. finally figured it is basicly and aruino so started trying with the adruino servo example code, went through every pin from 2 - 80. couple of them made steppers shudder but nothing on the servo.

I'm at a loss, could it be that every pin exept the ones it needs to drive the printer are knackered? seems very unlikely.
only thing i can think of now is that there isn't enough current there to drive a 9g servo. but that seems unlikely as well. (checked the servo(s) and they are working fine)

can any one suggest another direction to look, i'm running out of ideas. would love to get auto bed leveling going
Re: MKS base 1.2 and auto bed leveling
April 13, 2015 08:37AM
I'm not familiar with the MKS Base board, but with RAMPS servos often can't be driven by the 5V supplied by the Arduino's regulator. If the Base board's regulator is marginal, it may be in a similar situation. If you're using a ATX power supply, try hooking the servo's 5V up directly to the power supply.
Re: MKS base 1.2 and auto bed leveling
April 13, 2015 11:44PM
I'll see if i can find an ATX supply to test that with, currently I'm running from a single voltage (12v, 300w) PSU.
I did a bit more probing about with a multimeter last night, it looks like the A11 and A12 pins are not quite as they appear. A11 conects to analog input 12 and A12 is connecter to analog input 13.
I'm not sure if these pins are only input and incapable of driving any thing.
Attachments:
open | download - mksbase.jpg (99.7 KB)
Re: MKS base 1.2 and auto bed leveling
April 14, 2015 06:41AM
Analog pins A0-A15 get mapped as digital pins D54-D69. If you were configuring your firmware to operate a servo on pin 11, you were commanding D11 to do something. If you are using A12 or A13, then you need to use 66 or 67. Analog pins can be both input or output. If they are input, they can detect different voltages (10-bit, 1024 values) where the digital pins are just high or low. As an output, they are either on or off, they are not hardware PWM pins. Only pin 2-13 and 44-46 are PWM pins. I don't know if your firmware requires a PWM pin for servo control or if it can simulate it in software.
Re: MKS base 1.2 and auto bed leveling
April 14, 2015 12:26PM
I think you may have nail the issue there. unless Marlin is able to simulate PWM then the MKS Base board doesn't expose any usable pins for driving a servo. Looking at the pin config i have the options of pins 11 and 43, just need to see if theres any where to tap in to one of them. should make for a bit of a project tonight.
thank you cdru you have found me a new direction smiling smiley
Re: MKS base 1.2 and auto bed leveling
April 14, 2015 12:44PM
You might check out the X-min and X-max endstops... winking smiley
Re: MKS base 1.2 and auto bed leveling
April 14, 2015 02:00PM
Yay we have a winner, X-min is in use. but X-max, that the magic connector.
Cheers cdru, looks like i need to pull my finger out and get the auto bed level going
Re: MKS base 1.2 and auto bed leveling
May 24, 2015 08:04AM
Dear Laazarus,

I am having a similar problem trying to drive a servo for an auto-bed leveler. Did X-Max ever work for you? I assume you had to drive +5VDC from an alternate source? I too have a single 12VDC power supply on my printer but can look into dropping the 12VDC down to 5VDC to drive the Auto-bed leveler servo. Can X-Max act as a PWM output?
Trying to get it working with Marlin FW...

Thanks!
Re: MKS base 1.2 and auto bed leveling
May 25, 2015 02:06PM
Special Thanks to Laazarus for steps to change X_MAX_PIN for SERVO0_PIN (by modifying pins.h)

Basically changing:
#define X_MAX_PIN 2
to
#define X_MAX_PIN -1

and changing
#define SERVO0_PIN 11
to
#define SERVO0_PIN 2


Still working on getting Auto Bed Leveling working.. So far it works properly for AUTO HOME but only does the one point in center of bed. (not grid or 3 points)
Re: MKS base 1.2 and auto bed leveling
May 30, 2015 08:29AM
Everything works now on my Aurora Prusa i3 (MKS_BASE_Ver1.1). The fix was with Cura and changing my start.gcode to include:

G28 X0 Y0 ; Forces X and Y axis zeroing
G29 ; Does the Z-Axis Auto-bed leveling routine

Also remember to check other start.gcode and end.gcode commands as some of the defaults can mess you up either before after your object has printed.

[www.youtube.com]

Thanks Laazrus (and indirectly cdru for suggesting X_MAX_PIN to replace the lack of a PWM SERVO0_PIN) The MKS_BASE_Ver 1.1 seems to have enough power off of X_MAX_PIN to drive the servo with no add'l power source... Though I picked up a 12VDC to 5VDC converter just-in-case (didn't use it in the end) as my single 12VDC power supply has multiple 12VDC power outputs. One oddity I'm trying to figure out is that if I power off the printer with the Z-Axis too high up, when I kick off the next job, the auto-bed leveler never goes down far enough to touch the bed. Right now easy fix is to simply remember to do the "AutoHome" off the Marlin menu if I turned the printer off without re-zeroing..

Edited 2 time(s). Last edit at 05/30/2015 09:09AM by legozebra.
Re: MKS base 1.2 and auto bed leveling
May 31, 2015 10:06PM
Anyway you could upload the firmware you are using for the MKS Base 1.1 and Also the printed parts for the servo?

And would like a few pics if you can of the wiring...

I was thinking of switching over to a MKS Gen 1.2 for auto bed leveling

Thanks


Quote
legozebra
Everything works now on my Aurora Prusa i3 (MKS_BASE_Ver1.1). The fix was with Cura and changing my start.gcode to include:

G28 X0 Y0 ; Forces X and Y axis zeroing
G29 ; Does the Z-Axis Auto-bed leveling routine

Also remember to check other start.gcode and end.gcode commands as some of the defaults can mess you up either before after your object has printed.

[www.youtube.com]

Thanks Laazrus (and indirectly cdru for suggesting X_MAX_PIN to replace the lack of a PWM SERVO0_PIN) The MKS_BASE_Ver 1.1 seems to have enough power off of X_MAX_PIN to drive the servo with no add'l power source... Though I picked up a 12VDC to 5VDC converter just-in-case (didn't use it in the end) as my single 12VDC power supply has multiple 12VDC power outputs. One oddity I'm trying to figure out is that if I power off the printer with the Z-Axis too high up, when I kick off the next job, the auto-bed leveler never goes down far enough to touch the bed. Right now easy fix is to simply remember to do the "AutoHome" off the Marlin menu if I turned the printer off without re-zeroing..

Edited 1 time(s). Last edit at 06/01/2015 11:53AM by cdstang.
Re: MKS base 1.2 and auto bed leveling
February 28, 2016 12:50PM
I am using MKS Base V1.4 with Marlin 1.1.0-RC3 Dual extruder setup. I am unable to find servo connection, kindly help me where i can connect 9 gram servo. i am unable it to work also there is no
#define X_MAX_PIN 2
#define SERVO0_PIN 11 in pins.h

kindly help
Re: MKS base 1.2 and auto bed leveling
December 11, 2017 11:44PM
Sorry for such late response. School / Exams / life got in the way.. The board I have (MKS base 1.2) is as pictured here: [www.makergarage.cc]
I ended up using one of the ENDSTOPS because I ran out of servo ports. The pros/cons is that it can only drive a smaller servo (fine for bed leveling), BUT because we're still dealing with an Arduino-based board in the end, it uses a timer, interrupts and software to generate/terminate a pulse. So if the Arduino is busy, that pulse can get extended, which the servo thinks is a pulse.. At least that's my theory as I tried other methods (short of turning off the signal line entirely) to fix. It's not a show-stopper.. Just annoying seeing the bed leveler arm 'jitter' by a fractional degree as it's printing. (and eventually causes additional wear/tear on the servo). One thing I did to fix the jitter is to simply add another switch to turn it off when not in use (ie after bed leveling is complete).

Anyway, my codebase (had to guess/pull down one I hoped would come close) I'm using is based off of the Marlin firmware on GitHub, which has the #define statements as above, though I had to guess at a number of settings since my original Prusa didn't reference any source code in the docs nor any of it's default settings. (lesson learned-make sure manufacturer publishes at least a reference to their variant of the code base or end up 'guessing/crossing fingers' like I did.

@adeel2cool, dual extruders sounds cool, though I've always had mixed luck... Wish other extruder could retract (automatically) as you switch colors/etc.. (like the UltiMaker 3 does)... as I'm always afraid of model collision with the other head...

~Hope it worked out in the end!

Edited 1 time(s). Last edit at 12/11/2017 11:45PM by legozebra.
Sorry, only registered users may post in this forum.

Click here to login