Lines of code readding before the last one is finished?



  • i cant seem to understand why this happens.

    if u use the Dwell :
    G4 P100
    command

    the way it reacts seems odd, lets use this code for example.

    G0 x0 y0 Z5 F1500
    G30 S-1
    G4 P500
    G0 x0 y0 Z5 F1500
    G30 S-1
    G4 P500

    even tho i have a move, then a dwell, then a probe,

    its reading the G30 S-1 before it ever reaches the Z5
    so it gives the error " probe already triggered"

    now i have seen this in other things like when I'm running my CNC, some times the stop spindle command will go WAY before the end of the move is read???

    there for the CNC is trying to cut the last move, but the spindle is already stopping. ( on a long straight last move this is a real prob, i thought a G4 command would help but it dose not work that way)

    its almost as if its reading whats in the buffer before the dwell or other lines of code takes place.

    not only in dwell, but even when there is no dwell, as described in my CNC scenario.

    can some one explain this and also explain how to fix it?

    Basically, I want each command to be reached before the next commands happens??

    you can see this happen @ 5:05:30 ( not the brief stop there that was my motor controller)
    https://youtu.be/eZFaNNnUxWE?t=18326

    my exact quote was " Ahhh, … OK..."

    lol that last move was one straight line, but it already went through to the next line of code and Stopped the CNC ???

    ok, please let me know, I'm confused.

    Thanks!!

    ~Russ


  • administrators

    Why did you use this sequence:

    G30 S-1
    G4 P500
    G0 x0 y0 Z5 F1500
    G30 S-1

    instead of this:

    G30 S-1
    G0 x0 y0 Z5 F1500
    G4 P500
    G30 S-1

    I can't see that the G4 command in your original sequence will do anything useful.

    Also, you need to use upper case characters in gcode commands (e.g. the x and y in your G0 command), except when sending them from a host that converts all commands to upper case.

    To force the machine to stop between moves without adding a delay, use M400. But it will stop before a G30 command anyway.

    HTH David



  • good point,

    I had that in reverse,

    so lets ignore the probe code,( that way my fault)

    lets go back to the CNC, did you see the video? how it stopped? just watch 30 seconds of it where i have it time stamped.

    here is that exact code:

    G0 F3000 X1.2938Y47.5838
    G1  F150 Z-1.8000
    G1  F150 X52.6638Y47.5838
    G1  F150 X52.6638Y-47.5838
    G1  F150 X1.2938Y-47.5838
    G0 F3000 X1.2938Y-47.5838
    G1  F150 Z-2.0000
    G1  F150 X52.6638Y-47.5838
    G1  F150 X52.6638Y47.5838
    G1  F150 X1.2938Y47.5838
    G0 F500 Z2.0000
    G0 F3000 Z200.0000
    G0 F3000 X0Y0
    M280 P6 S30
    
    M117 End of cut
    
    

    so the M280 P6 S30 turns off my CNC off but it turned it off right after it got around the corner? it had another 50mm to go or so?

    so a M400, hummm, ok, i see its the same as a G4 P0

    I will need to use M400 before every other command that is not a G command? is this correct?

    would it not be a good idea to implement this in to the firmware? so basically nothing gets " out of sequence" for any gcode. I would thing it would go line for line know madder what?

    for me it seems "out of order" all on its own? that really messes with my head, but i don't understand how the commands are executed in the "back end" .

    Thanks for the reply!!

    also on a side note, if i use the command "G30 P0 X0 Y0 Z-99999 F2000 S-1"
    what is the max P values i can use? some where around 36 right?
    ( this is what i was trying to do with that probe Gcode up there and figure it out after some looking and playing, I'm testing probes accuracy.)
    ~Russ


  • administrators

    Try firmware 1.18.1, you should find that it synchronises gcodes such as M280 to movement much better than 1.17 series and earlier did. Let me know if it's still a problem using that version..



  • ok, will do,

    I have 1.18.1 installed now, but haven't ran that Gcode,

    in that video i was still using 1.17

    I will run the same Gcode and see if it changes.

    Thanks David.

    ~Russ


Log in to reply