# Specific 3D Printers, Scanners, & Hardware > FlashForge Forum >  Auto-leveling using an Inductive Sensor

## ejcruz

Just wondering if anyone has or tried to implement Auto-leveling (tramming) using an Inductive Sensor with FF Creator series. From what I have read so far you will need:
- Sailfish 7.7/4.7 Release (this firmware supports Auto-leveling)
- Control board with ATmega 2560 processor

Here is a link http://www.instructables.com/id/Enab...ter-Marlin-Fi/ which gives you a good idea, but please note the link is based on Marlin Firmware.

I would be very interested to hear from anyone of their experiences.

Thank you

----------


## curious aardvark

Given how infrequently you need to calibrate a ff creator. Not sure anyone's added auto levelling to one. 

Be interesting to see how hard it is though

so how does it work ? do you still have to mess with the levelling screws ? or somehow motorise them ?

----------


## ejcruz

> Given how infrequently you need to calibrate a ff creator. Not sure anyone's added auto levelling to one. 
> 
> Be interesting to see how hard it is though
> 
> so how does it work ? do you still have to mess with the levelling screws ? or somehow motorise them ?


Thank you for posting, my understanding so far on Auto-leveling (tramming) saves you from messing around with the leveling screws, you only level the bed one time using the leveling screws there after the Sailfish Firmware will use the inductive sensor to compensate the Z-Axis Min for any part of the bed which has gone out of alignment, which means you don't have to touch the leveling screws again. It looks straight forward implementing this with the Marlin Firmware because of easy access to it's configuration file (configuration.h) where you can enable the necessary parameters for Auto-leveling, and simply connecting the inductive sensor to the Z-Axis Min connector - this connector is also available on FFCP. Sailfish 7.7/4.7 say's Auto-leveling is available but does not say how to enable or access this function, note there is no configuration file for Sailfish 7.7/4.7, so maybe there is some G-Code available ?

----------


## jfkansas

Really a waste of time. Some people make "messing" around with the leveling screws seem so difficult. Any time spent "messing" with auto leveling is better spent thinking about adding lead screws to the system so the platform isn't cantilevered. Generally after that is done very little adjustment is ever needed. There will be times the system needs trammed due to different substrates and nozzle heights, but that is different than leveling.

----------


## ejcruz

Maybe considering on an average I level my FFCP 2 times per month, further investigation shows Scottbee is having good results with his design - here is the link https://groups.google.com/forum/#!ms...4/0A1unBHWeyYJ . I'll wait and see if Scottbee will sell/release his design.

----------


## Ama-fessional Molder

Tramming is kind of by default NOT using software compensation, as it implies physically leveling the bed plate.

----------


## originalt80

does anybody have an knowledge on the BL Touch auto leveling sensor and the FFCP?

----------


## ejcruz

> does anybody have an knowledge on the BL Touch auto leveling sensor and the FFCP?


This is another auto-leveling system I'm looking at, I like the compact build and size which gives you better options to mount near the extruder compared to the Inductive sensor, the sensor pin head is retractable at about 3mm (nice clearance distance), and the body length is 36mm (good size to locate near the extruder. It has 5 wires, +5V, GND, and 3 wires which use the same connectors to a servo, this means you should be able to connect these wires to the Z-Axis Min socket on the FFCP board. For me the only down side is the price USD$33 + postage compared to Inductive sensor $4.

----------


## originalt80

> This is another auto-leveling system I'm looking at, I like the compact build and size which gives you better options to mount near the extruder compared to the Inductive sensor, the sensor pin head is retractable at about 3mm (nice clearance distance), and the body length is 36mm (good size to locate near the extruder. It has 5 wires, +5V, GND, and 3 wires which use the same connectors to a servo, this means you should be able to connect these wires to the Z-Axis Min socket on the FFCP board. For me the only down side is the price USD$33 + postage compared to Inductive sensor $4.


