Z-Axis Wants to Home Even When Homing is Turned Off #590
-
I'm updating the electronics in an existing machine which currently uses an old 68HC11 MPU (now virtually obsolete) and even older stepper motor drivers. The machine has a rotating head (+/-20*) that has an embedded linear Hall sensor for position. The sensor outputs 5V when the head is rotated one way, 0V when rotated the other way and 2.5V in the center. The values are approximate and vary from machine to machine but are consistent for a given machine. I need to be able to home this rotator to the middle position, but obviously grblHAL can't use this sensor as a limit switch. The electronics I've designed has two MCUs, both STM32F411, one for grbl and the other for the user interface (UI) and other functions of the machine and sends G-codes to control the machine through the grbl MCU. I want to use the UI MCU to 'manually' home the rotator (on the Z-axis) by issuing G-codes and reading the Hall sensor to step the head in the correct direction to home it at the mid-point. If someone has a better idea to do this, I'd be happy to hear about it. I haven't even gotten to the part of 'jogging' the rotator as I described above because of this problem: After power up or hard reset, any G0 code sent to the Z-axis causes the rotator to move in the same direction for a certain 'distance' then stop. After this is done, G-codes sent to that axis work as expected. Unfortunately, the distance moved in this apparent 'homing' action exceeds the mechanical limits. If I send G-codes to the X or Y axes, they move as expected. This problem only occurs on the Z-axis. I have homing turned off. This is a custom board and I'm compiling a copy of grblHAL I cloned in March 2024 (signs on as "grblHAL 1.1f"). I have modified the my_machine.h file with these changes (uncommenting these lines): #define BOARD_MORPHO_CNC // For use with Nucleo-F411RE and F446RE boards. Work in progress.#define TRINAMIC_ENABLE 2209 // Trinamic TMC2209 stepper driver support.#define TRINAMIC_R_SENSE 110 // R sense resistance in milliohms, 2130 and 2209 default is 110, 5160 is 75. I have modified the st_morpho_map.h file to reflect the pinout configuration of my board. Too big to post here, but can provide it if needed. It seems to me grbl needs to home the Z-axis even though I have homing turned off. Not so for the X and Y axes. I have re-built the firmware and flashed the MCU a couple of times, but the problem persists. Have I configured something incorrectly or is this the way grblHAL works (or is this a bug?)? Thanks in advance for any help. Craig. This is a listing of my settings: $0=10.0 |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 10 replies
-
Is there an offset active for Z? |
Beta Was this translation helpful? Give feedback.
-
Thanks for the suggestion. Nearing bedtime here so I'll give it a try tomorrow. |
Beta Was this translation helpful? Give feedback.
-
There were no offsets active at the time. This situation with the Z-axis occurs after a power up or hard reset. I switched to relative moves with G91 and the Z-axis moved correctly with a G0Z command and didn't race off to the distant coordinate. I can work with the Z-axis now. It's interesting that the X and Y axes didn't need to be in the relative move state, right after reset they responded correctly with G0 commands and didn't race off. I don't consider the discussion closed yet as there doesn't seem to be an explanation for the Z-axis behavior. I'll play with this and see what happens. Will keep you posted. Thanks for your help. Craig. |
Beta Was this translation helpful? Give feedback.
-
Why not? If you add some electronics (e.g. an analog window comparator) it should be possible?
What is the input used to determine the center point? Via a sensor or via human observation?
The tuning is the biggest hurdle, for one off machines I cannot recommend sensorless homing. I guess it is ok for mass produced machines if the manufacturer is willing to spend time to tune it up. FYI you may enable further tuning parameters uncommenting this line. Currently these will be applied to all motors.
Perhaps. FYI there is an untested compile time option that allows reducing the acceleration during homing. ioSender has a Trinamic tab that can be used for tuning the stallguard setting. BTW which version (build date) are you using now? |
Beta Was this translation helpful? Give feedback.
-
Getting back to the reason I started this discussion on Sept 26, I think I've found the answer. After some more investigation I found that after going through a homing cycle the machine coordinates were all set to zero. Not so for the work coordinates which set X and Y to zero but Z to 75. It now makes sense that any absolute move less than 75 on the Z axis would cause the runaway move I was seeing. I was making move much less than 75. When I sent a G92X0Y0Z0 command after homing, the work coordinates were all set to zero and the runaway move problem no longer occurred. Grbl is now responding as I would expect and my machine is making the correct motions. Is the setting of the Z axis to 75 in the work coordinates by grbl intentional? I assume this may be so that the spindle is moved away from the work piece to avoid collisions. Have I possibly caused further problems by sending this G92 command? Please forgive my ignorance, I have virtually no experience with grbl, G-codes and the CNC machine world. |
Beta Was this translation helpful? Give feedback.
Getting back to the reason I started this discussion on Sept 26, I think I've found the answer. After some more investigation I found that after going through a homing cycle the machine coordinates were all set to zero. Not so for the work coordinates which set X and Y to zero but Z to 75. It now makes sense that any absolute move less than 75 on the Z axis would cause the runaway move I was seeing. I was making move much less than 75. When I sent a G92X0Y0Z0 command after homing, the work coordinates were all set to zero and the runaway move problem no longer occurred. Grbl is now responding as I would expect and my machine is making the correct motions.
Is the setting of the Z axis to 7…