-
-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Another homing issue #336
Comments
Hi @Zjokkeh, It looks like a movement direction management problem... as if the output pin that defines the direction of movement for the stepper motor driver does not work... Apart from the homing function, do the motors all work in both directions and without inversion? Did you reset the flash memory with the @++; |
Hey, Do you have dual endstops, or just one per axis? |
Hey @Zjokkeh, I would try the following: Just for testing, connect two switches with a short cable directly to the Ramps board, and try if you can trigger them manually while homing. On the first glance I didn't notice anything, but I will compare my config to your's when I'm at home. Cheers |
I will try that with the switches. Just a remark: when i disconnect a switch and do the homing It goes completly bad. Only 1 motor turns and in the opposite direction!!! Table is 150 x 150 |
I'd say thats quite a strange behaviour for NO (=normally open) switches, since disconnecting a NO switch would just mean, that it is never triggered and homing would search for it until it reaches the max_travel value... So with disconnected switches, homing should travel towards the switches and not the other way round! By the way... your pulloff distance is much too high. Some mm are quite enough! I'm alright with the standard value - 5mm or so... With disconnected (or short) switches, the homing direction has to be towards the switches!! (You have to adjust $23 for that) Good luck! :) |
I did some late night testing, but with no result. Tested the switches with a multimeter and they work perfectly. Connected switches directly to the ramps board with no difference. And I forgot to mention that I first tested the system with the mpcnc marlin software for dual axis autosquare and it worked just fine then... Same setup only NC for the marlin... |
Hi @Zjokkeh, Does your limit switches are on the max side or on the min side ? @++; |
Tried both. Max, min, reverse, everything that I could think off... |
Hm, sounds quite difficult... I think your axis and homing definition in the config should be okay (Assuming you did not change anything else). BUT I don't think these settings are causing your actual problems... The question is, how to nail down the problem. Did you correct your homing direction? (Without switches connected it should drive in the direction towards the switch - both sides!!) Finally, I'm not getting tired to tell about interferences with limit switches escpecially when you run the wires next to the motor current. (But this was the test with the extra short cable switches...) That's all I can think of at the moment. Maybe it is an idea to start new with a fresh installation of grbl-mega-5x in case you changed something different? ;) Cheers Raphael |
So, I installed grbl on a brand new mega. Thats all I can think off... |
That's odd. Especially the alert on homing without switches... It really should work like this. 😢 @fra589: Is there a possible other reason for the ALARM8? At the moment I'm out of ideas... |
I started with NC because I wanted to switch between marlin and grbl with minimum effort. But gave the same result. |
Hi @Zjokkeh,
Maybe you shouldn't try too many things at once...
This what I needed to know 😄 If you also plane to use Z limit switch on Z-, the value should be 31 (binary &b00011111) and not 27 (I don't see the Z homing definition in your config.h file).
This is not good because of your wrong Homing dir invert mask... You also have an error in your parameter:
$134 should be 200.000, the same value of $132 because it's a clones axis. With good parameters, the $H command do:
Warning! When the homing switch pull-off distance ($27) is greater then the max distance of axis, an Alarm 10 is triggered. This is the case in your config.txt file. @++; |
Do you mean by switching the coil wires from the steppers to adjust the motor direction? If I do this. The homing is in de min direction. The switches still don't work and the jogging is switched around... |
You can switch the coils wires or adjust the step direction invert mask ($3) to have motors running to the right homing direction...
Perhaps it's the jogging command which is false... |
soft limits enabled gives ALARM 15 after some jogs. |
Clarification concerning the hypothesis of a wrong Jogging command: |
ALARM 15 does not exist??? When using positive machine coordinate destination, the alarm should be ALARM 2 (Soft limit alarm). |
Yes, error: 15 is the normal behavior with destination movement outside of machine enveloppe. What is the output of the |
[19:06:17] [ ? ] <Idle|MPos:0.000,0.000,0.000,0.000,0.000|FS:0,0> [19:06:43] [ $# ] [PRB:0.000,0.000,0.000,0.000,0.000:0] |
You're not alone having difficulties with coordinates systems of milling CNC... We will have to add this theme to the wiki...
Your
This mean what I say, there is no working coordinates systems defined in your machine. So, you can only use negative coordinates. When Grbl is started, the positions of each axis is 0 (zero). Once an axis is homed, the the machine origin for that axis is set to the homed position: 0 if the limit switch is on the max side, -max_travel(axis) if the limit switch is on the min side. Example for your case without homing (assuming correct X axis max travel of 1000 mm):
The LinuxCNC documentation is a good place to see details of working coordinates system: @++; |
So I cannot use the auto home function to the minimum side? I am lost here 😂 |
No, you can use it, but with axis moving in the right direction. As your homing doesn't work for now, I told you to disable it ($22=0) in my last post just for the working coordinates systems example. Now, you an re-enable it ($22=1). Anyway, the internal machine coordinate system will always between -max-travel(axis) and 0 for all axes. Whatever the side of the homing. |
[21:14:37] [ $# ] [G54:3.000,0.000,0.000,3.000,0.000] [21:14:37] [ $# ] [G55:0.000,0.000,0.000,0.000,0.000] [21:14:37] [ $# ] [G56:0.000,0.000,0.000,0.000,0.000] [21:14:37] [ $# ] [G57:0.000,0.000,0.000,0.000,0.000] [21:14:37] [ $# ] [G58:0.000,0.000,0.000,0.000,0.000] [21:14:37] [ $# ] [G59:0.000,0.000,0.000,0.000,0.000] [21:14:37] [ $# ] [G28:0.000,0.000,0.000,0.000,0.000] [21:14:37] [ $# ] [G30:0.000,0.000,0.000,0.000,0.000] [21:14:37] [ $# ] [G92:0.000,0.000,0.000,0.000,0.000] [21:14:37] [ $# ] [TLO:0.000] [21:14:37] [ [ PROBE ] ] Probe move ERROR - probe did not make contact within specified distance [21:14:37] [ $# ] [PRB:0.000,0.000,0.000,0.000,0.000:0] |
Sorry for my ignorance. I am new to all of this. Every time I start the machine I should:
Is this correct? Why does marlin for mpcnc work without any fuss? Because it is altered especially for mpcnc? |
Hey, Cheers Raphael @fra589 Thanks for the very detailed excurs on machine coordinates :) |
This is what I want. Why does this not work with my setup??? So: Followed the previous steps by @fra589 I adjust my steps/mm so it is correct You guys are confusing me. Invert not invert, examples I don't need.... Tell me in childs language. Why won't it home? For my understanding. The way it should work is: I power on my machine. Just like marlin. Power on --> homing and squaring to bottom left --> start milling after adjustments. Edit: For this moment if I use the command $HX the homing cycle is: move in de min direction towards the endstops for about 1 cm stops for a second and moves again 1 cm in the same direction. Then stops and no alarm or error. It just stops. The X axis is about in the middle of the travel distance. Normally it should seek the endstop for about 1.5 times the distance of the max axis travell. That should be 1800 mm not 1cm... |
No, it was just an example to illustrate grbl coordinate system (and more generally CNC coordinates systems) with G92 origin positioning. http://linuxcnc.org/docs/html/gcode/coordinates.html Search Google for "cnc coordinate system" and "grbl coordinate system" and "G53 G54-G59 G92 GCode" to have many more info about this. It is essential to understand this to be able to use a CNC milling machine... |
That is the million dollar question. I set up grbl several times on three different machines. |
[12:32:10] [ $$ ] $1=254 ;Step idle delay, milliseconds [12:32:10] [ $$ ] $2=0 ;Step pulse invert, mask [12:32:10] [ $$ ] $3=0 ;Step direction invert, mask [12:32:10] [ $$ ] $4=0 ;Invert step enable pin, boolean [12:32:10] [ $$ ] $5=0 ;Invert limit pins, boolean/mask [12:32:10] [ $$ ] $6=0 ;Invert probe pin, boolean [12:32:10] [ $$ ] $10=0 ;Status report options, mask [12:32:10] [ $$ ] $11=0.020 ;Junction deviation, millimeters [12:32:10] [ $$ ] $12=0.002 ;Arc tolerance, millimeters [12:32:10] [ $$ ] $13=0 ;Report in inches, boolean [12:32:10] [ $$ ] $20=1 ;Soft limits enable, boolean [12:32:10] [ $$ ] $21=0 ;Hard limits enable, boolean [12:32:10] [ $$ ] $22=1 ;Homing cycle enable, boolean (Grbl) / mask (GrblHAL) [12:32:10] [ $$ ] $23=0 ;Homing direction invert, mask [12:32:10] [ $$ ] $24=25.000 ;Homing locate feed rate, mm/min [12:32:10] [ $$ ] $25=250.000 ;Homing search seek rate, mm/min [12:32:10] [ $$ ] $26=250 ;Homing switch debounce delay, milliseconds [12:32:10] [ $$ ] $27=5.000 ;Homing switch pull-off distance, millimeters [12:32:10] [ $$ ] $30=12000 ;Maximum spindle speed, RPM [12:32:10] [ $$ ] $31=550 ;Minimum spindle speed, RPM [12:32:10] [ $$ ] $32=0 ;Laser-mode enable, boolean [12:32:10] [ $$ ] $100=100.000 ;X-axis steps per millimeter [12:32:10] [ $$ ] $101=100.000 ;Y-axis steps per millimeter [12:32:10] [ $$ ] $102=100.000 ;Z-axis steps per millimeter [12:32:10] [ $$ ] $103=100.000 ;A-axis steps per degree [12:32:10] [ $$ ] $104=100.000 ;unknown [12:32:10] [ $$ ] $110=750.000 ;X-axis maximum rate, mm/min [12:32:10] [ $$ ] $111=750.000 ;Y-axis maximum rate, mm/min [12:32:10] [ $$ ] $112=750.000 ;Z-axis maximum rate, mm/min [12:32:10] [ $$ ] $113=750.000 ;A-axis maximum rate, deg/min [12:32:10] [ $$ ] $114=750.000 ;unknown [12:32:10] [ $$ ] $120=50.000 ;X-axis acceleration, mm/sec^2 [12:32:10] [ $$ ] $121=50.000 ;Y-axis acceleration, mm/sec^2 [12:32:10] [ $$ ] $122=50.000 ;Z-axis acceleration, mm/sec^2 [12:32:10] [ $$ ] $123=50.000 ;A-axis acceleration, deg/sec^2 [12:32:10] [ $$ ] $124=50.000 ;unknown [12:32:10] [ $$ ] $130=1200.000 ;X-axis maximum travel, millimeters [12:32:10] [ $$ ] $131=1200.000 ;Y-axis maximum travel, millimeters [12:32:10] [ $$ ] $132=1200.000 ;Z-axis maximum travel, millimeters [12:32:10] [ $$ ] $133=1200.000 ;A-axis maximum travel, degrees [12:32:10] [ $$ ] $134=1200.000 ;unknown These are my settings for this moment. If I want to jog left or right for 0.1mm I get the error 15 that I exceed the machine travel. How is this possible? My max travel is about 1200 mm so my settings are right, not? Small update: The Z axis homing works fine. Goes to the switch, pulls off. Goes slowly back to the switch again and then goes back and stops. Then when it is the X axis turn, axis moves 1cm stops and gives alarm 8. Any thoughts? |
I believe its noise on the cables to the switches. If I use something longer than a 20cm dupont wire to the switches grbl thinks the switches are closed. Is there a solution for this? |
That was my intention with
and
I always had this interference problem - now, I'm running 24v through my switches. Not a very satisfying solution, I know... Cheers Raphael |
ah yes... I tried everything, with external pullups and noise gates /filters and... and.... |
The creator of marlin must have encounterd this problem also and perhaps he found a superb solution for the noise problem. I will try the relay board way, I have some laying around I should look for it. Anyway I am so glad I found this problem, and the solution was right there in the beginning. Thanks a lot for helping me out. Perhaps an idea to put this noise issue in the wiki? |
Here is the Grbl's machine coordinate: (I talk only about X and Y to simplify explanations, but it the same behavior with all axis)
Do the same for Y in negative direction:
At power on or reset, Grbl can't know the real position of axes, so they are initialized to 0 (zero) whatever their real positions. To make the true limits of the machine coincide with those of Grbl, homing is necessary.
You say that you want to have homing at min side (I assume also z-)... When homing to the negative direction, when the limit switch of an axis is triggered, it's coordinate is initialized to -max_travel (negative value). This mean that soft limits will be the same for Grbl: between -max_travel and 0. To test the homing configuration independently of a possible hardware problem, I advise you to shortly connect simple normally open switches between limits pin and the ground. Then:
If it manually work and it don't work with your reals switches on your machine, it will be the proof of hardware problem. @++; |
With the relay board it works indeed. Just a small question: shouldn't the steppers keep being powered after the homing/squaring to keep them in position? Just like in marlin? |
Tnx man, I should learn how to read... |
Hi,
I am trying for several hours now to get the homing working without any luck. I have read all the previous issues and I can't find a solution.
I have a 5 axis machine with dual X and dual Y (mpcnc). The switches are NO and working fine. They show op perfectly in the status rapport.
The only thing I noticed is when I increase the pull-off distance $27 the axis will keep on going longer after the switches are reached. I looks like he doesn't pull-off but keeps on going. After a while I get an alarm 8 from grbl see attachment.
My version:
[16:17:59] [ $i ] [VER:1.2h.20220109:]
[16:17:59] [ $i ] [AXS:5:XYZXY]
[16:17:59] [ $i ] [OPT:VNMGH,35,255,24]
[16:17:59] [ $i ] ok
grbl-settings-backup-2023-06-05-d.txt
config.txt
The text was updated successfully, but these errors were encountered: