Author Topic: Home switches  (Read 831 times)

Zax

  • T2Laser
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4007
    • View Profile
    • T2Laser
Re: Home switches
« Reply #15 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.

ggallant571

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1326
    • View Profile
Re: Home switches
« Reply #16 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?
SARCASM - Just one more service we offer here.

beikeland

  • Guest
Re: Home switches
« Reply #17 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

Lob0426

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1492
  • Let the Magic Blue Smoke out!
    • View Profile
    • Richards RasPi Web Server
Re: Home switches
« Reply #18 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.
Richard
A5 2.5W w/homing switches on L7
A5 2W diode self upgraded from stock 500mw

Experimenting with Mega2560 board upgrade

ggallant571

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1326
    • View Profile
Re: Home switches
« Reply #19 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.
SARCASM - Just one more service we offer here.

Lob0426

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1492
  • Let the Magic Blue Smoke out!
    • View Profile
    • Richards RasPi Web Server
Re: Home switches
« Reply #20 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!
« Last Edit: January 10, 2017, 03:19:31 PM by Lob0426 »
Richard
A5 2.5W w/homing switches on L7
A5 2W diode self upgraded from stock 500mw

Experimenting with Mega2560 board upgrade

nExoDus

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Home switches
« Reply #21 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?
« Last Edit: January 15, 2017, 10:16:40 AM by nExoDus »
DIY LelksMaker Laser 2,5 W
NeJe mini Laser Engraver