Auto bed leveling questions

The next improvement i want to make is a auto bed leveling.
I have ordered already a capacitive sensor, a LJC18A3-H-Z/BX.
and i have printed the sensor holder http://www.thingiverse.com/thing:447719

i wanted to connect this sensor to the k8200 controller board, for that i have to place a jumper to get 12v on the zstop connector.

but one thing i don’t understand.
The marlin firmware has the option to set the auto bed leveling, but i can not find the options for bed leveling in the K8200 firmware.
do i have to upload the standard marlin firmware?
or does this give problems for the K8200?

[quote=“dutchronnie”]The next improvement i want to make is a auto bed leveling.
I have ordered already a capacitive sensor, a LJC18A3-H-Z/BX.
and i have printed the sensor holder http://www.thingiverse.com/thing:447719

i wanted to connect this sensor to the k8200 controller board, for that i have to place a jumper to get 12v on the zstop connector.

but one thing i don’t understand.
The marlin firmware has the option to set the auto bed leveling, but i can not find the options for bed leveling in the K8200 firmware.
do i have to upload the standard marlin firmware?
or does this give problems for the K8200?[/quote]

If you board is like mine there are no pins to put the jumper on and the holes are soldered up, I bridged the two pads (next to X stop connector).
You need marlin v2.1.1 and some settings will need to be changed to get it working (open both up and compare the config.h settings). I recomend you get this sorted before you start making the auto leveling mods.

BE VERY CAREFULL WHERE YOU HOME THE Z AXIS as there is a space between the hotend and the sensor, at times the sensor moves outside the bed profile. If you home whilst the sensor is not over the table it will keep going, crash the hotend into the bed and break your glass. Guess how I found that out?

I shall take a look at the board, i don’t know if there were jumpers on the board.
i can use the 15v from the power supply to.

So i have to install a new firmware.
Before i got to build this mod, i want to know everything about the mod.

i thought i have read something that there is a setting to compensate the distance of the sensor, but i am not shure

I have searched the marlin V2.1.1 firmware, but there is no section with the autoleveling options.

I have searched the marlin V2.1.1 firmware, but there is no section with the autoleveling options.[/quote]

Sorry - I gave you bad infomation - the link to the files with auto leveling are below.
I set up auto leveling, it however didn’t work well as I had to much backlash in the Z axis so I reverted back to v2.1.1. just using the sensor for the Z endstop.
The configaration.h file you need is here github.com/MarlinFirmware/Marli … ent/Marlin
But I’m not sure how meny of the other files you need - I’ll look at my notes later as I went through this once.

Thanks Barnabybear,

In the mean time i have found the same configuration file on the marlin github.
I also was wondering if the configuration file is al we need, or are the other files necessary too?

Or is it possible to install the complete firmware, without having problems with the printer

[quote]I also was wondering if the configuration file is al we need, or are the other files necessary too?

Or is it possible to install the complete firmware, without having problems with the printer[/quote]

I used all and didn’t have a problem (5 weeks ago). Just looking at the file names they are lots of differences between then and now, so I wouldn’t just swap in single files.

ok, maybe it is a good idea to check it by velleman.
To be shure that the newest marlin firmware can be placed on the k8200 controller.

Just checked, i am also missing the 12v jumpers, but it is possible to solder an header on the print.

Today i have updated the firmware with the latest Marlin from https://github.com/MarlinFirmware/Marlin

In the package is already a config file for the K8200.
I have only changed some parameters and uploaded the firmware to the controller. Everything is working well.
The firmware has to be uploaded with the latest arduino, not version 1.0.6, but with version 1.6.1

Now i have to connect the capacitive sensor to the controller.
I do have a NPN sensor with a NC kontakt, and i have now 2 option to connect it to the controller.
wich of these two options is the best?

https://dl.dropboxusercontent.com/u/10666094/SCHEMA-SENSOR.pdf

Hi, thats good news.
I used 22k & 10k but the voltage came out lower than expected (but works fine). If I did it again I would use 20k & 10k.
Both should work fine.

I do nut trust the schematic.

the output of the sensor with the resistors is 5 volt.
but when i measure on the controler pins between S and - the there is also 5v when the microswitch becomes active.

does this not destroy the controller board when there is 5 volt supplied from the sensor?
the board supplies 5 volt to the microswitch?
How does this exactly works?

[quote]does this not destroy the controller board when there is 5 volt supplied from the sensor?
the board supplies 5 volt to the microswitch?
How does this exactly works?[/quote]

When microswitches are used a pullup resistor is enabled in the firmware, when not in the home postion (switch open) the input is high (5v) so yes it supplies 5v to the switch. In the home postion (switch closed) the input is grounded (0v).
This will work the other way round with the sensor, so you need to disable the pullup resistor & invert the input.
Find this section in confiuration.h and change.

===========================================================================
//=============================Mechanical Settings===========================
//===========================================================================

// Uncomment the following line to enable CoreXY kinematics
// #define COREXY

// corse Endstop Settings
#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors

#ifndef ENDSTOPPULLUPS
// fine Enstop settings: Individual Pullups. will be ignord if ENDSTOPPULLUPS is defined
#define ENDSTOPPULLUP_XMAX
#define ENDSTOPPULLUP_YMAX
//#define ENDSTOPPULLUP_ZMAX =======COMMENTED OUT =======
#define ENDSTOPPULLUP_XMIN
#define ENDSTOPPULLUP_YMIN
//#define ENDSTOPPULLUP_ZMIN =======COMMENTED OUT =======
#endif

#ifdef ENDSTOPPULLUPS
// #define ENDSTOPPULLUP_XMAX
// #define ENDSTOPPULLUP_YMAX
// #define ENDSTOPPULLUP_ZMAX
#define ENDSTOPPULLUP_XMIN
#define ENDSTOPPULLUP_YMIN
//#define ENDSTOPPULLUP_ZMIN =======COMMENTED OUT=======
#endif

// The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
const bool X_ENDSTOPS_INVERTING = false; // set to true to invert the logic of the endstops.
const bool Y_ENDSTOPS_INVERTING = false; // set to true to invert the logic of the endstops.
const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops. =======CHANGED FROM FALSE TO TRUE=======
//#define DISABLE_MAX_ENDSTOPS

A good viedo on how to set up auto leveling. Shows the configuration_adv.h change aswell so I wount type it.

youtube.com/watch?v=EcGFLwj0pnA

Thanks Barnabybear.

Now it is clear to me.
This weekend i will mount the sensor and give it a try.

Today i installed the sensor, everything works.
But i have 1 problem.
I want to tune the exact position of the sensor, so i to change the following rules in the configuration.h file

#define X_PROBE_OFFSET_FROM_EXTRUDER 47 // -left +right
#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // -front +behind
#define Z_PROBE_OFFSET_FROM_EXTRUDER -11.23 // -below (always!)

but i get a compilation error:
#error “The given RIGHT_PROBE_BED_POSITION can’t be reached by the probe.”

it is strange, the sensor is 47mm on the right of the extruder,

even when i changed the value to +47, or -47 i get the same error

what i am doing wrong?

What values do you have in here?

// set the rectangle in which to probe
#define LEFT_PROBE_BED_POSITION 15
#define RIGHT_PROBE_BED_POSITION 170
#define BACK_PROBE_BED_POSITION 180
#define FRONT_PROBE_BED_POSITION 20

Reduce #define RIGHT_PROBE_BED_POSITION 170
170 + 47 = 217 (your bed can only move 200mm) so max value 153 (I used 140).
when you tried -47 (it cant move to that postion)

looks to big a value. Is that just for testing? Given the sensor has a 4mm detection range, I would expect a value between -1 & -3.
Becarefull: this implies that your sensor is about 5mm below the nozzle. Once homed, the the endstops are disabled and the machine believes it is ok to move 11.23 downwards. It might be worth reseting your sensor even for testing.

I have a capacitive sensor with 10mm detection distance.
I have changed the value -11.23 to -8

But til now it is stil not working, i have spend hours wit no result.
I can not get the homeing right.

when i home the extruder it stops aprox. 3 mm above the printbed.
when i cange the ofsset distance in the firmware and then i upload the firmware.
set a M501 command, and see that the offset is zero.

when i change the offset with command M206 Z-3
the i see with command M501 that the offset is -3.0

but when i home, the nozzle always stays above the printbed.
And this is always when the sensor get triggered

I don’t know what to do.
Somebody a suggestion?

If you use a home command (G28) it will always stop when the sensor is triggered, but you should be able to manualy move to lower than the home postion.
Try homing then M114 (get current postion) should be somthing like x:0.00 y:0.00 Z:3.00 E0.00
If that works, try a direct move command:
G21
G90
G1 z2
That should:
Set dimentions to mm
Set absolute postioning
Move the nozzle to 2mm above the bed.

EDIT: after homing and the M114 Z should be equal to the distance between the bed and the nozzle. If not adjust the offset in the firmware. Then try the direct move.

I don’t know anymore.

everytime i set an ofset, it doesn’t work.

homing works.

i have measuret the distance from sensor to heatbed (now 9 mm, this morning 8 very strange)
set the 9mm ofset in the firmware:

#define Z_PROBE_OFFSET_FROM_EXTRUDER -9

then i do a homing, almost good, but i need 0.1mm or 0.2 mm extra clearance
so i gave the command: M206 Z0.1
then i expect when i do a homing that there is more clearance, but it is the same.

the only way i can change the offset is to change the sensor distance

now i am stopping, after a hole day of frustaration.
Maybe i am go gack to the switch, that was working al the time

http://airtripper.com/1799/marlin-firmware-home-offset-guide-using-g-code-m206/
Have a look at this, it details using the M206 command.

I have never used this, I changed #define Z_PROBE_OFFSET_FROM_EXTRUDER -9 and uploaded.

Sorry you had a frustrating day. It will be worth it, no more bed leveling or adjusting the z endstop as the machine has run for some time.