yes it seems like a good option but i cannot find any setup info for how to set this sensor up on the ffcp... the creators of the bl touch verified that it can work with the ffcp.   so the 5 wires (set of 3 & set of 2) the 3 are for the Z-axis Min Socket and the 2 are just +5V & GND??

----------


## ejcruz

Had another look at the BLTouch specification here's the details:
3 wires: Brown = GND, Red = +5V, Orange = control signal
2 wires: Black = GND, white = Z-Min Axis

FFCP Z-Min Axis connection on the board is as follows:
pin 1 = +5V
pin 2 = GND
pin 3 = GND
pin 4 = signal

First I want to make it clear I have not tried/tested connecting the BLTouch to the FFCP, I hope someone else with more electronic experience will help, the BLTouch has 5 wires whereas the FFCP Z-Min Axis only has 4, so I would first try the following:
BLTouch  ===========     FFCP
Brown wire (GND)  ====>>    Pin 2 (GND)
Black wire (GND)    ====>>    Pin 2 (GND)
Red wire  (+5V)     ====>>     Pin 1 (+5V)
Orange wire (signal) ===>>   pin 4 (signal)
White wire (Z-Min)   ====>>   pin 3 (GND)
The Orange and the white wires I'm not sure they may need to be swapped around.

To test use the following G-Code:
M280 P0 S90   ; to push the pin down
M280 P0 S10   ; to pull the pin up

You need to read the sailfish manual to understand the G-Codes:
- go to section Little Details, then go to Firmware Auto-Leveling
- go to section Special G-Code Commands

Hope this helps

----------


## originalt80

thank you for the information ill give it a shot and see if i can get it set up correctly

----------


## ejcruz

I just placed an order for a BLTouch.

I also did a trace of the pin-outs on the ATMEGA2560 board for the Z_MIN Axis, image is attached, in case the image is not clear, following are details starting from the top:
- top pin: connects to the ATMEGA2560 chip
- 2nd pin: GND
- 3rd pin: GND
- 4th pin: +5V

Hope this helps

https://photos.smugmug.com/3D-Printe...3/Z-MIN-X3.jpg

----------


## curious aardvark

definitely interested to see how this pans out. 
Presumably you put the 'check for level' code in the startup gcode - or do you run the whole thing from the control panel ?

Not interested for my creator - as the has 4 level knobs at the very edge of the build plate so very very easy to level. Plus wrong firmware.

But the knp has three knobs in the centre of the plate which means the a tiny change in the centre is magnified to a large change at the edges.  It's more guesswork than science :-)
Plus that has the right firmware.

----------


## originalt80

> I just placed an order for a BLTouch.
> 
> I also did a trace of the pin-outs on the ATMEGA2560 board for the Z_MIN Axis, image is attached, in case the image is not clear, following are details starting from the top:
> - top pin: connects to the ATMEGA2560 chip
> - 2nd pin: GND
> - 3rd pin: GND
> - 4th pin: +5V
> 
> Hope this helps
> ...


awesome i already have the bltouch sensor but im a newbie just getting into 3d printing and i really have no idea how to setup the gcode or any of it really. so glad to know u are pursueing this sensor as well.  i will follow your progress with this setup and hope to get it going.  thanks for all your info thus far.

----------


## ejcruz

Attached is an image showing how to connect the BLTouch sensor to the FFCP, this wiring diagram has also been confirmed by the BLTouch people, I have forward this to Flashforge for their confirmation.

https://photos.smugmug.com/3D-Printe...ch-FFCP-XL.jpg

----------


## originalt80

> Attached is an image showing how to connect the BLTouch sensor to the FFCP, this wiring diagram has also been confirmed by the BLTouch people, I have forward this to Flashforge for their confirmation.
> 
> https://photos.smugmug.com/3D-Printe...ch-FFCP-XL.jpg



Great work.. you are the greatest.. i connected as per your previous suggestions and the sensor would turn on and do self test when turning the printer on but for the life of me i could not get anything else to happen.    this would explain why.        thumbs up

----------


## ejcruz

Sorry about that, it's hard not having the sensor, it looks like all you need to do is connect the orange cable to PB7, and the white cable to Z-MIN pin, if you like you can leave the other cable (+5v and GND) as per current connection, that should do the trick.

My BLTouch is due to arrive around 12th September.

----------


## originalt80

No reason to be sorry. without your help and suggestions i would still be sitting here scratching my head staring at this single page of the specs for the bltouch sensor wondering if id ever understand it. lol       your help is greatly appreciated       cant wait to see how this all works out.

one thing i was wondering about is a way to mount the sensor and a good location so that its close enough to the nozzles and not cause any issues with clearance around it.    i searched all over for a printable bltouch mount for the FFCP but couldnt find one anywhere.

----------


## originalt80

looks as tho i do indeed have the correct board.... ATMEGA2560 board     

https://www.dropbox.com/sc/cczunqeop...vi1-sqM_ZXJsKa

----------


## jfkansas

So am I missing something? Where is the circuitry and motors that levels the build plate?

----------


## originalt80

> So am I missing something? Where is the circuitry and motors that levels the build plate?


with this sensor it uses Z axis to compensate for slight changes in the bed..   someone more knowledgeable can explain it better

----------


## ejcruz

> No reason to be sorry. without your help and suggestions i would still be sitting here scratching my head staring at this single page of the specs for the bltouch sensor wondering if id ever understand it. lol       your help is greatly appreciated       cant wait to see how this all works out.
> 
> one thing i was wondering about is a way to mount the sensor and a good location so that its close enough to the nozzles and not cause any issues with clearance around it.    i searched all over for a printable bltouch mount for the FFCP but couldnt find one anywhere.  i did however come up with my own mount for the sensor and a good location for it..(i think it is a good place at least) i will take a few photos of how i have it mounted and maybe u can let me know what ya think on it.. note that i have not yet set the height of the sensor. and the sensor needle is about 1.5 inches away from the first nozzle head.. is that to far away?    thanks    
> 
> stupid thing isnt uploading the pics so here r my dropbox links to the pics sorry for that.
> https://www.dropbox.com/sc/4lk96bafw...vLNfVnyFN43v7a
> https://www.dropbox.com/sc/qs260utg7...Nqy2HnhDzkiTha
> https://www.dropbox.com/sc/hytme0noh...Xn-vkQ-OWxHSSa


The info I got from BLTouch recommend to position the sensor needle at least 15mm from the nozzle, that does not mean 1.5 inches (38.1mm) will not work, most likely not as effective, also the base of the sensor body needs to be 8.3mm (+/- 0.2mm) above the nozzle tip. I suggest you should make or print a block that is 8.3mm in height to be used to set the sensor height.

My plan is to remove the left extruder (I normally only use the right extruder) this will make space to mount the sensor closer to the right extruder nozzle. I'm planning to design the sensor mount so it's easy to install and uninstall should I ever need to use the left extruder.

----------


## originalt80

oh yeah duh i didnt even think to look at that info for the 15mm distance lol.. but yes i know about the 8.3mm abpove nozzle tip and i have already printed the block to use for setting the height i just never did it yet cause i didnt even know if it was a good place to put the sensor or not.. im a rookie at this bare with me please  :Smile:       but yeah since i am aa newbie to 3d printing i havent even began to learn about printing with both extruders together so i just been using the left PLA printing and the left for ABS printing so really your plan for removing the 2nd is about the best way to go about it.. i will just follow how you install it.. if that is ok with you of course?? maybe once u get your mount design completed u could possibly share the design.  that would be wonderful..   thanks again for all your help

----------


## ejcruz

> with this sensor it uses Z axis to compensate for slight changes in the bed..   someone more knowledgeable can explain it better


My understanding is that the firmware will control the adjustment using the Z-Axis. Before actually starting the print a probing sequence is activated to measure the Z-Axis height on each of the three leveling points, if any of these measurements are outside of the specified height (user defined) the printer will stop and display an error message and will not print, however if the height measurement is within the specified height, the firmware will store these new height measurement in memory and compensate accordingly during the print - this means when you set the layer height at 0.20mm and the sensor probing measures the nozzle height at 0.30mm, and 0.30mm is within the specified height, then the firmware will compensate by lowering the Z Axis 0.10mm during printing. NB. once the probing is completed, the sensor is not used or accessed until you start a new print - the firmware will automatically disable auto-levelling on completion of the print.

As for the BLTouch sensor, it has two sets of wiring, a three wire set which needs to be connected to any servo connection points on FFCP board, and a two wire set which needs to be connected to the Z-MIN connection point because this will allow you to use G_CODE like M131 A to probe point 1, M131 B probe point 2, M132 AB activate auto-leveling, M280 P0 S10 push the sensor pin down. So when you send the G_CODE M280 P0 S10, the firmware sends that code to Z-MIN socket, and because the two wire set of the BLTouch is connected to this socket, the internal program of BLTouch will activate the sensor solenoid to push the sensor pin down.

As mentioned in the first post of this thread you must run Sailfish V7.7 release 4.7, when I checked my FFCP I was running V7.7 release 4.2, so I upgraded my firmware.

Hope this helps

----------


## jfkansas

Ya, not really. I just don't get the benefit. lol  You can't call it auto leveling if it is just measuring is the problem I have with it. 

Seems like a lot of work to not really gain any functionality over the z limit switch and a little manual knob turning.

----------


## originalt80

> Ya, not really. I just don't get the benefit. lol  You can't call it auto leveling if it is just measuring is the problem I have with it. 
> 
> Seems like a lot of work to not really gain any functionality over the z limit switch and a little manual knob turning.


well if you have a problem with it then stick with what u do now if that works for you. those of us interested in using the feature will use it.  :Big Grin:

----------


## jfkansas

> well if you have a problem with it then stick with what u do now if that works for you. those of us interested in using the feature will use it.


Lol, just trying to get what all this work does or does better than a mechanical switch. I'm all for a truly dynamic full auto leveling if it actually does what is says it do.

----------


## ejcruz

Good news, Flashforge today (27th August) confirm the connection as per the attached image will work.
https://photos.smugmug.com/3D-Printe...ch-FFCP-XL.jpg

Originalt80 you can test by sending the following g-code:
M280 P0 S10 ; sensor pin down
M280 P0 S90 ; sensor pin up

Thank you.

----------


## originalt80

> Good news, Flashforge today (27th August) confirm the connection as per the attached image will work.
> https://photos.smugmug.com/3D-Printe...ch-FFCP-XL.jpg
> 
> Originalt80 you can test by sending the following g-code:
> M280 P0 S10 ; sensor pin down
> M280 P0 S90 ; sensor pin up
> 
> Thank you.


gladly but can u suggest what software to use for sending the g-code?
i have the following:
 ReplicatorG (included with prointer)
Simplify3D
Printrun-Win-Slic3r-03Feb2015 -- Pronterface
arduino-1.6.9-windows
Flashprint

as stated i am a newbie so if u can point me in the direction where i enter the gcodes to send it would help..   this is all new to me sorry.  i will gladly test anyway i can

----------


## ejcruz

You need to connect your PC via USB connection to FFCP, then:
1. run Simplify3D
2. Click on *Tools* and select *Machine Control Panel* 
3. Normally Simplify3D will automatically connect to FFCP, if not then click on the *Connect* button
4. Click on the tab *Communication*
5. In the dialog box next to the *Send* button (bottom of the page) type the g-codes
6. Click the *Send* button
You should see the BLTouch pin head go up and down when you send the g-code

----------


## originalt80

sorry for the delay   i did i per your instructions but the screen im simplify3d says "this printer only supports binary commands" and nothing happens

is there a way we could communicate via instant messaging possibly?

----------


## ejcruz

Apologies just remembered Simplify3D does not support ascii  commands to FFCP, so you need to use ReplicatorG as follows:
1. Connect PC/Laptop to FFCP
2. Run ReplicatorG
3. Click File select New (this will ensure nothing is loaded)
4. Type the following g-codes:
G162 X Y F3000 ; home XY just to confirm FFCP is receiving the codes
G1 X-60 Y-50 E0 F1000 ; move the extruders back out
M280 P0 S10 ; sensor pin down
M280 P0 S90 ; sensor pin up
M280 P0 S10 ; sensor pin down
M280 P0 S90 ; sensor pin up
5. Click the second last icon from the left - connect option
6. Click the first icon on the right  - build option that will send the g-codes direct to FFCP
7. A message may appear saying ReplicatorG doesn't recognize gcode M280
8. Click Proceed anyway

Hopefully you will  see the sensor pin go up and down.

If it doesn't and the extruder moves, then I will need to get in touch with the BLTouch people about what g-code to use with Sailfish.

Found this g-code which you can try if the M280 P0 S10 doesn't work.
M300 S10 ; sensor pin down
M300 S90 : sensor pin up

----------


## originalt80

Ok well i tried and it all steps did as described to but no pin movement at all. i tried both M280 & M300 gcodes neither moved pin.

as soon as i power on the printer the bltouch lights up and selftests (pin dn, up, dn, up) itself immediately. so i assume it must be the correct wiring config but sending of gcodes is doing nothing.       

anything other ideas for me to test let me know.    i will continue searching for info

----------


## ejcruz

OK thank you orginalt80, I'm waiting for the BLTouch people to send me the necessary g-codes, will let you know as soon as I receive it.

----------


## originalt80

ok sounds good   
and not a problem you are welcome 

Thank you as well

----------


## Mjolinor

I haven't followed this thread but I do know that my CNC mill that runs marlin will not respond to any autolevel commands until after it has homed X and Y.

If I could be bothered I would read back and see if that may be your problem but being a  lazy git I cba and leave it in your capable hands.  :Smile:

----------


## originalt80

i found this info about sailfish firmware but not sure if its useful at all but here are the links

https://github.com/jetty840/
http://www.auelectronics.com/forum/index.php/topic,524.0/wap2.html

maybe it can help maybe not

----------


## ejcruz

I received the BLTouch sensor and must say it's very compact and should fit nicely in the left extruder space, apart from this if you connect a +5VDC to the sensor it will auto do a self test - led light on, pin will go down and up and then remain up with the led light on, with only a +5VDC connected you can lower the pin with your finger and the led light will go off, push the pin up will active the led light.  
I have bad news, this sensor is controlled like a servo and therefore needs to be connected to a servo connection point on the FFCP board, Flashforge are unable to tell me which connection point(s) is/are servo if any is available on the FFCP board, ANTCLABS who is the manufacturer of the BLTouch sensor also don't know because they don't have a FFCP board. I guess I shouldn't be surprise because FFCP looks like a copy of the Makerbot Replicator because when you look at the Makerbot schematic it fits the FFCP. 
Not only do we need a servo connection point on the FFCP board, we also need to know the G-Code to access the servo point. The G-Codes depends on the firmware, now this is where it can get very confusing, one would think it would be relatively easy to get a list of G-Codes for the firmware you are using, if anyone have a list of G-Codes for ReplicatorG(Sailfish) firmware please post here, if you search the internet be warn the G-Codes can be convoluted. I've tried with no success using M280, M340, M300, M301. ReplicatorG does not recognize M280/M340, and reports an error about pen plotter when using M300 and M301. 

The only possible servo connection on the FFCP board as per the Makerbot Replicator schematic, is the PB7 point which according to the ATmega 2560 processor documentation is a PWM (Pulse Width Modulation) point - PWM is required to drive a servo. Further supprise there are two points on the FFCP board marked PB7 (I've tested it and they are not connected).

The light at the end of the tunnel is very dim.

----------


## originalt80

that is very upsetting to hear... especially that the ANTCLABS said they dont know because they checked and verified for me that the BLTouch will indeed work with this printer & setup.. i am going to contact them about this cause i was iffy on if i should get it or not but the said it will work so i ordered it.  i wouldnt have wasted the month waiting to recieve the touch and all this time trying to set it up if i had known this.        thanks for your findings tho 

is there any way the board can be replaced with a compatible one and still function as needed in the FFCP with out being a pain in the a$$ to do?  just curious

----------


## ejcruz

> is there any way the board can be replaced with a compatible one and still function as needed in the FFCP with out being a pain in the a$$ to do?  just curious


I wouldn't recommend it, I think overall it would be cheaper and less headache to just buy a new compatible printer.

I'm still searching for a g-code to access PB7 connection point.

----------


## originalt80

well i just got the FFCP recently about less then 2 months ago so a new compatible printer will have to wait. just have to stick with manual leveling for now.  
hopefully something pops up on how to access the PB7 point

----------


## Geoff

You guys use autolevelling on the flashforges? I just use the thumbscrews..  :Smile:  I only really bother with beds that are fixed to the frame, like Delta's, i'd be interested to see if it makes that much of a difference (unless you are mesh levelling, then yeah it probably would)

----------


## warkmal

> I wouldn't recommend it, I think overall it would be cheaper and less headache to just buy a new compatible printer.
> 
> I'm still searching for a g-code to access PB7 connection point.


Sailfish doesn't actually know any g-code.  All g-code gets translated into x3g protocol before being sent to the printer.  You can look for what you need in the x3g protocol: https://github.com/makerbot/s3g/blob...s3gProtocol.md

I'm afraid you won't though because I can't think of any PWM you can command directly through x3g.  There is PWM in the firmware, but they're indirect.  That is they're commanded by the firmware to achieve a goal (like heat the bed or make the LEDs a color).

You could write in your own bit into sailfish (that's what ZYYX did for their autolevel feature), but if it needs a new x3g command that could be problematic for compatibility.

----------


## warkmal

BTW, what does the servo control actually need to do?  IE, what's a typical gcode sequence on a printer that supports it?

----------


## jfkansas

> BTW, what does the servo control actually need to do?  IE, what's a typical gcode sequence on a printer that supports it?


I think nothing. lol   I think these guys are realizing what I posted about 3-4 days ago about why all the electronic sensor stuff. It really isn't doing anything to "auto level"...

----------


## ejcruz

The BLTouch sensor works on the principle of a servo, it has a built-in program that will interpret the servo command like move servo arm 10 degrees to mean pull the pin up or 90 degrees means push the pin down, hence the need to connect the BLTouch to a servo connection point.

I've been in touch with Dan Newman who is one of the programmers for Sailfish and he has confirmed that Sailfish DOES NOT support servos (now I know why my servo was acting erratically) hence the BLTouch sensor will not work, Sailfish supports ON/OFF sensors such as Inductive Proximity type which must be connected to the Z-MIN. So it's back to the Inductive Proximity sensor.

----------


## Roxy

> I've been in touch with Dan Newman who is one of the programmers for Sailfish and he has confirmed that Sailfish DOES NOT support servos (now I know why my servo was acting erratically) hence the BLTouch sensor will not work, Sailfish supports ON/OFF sensors such as Inductive Proximity type which must be connected to the Z-MIN. So it's back to the Inductive Proximity sensor.


I would bring up Marlin!

----------


## ejcruz

> I would bring up Marlin!


I'm just curious to see how well auto-leveling works with FFCP. :Confused:

----------

