Skip to content
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

Error 24, 33 and 34 #8

Open
tobiaswuerth opened this issue Nov 26, 2024 · 0 comments
Open

Error 24, 33 and 34 #8

tobiaswuerth opened this issue Nov 26, 2024 · 0 comments

Comments

@tobiaswuerth
Copy link

tobiaswuerth commented Nov 26, 2024

Hey, love the library, really useful for my case.

I tend to run into weird issues though, errors like these:

on_error                 error:33, G03X1032.00R18F10000, 13
on_error                 error:34, G03X1032.00R18F10000, 13
on_error                 error:33, G03X1032.00R18F10000, 13
on_error                 error:34, G03X1032.00R18F10000, 13
on_error                 error:33, G03X1032.00R18F10000, 12

on_read                  [echo: G03X1G03X1018.00R3F10000]
on_error                 error:24, G03X1006.00R6F10000, 21

on_read                  [echo: G01X1051.00Y500.00F150G02X1081.00R15F10000]
on_error                 error:24, G02X1051.00R15F10000, 13

on_read                  [echo: G01X1051.00Y500.00F150G02X1081.00R15F10000]
on_error                 error:24, G02X1051.00R15F10000, 13

on_read                  [echo: G01X1051.00Y500.00F150G02X1081.00R20F10000]
on_error                 error:24, G02X1051.00R20F10000, 13

My setup is like this:

grbl.job_new()
grbl.load_file(file)
grbl.job_run()
while not grbl.job_finished:
    timelapse.consider()
    time.sleep(0.1)

when I get an error in the log the machine stops but the while loop still continues. I then have to stop the cell and restart it.
Since this mostly happens at the start of a new script, I can restart it manually without much damange, nevertheless it's not ideal, I need something reliable.

grbl.abort()
grbl.job_new()
grbl.load_file(file)
grbl.job_run()
while not grbl.job_finished:
    timelapse.consider()
    time.sleep(0.1)

Most often this just works the 2nd time, since the actual start location of the machine is not at 0,0 but rather near where it last aborted.

It's obviously not an issue with the GCODE since it will work at some point and once it's running it runs..
It's still annoying because I cannot automate more of my workflow because I have to monitor and babysit everything.

From here I see that:

Error Code Message Description
24 Invalid gcode ID:24 More than one g-code command that requires axis words found in block.
33 Invalid gcode ID:33 Motion command target is invalid.
34 Invalid gcode ID:34 Arc radius value is invalid.

my solution of just restarting the script from a different starting position seems to help with 33/34.
the error 24 seems to appear when I try to expand my workflow like this:

for j, func in enumerate(gen.get_sequence_generator(idx)):
    print(f'Starting next iteration: {j}')
    grbl.killalarm()
    grbl.send_immediately("G21")
    grbl.send_immediately("G90")
    grbl.send_immediately("$H")
    grbl.send_immediately("G10 P0 L20 X0 Y0 Z0")

    state = take_photo()
    _, action_sequence = func(state)
    file = workspace.write_actions_to_file(idx, action_sequence, j) # generates gcode

    time.sleep(10) # wait for machine to finish homing
    grbl.job_new()
    grbl.load_file(file)
    grbl.job_run()

    while not grbl.job_finished:
        timelapse.consider()
        time.sleep(0.1)

    time.sleep(10) # wait for machine to finish returning to home position

I was wondering if the issue is related to time.sleep(..) or like the website mentions unstable connection. Weird is also that I do not have these issues when running the scripts with UGS (which is based on Java and maybe performs better?).

Any inputs is welcome :)
Thanks for the great work.

  • T
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant