We have just setup a X Y plotter 1.2 m x 2.4 m using open build parts and a Black box controller. What we are trying to do is very simple. We are wanting to setup a measurement grid of 50mm squares, 1.2m x 2.4m. At each intersecting point on the grid we want to pause for 30 seconds take a measurement then go to the next point and repeat. We can make G code for the grid no problem, but how do we get our measurement head to pause for 30 sec and continue to the next point.
Maybe a G04 P(time in milliseconds I think) command after each move? So, unless I am wrong about the milliseconds, you may need a G4 P30000. I am no expert, but I thought I saw someone do something similar somewhere. It was on the internet so it must be true. G04 G-Code: Pause / Dwell for Precise CNC Timing | CNCCookbook: Be A Better CNC'er
But I think with grbl the pause is in seconds rather than milliseconds as it would be in "standard" g-code. Alex.
You are probably right. I guess we would have found out if I was wrong 8.333 hours after the first attempt. I have never messed with the G4. I assumed ms because of every other arduino project I do is ms.
While the pause has its attractions I don't like it..... how do you know when to take the measurement? travel time between every point will not be equal. I would rather integrate the Gcode generation and the sampling into one script, so the script will send a move command, wait for the 'OK' from GRBL, then sample, then move, etc. Then you know for sure that no sample was taken while still moving.
LOL - I embarrassed myself by getting this wrong about a year ago - not sure why grbl decided to be different on this one. Alex.
not GRBL that is different from anything in the Gcode world, the RS274 Gcode standard and LinuxCNC's interpretation of it says seconds G Codes GRBL is essentially NOT an Arduino project, while you can compile and flash it using the Arduino IDE it uses not a single line of Arduino library code, it is pure C/C++, therefore you can compile and flash it with a number of other ATMega compilers AFAIK.
Yep, that. I've flashed it directly from Windows command line in the past with AVRDUDE. Easier with the Arduino IDE, but that's also just a stub to generate the hex from the library files, no real "Arduino" code there. Arduino just happens to be the most convenient form factor for the ATMega328p.
Hi i would like to ask about the G4 dwell time, i am using the Black box control system, i am setting up a very basic system and wanting the Z axes to go down and pause for 3 seconds and return back home. but i cant get the dwell time to work. does it work in the black box code or is there another way to achieve my z axes move with a wait time of (seconds). any help would be helpful.
thanks for your reply, when i put the G4 P3 in the code and simulate it, it doesn't pause. will it pause in the simulation in the open builds control simulation.
That I don't know off-hand, though if the simulation uses grbl's hardware simulation mode then it should. I'd just do a very short hand-code and run it straight on the machine. Only need to move a few mm to be able to tell whether it's performing as expected. G90 G21 G17 G54 G53 Z0 G1 Z-10 F500 G4 P3 G0 Z0 M30 Something like that. Change the G21 to G20 and the Z-10 to Z-0.5 if you're working in imperial units. Home first, obviously.
Thanks for the info, the dwell (G4) works on the machine but not in the simulator. that was throwing me off.
I just upgraded versions (1.0.270 now) and the simulator pauses, but it doesn't matter what number you put in there, it will pause the same amount
Thanks for the report, try the Beta of 1.0.272 - modified 3D viewer being built: See Control crashes on large files?
I misspoke. There is a minute pause between commands in the simulator. My G4 commands in version 1.0.270 are not processed.
The sim does not handle pauses, it just gets the array of points, and moves between them with the approximate feedrate