Hi,
for some time I´ve been working with a X/Y/Z edge finder like this and it worked
Now I bought this little thing in order to be able to change a tool during machining a job:
!IMG_5872
Seems “G43.1 Dynamic tool length offset” is a subject here. In other forums they use some scripting language to calculate “old” and “new” offset and tell GRBL to use the difference. But with current GRBL and ESP32 web interface?
It´d be nice to
* home X/Y/Z
* use a the aluminum plate to find G54
* start with tool #1
* move to tool change position
* measure (whatever that means) the new tool
* go on with machining
Or am I on the wrong track?
评论 (7)
#2 – bdring 于 2020-07-26
Yes,
Look at how reporting.cpp reports these values.
#3 – JensHauser 于 2020-07-27
While learning C and how to Esp32JH/blob/master/GrblEsp32/Machines/4axisxyxz.h”>4axisxyxz.h and
#4 – bdring 于 2020-07-27 I am headed out of town for a week to visit family. I won’t be able to review or test any code. I also can’t donate much time to non standard machines. Creating custom machine features in GrblESP32 is powerful, but requires a good understanding of GrblESP32 and C++/RTOS development. Grbl buffers commands. As each command finished, it will accept a new command. If you have 3 commands and there is room in the buffer, it may appear that Grbl instantly executed 3 commands. It just put them in the queue and will execute them when it can. There are ways to force Grbl to wait in a function until the queued commands are done. You can also create a new task and state machine. The state machine will execute commands and loop around waiting for a state change. The loop’s separate task does not affect the main tasks performance. =========================================================== I did this machine in 8-bit grbl. I plan to convert it to GrblESP32/
#5 – JensHauser 于 2020-07-31 I´d like to make use of the tool change functionality for me, learn C and contribute to the project in reverse sequence So I spent many hours with Bart´s advices and hope to bring some benefit. Output is a basically working manual tool change function with Z probe as user machine (Esp32![]()
How does it work so far?
– Tool change (“Tx M06”) is triggered by typing in ESP3D
– Measure tool length (only once for the first tool)
– Go to tool change position. Do the tool change manually and press “resume”
– Measure tool length of new tool
– calculate G43.1 and set it
Technically?
– The state machine is a RTOS task
– The RTOS task is started in “machineinit” and triggered in “usertool_change” by the initial machine state (an integer value)
– Typing in “T1 M06” is fine, all steps are performed, including G38.2 and G43.1
What´s open?
– There is an issue with the calling function “usertoolchange” while the task is running
– Once the trigger for the task is set, “usertoolchange” returns and goes on with the main g code
– It doesn´t wait for the final state of the task (I know why)
– This behaviour seems to mix up tool change code and regular g code file. Weird moves, of course.
I don’t know what to do in the do/while loop until the final state is achieved. Sleep/time/etc. didn’t work, the machine doesn’t take reliable moves then. Maybe this approach is misleading.
So far I have this code, but it needs improvement (status output and machine moves are out of sync):
“
void usertoolchange(uint8t newtool)
{
newtoolNo = new_tool;
tcstate = TOOLCHANGEINIT; // trigger to let the RTOS task start working.
while (tcstate != TOOLCHANGEIDLE)
{
sleep(25);
}
return;
}
“
Does anybody have an idea how to get back from RTOS task with a final state (TOOLCHANGEIDLE) and then return from “usertool_change” to go on with g code file?
#6 – JensHauser 于 2020-10-02
The Atari example is impressive, but I have the feeling that a comprehensive knowledge about the grbl programming context is necessary to implement this for me.
Is there any plan to implement a wiki page to give some advice to program the tool change/ tool length offset feature individually?
#7 – JensHauser 于 2021-01-10
Hi @bdring,
some time ago we changed thoughts about tool measurement.
I remember you thought about implementing from your recent projects some months ago:
“I did this machine in 8-bit grbl. I plan to convert it to Grbl_ESP32/6 Pack with automatic Z touch and tool length offset compensation in late August (after the dust settles from the 6 Pack controller production)”
I´m not sure about your plans – this enhancement request couldn´t be found on the roadmap.
The link in the youtube video is not working.
Tried on my own (see fork above), it´s working standalone, but I have an issue with multi-tasking. So some more professional review could be helpful.
Maybe it´s a communication thing and it get lost or I misunderstood your timeline/roadmap, would you mind helping out? Thank you.
#1 – JensHauser 于 2020-07-26
Is it possible to get to known the
* current Z position in WCS or
* the location after G38.2
in the
void usertoolchange(uint8t newtool)function?
This could help to perform the calculation between old tool and new tool position