Benbox Laser Machines/CO2 Lasers/3D Printers

Software => T2 Engraving => Topic started by: Kunaphil on January 01, 2017, 12:42:12 PM

Title: Home switches
Post by: Kunaphil on January 01, 2017, 12:42:12 PM
Again, as a total newbie I am trying to get my head around home switches. Can anyone tell me how to make this work and how to mount them on a A5.  I am running Zax's t2 software with his latest grbl.

Thanks again,

Phil
Title: Re: Home switches
Post by: Zax on January 01, 2017, 12:51:03 PM
Connect 2 switches (1 each for X and Y-axis) in parallel to D9, enable homing in T2Laser and you're all set.
Title: Re: Home switches
Post by: Kunaphil on January 01, 2017, 12:53:39 PM
Wow,  that's easy.

Thanks Zax!
Title: Re: Home switches
Post by: Zax on January 01, 2017, 01:03:54 PM
It is, and well worth doing. To be honest I can't believe they don't include them, oh... yeah, Benbox doesn't support homing so why would they.
Title: Re: Home switches
Post by: Kunaphil on January 01, 2017, 01:08:55 PM
Do you wire the switches NO or NC?
Title: Re: Home switches
Post by: Zax on January 01, 2017, 01:27:37 PM
NO (Normally Open), so when either one activates it closes the circuit.
Title: Re: Home switches
Post by: ThothLoki on January 01, 2017, 02:06:48 PM
Zax, do you have them on your engraver? If so, can you post a pic?
Title: Re: Home switches
Post by: Zax on January 01, 2017, 02:14:22 PM
I did but removed them a couple of days ago as I want to print some new brackets. I had just tie wrapped them on temporarily (which ended up being several months).

I've been looking for the right mount so would also be interested in what others have done.
Title: Re: Home switches
Post by: ThothLoki on January 01, 2017, 02:40:55 PM
What kind of switches are you using? Just micro switches?
Title: Re: Home switches
Post by: Zax on January 01, 2017, 02:55:08 PM
Yes, I will probably switch to some smaller ones like those on my 3D Printer.
Title: Re: Home switches
Post by: Kunaphil on January 01, 2017, 03:51:40 PM
If anyone has some brackets, I have access to a 3D printer......
Title: Re: Home switches
Post by: ThothLoki on January 01, 2017, 03:57:51 PM
If anyone has an extra 3D printer, I take donations.  :P
Title: Re: Home switches
Post by: Kunaphil on January 01, 2017, 04:27:30 PM
Why wouldn't you use D9 and D10 for the limit switches?
Title: Re: Home switches
Post by: Zax on January 01, 2017, 04:34:45 PM
The L6 and L8 boards have separate pins for the switches but both are routed to D9, so it was decided to make that the "standard" as it minimizes wiring.

You can use D9/10 if you like, just compile the firmware for your preferred configuration.
Title: Re: Home switches
Post by: Marcel on January 08, 2017, 07:41:18 PM
I had my plotter that way till I changed to the laser head   and it homed like my cncs i used to run the went up to zero then the x&y went home simultaneously.  not sure which I like better.
My mach 3 on my desktop mill works like this setup  homes each axes separately
Title: Re: Home switches
Post by: Zax on January 09, 2017, 06:34:14 AM
My CNC homes Z, X and Y sequentially so I guess it seemed "normal" to me and you typically only do it once per session and it doesn't take but a few seconds.

It makes the wiring and connection easier so that's why we kept it.
Title: Re: Home switches
Post by: ggallant571 on January 09, 2017, 06:56:07 AM
The last Grbl code I looked at (0.9) supported both schemes. What does you controller support?
Title: Re: Home switches
Post by: beikeland on January 09, 2017, 04:06:33 PM
The only reason not to save time and home all axis simultaneous is to prevent collisions; on the laser that should be unlikely - or to save I/O.

My CNC homes Z first to clear the work space then X and Y simultaneous to save time. Had I had a tool changer or other fixtures that would be a potential collision, then the sequence would have taken that into account.

The laser does X and Y simultaneously.

The delta style 3D printer does all three simultaneously.

But if you're not in a hurry there is nothing wrong with doing it sequentially; although it quickly adds up, then again maybe i'm too much of a home boy
Title: Re: Home switches
Post by: Lob0426 on January 10, 2017, 12:49:54 PM
The basic way to home is using one pin, D9, this means you can only "test" one axis at a time. This was caused by the boards that are supplied by Eleks Maker that tied all "homing" to D9 by hardware. Specifically the L6/L8 boards.

Grbl does not restrict homing to only one pin. In fact grbl assumes a different pin for each axis. This requires a separate wire set for each axis. The single pin method allows a single wire parallel wiring, which is simpler.

D9, D10 and D12(Z) (D11 in grbl 0.8 and lower) are reserved for homing/limits.

For CNC use you always raise "Z" axis first. This is reflected in grbl's default homing settings. It "tests" Z first then tests X and Y simultaneously. This is to prevent damaging the work, or the spindle, during a homing operation. My 3D printer homes X and Y then Z. Not a problem unless you have unfinished work on the table. Properly they should raise Z, a determined amount, before X and Y movement. CNC usually homes to the top of travel, 3D printers home to the bottom, the table. My Laser machines only home X and Y, each separately.

To "home" Z there are two grbl methods that could be used. Homing Z would be running the laser module to a predetermined point by switch placement. Then you would set, through gcode, your distance to the cut in the work piece. The other would be to use the "probe" function of grbl to determine the height of the work and then raise the Laser to the correct distance.

Limits "tests" cause an alarm and stop all movement of all axis, spindle and coolant. "Soft" limits take effect when the travel reaches a particular axis maximum allowed distance as defined by EEPROM settings. Hard limits act the same but are tripped by switches rather than by distance. Grbl cannot test the "area" by hitting the switches. It only responds to home switches and Soft or hard limits.

You do save time by homing simultaneously. This only matters if you are using homing a multitude of times during a single session. On larger machines you would probably want simultaneous homing. On an A5 size machine it really does not make that much difference.
Title: Re: Home switches
Post by: ggallant571 on January 10, 2017, 01:12:08 PM
I am using my DLCM board with homebrew STM32 firmware. It has separate header pins for each switch. Found that the little boards holding the switches fit the slots on the outside of the rails. Needed to add spacers to align with and make sure the solder/pins do not touch the rails. Looks like I should design a 1mm spacer plate and cut on laser.
Title: Re: Home switches
Post by: Lob0426 on January 10, 2017, 03:15:34 PM
You can do simultaneous or individual homing of X,Y with separate pins also. Just separate the default X and Y axis movement into two lines and make the last a higher sequential number.

example;
This; #define HOMING_CYCLE_1 ((1<<X_AXIS)|(1<<Y_AXIS))  // OPTIONAL: Then move X,Y at the same time. simultaneous

To this; #define HOMING_CYCLE_0   (1<<X_AXIS)     // OPTIONAL: move X,Y separately.
            #define HOMING_CYCLE_1   (1<<Y_AXIS)     // OPTIONAL: Separate movement
cpu_map does not need to be changed!

Default 3 axis grbl setting, separate pins;
config.h;
// NOTE: Defaults are set for a traditional 3-axis CNC machine. Z-axis first to clear, followed by X & Y.
#define HOMING_CYCLE_0 (1<<Z_AXIS)                // REQUIRED: First move Z to clear workspace.
#define HOMING_CYCLE_1 ((1<<X_AXIS)|(1<<Y_AXIS))  // OPTIONAL: Then move X,Y at the same time.
// #define HOMING_CYCLE_2                         // OPTIONAL: Uncomment and add axes mask to enable
cpu_map;
// Define homing/hard limit switch input pins and limit interrupt vectors.
  // NOTE: All limit bit pins must be on the same port, but not on a port with other input pins (CONTROL).
  #define LIMIT_DDR        DDRB
  #define LIMIT_PIN        PINB
  #define LIMIT_PORT       PORTB
  #define X_LIMIT_BIT      1  // Uno Digital Pin 9
  #define Y_LIMIT_BIT      2  // Uno Digital Pin 10
  #ifdef VARIABLE_SPINDLE // Z Limit pin and spindle enabled swapped to access hardware PWM on Pin 11.
    #define Z_LIMIT_BIT      4 // Uno Digital Pin 12
(shown as these are default NANO settings cpu_map is quite different for Mega2560)

single pin 2 axis example. What most of the firmwares are set for our machines;
config.h;
// NOTE: Z axis is commented out. X and Y axis are ran sequentially. pin assign has to be changed in cpu_map.
//  #define HOMING_CYCLE_0 (1<<Z_AXIS)   // Commented out
#define HOMING_CYCLE_0   (1<<X_AXIS)     // OPTIONAL: Then move X,Y at the same time.
#define HOMING_CYCLE_1   (1<<Y_AXIS)     // OPTIONAL: Uncomment and add axes mask to enable
cpu_map;
// Define homing/hard limit switch input pins and limit interrupt vectors.
  // NOTE: All limit bit pins must be on the same port, but not on a port with other input pins (CONTROL).
  #define LIMIT_DDR        DDRB
  #define LIMIT_PIN        PINB
  #define LIMIT_PORT       PORTB
  #define X_LIMIT_BIT      1  // Uno Digital Pin 9
  #define Y_LIMIT_BIT      1  // Uno Digital Pin 9         "CHANGED FOR SINGLE PIN"
  #ifdef VARIABLE_SPINDLE // Z Limit pin and spindle enabled swapped to access hardware PWM on Pin 11.
    #define Z_LIMIT_BIT      4 // Uno Digital Pin 12

2 axis separate pins, no changes to cpu-map. simultaneous homing;
config.h;
// NOTE: Defaults are set for a traditional 3-axis CNC machine. Z-axis first to clear, followed by X & Y.
//#define HOMING_CYCLE_0 (1<<Z_AXIS)                // Comment out
#define HOMING_CYCLE_0 ((1<<X_AXIS)|(1<<Y_AXIS))  // the homing cycle must be changed to 0
// #define HOMING_CYCLE_2                         // OPTIONAL: Uncomment and add axes mask to enable

<q>I am using my DLCM board with homebrew STM32 firmware. It has separate header pins for each switch. Found that the little boards holding the switches fit the slots on the outside of the rails. Needed to add spacers to align with and make sure the solder/pins do not touch the rails. Looks like I should design a 1mm spacer plate and cut on laser.</q>
I will be interested to see what you come up with!
Title: Re: Home switches
Post by: nExoDus on January 13, 2017, 07:08:17 AM
Hat schon jemand der deutsch spricht Home Switches eingebaut? Über eine Info wäre ich dankbar...
where i have to connect the switches D9 and Ground or VCC?