Show-stopper for a NewB

Advert

Show-stopper for a NewB

Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #468299
    Gary Wooding
    Participant
      @garywooding25363

      I do a lot of CAD work with F360 and TurboCAD, and am dipping my toes into the mysterious waters of CNC. To that end I've purchased the miniature Benbox 1310 engraver **LINK** , and installed the Universal Gcode Sender **LINK**.

      I downloaded the spiral.gcode program from GitHUb and am having problems getting it to run.

      It's only 14 lines long and terminates with the following rather uninformative error message…

      [Error] An error was detected while sending 'G3X0Y0I20J0': Error: Invalid gcode ID:33. Streaming has been paused.

      Since this appears to be the first command in a program stated to be a test program I'm totally flumaxed.

      I posted this on GITHUB and CNCzone, a couple of days ago, with no responses at all.

      Here's the complete program.

      G21 (Units in millimeters)
      G90 (Absolute programming)
      G17 (XY plane)
      F900

      G3 X0 Y0 I20 J0
      G3 X0 Y0 z 20 I20 J0
      G3 X0 Y0 I20 J0

      G1 Z0
      G2 X0 Y0 I-20 J0
      G2 X0 Y0 z -20 I-20 J0
      G2 X0 Y0 I-20 J0
      G1 Z0

      Any ideas please?

      Advert
      #15275
      Gary Wooding
      Participant
        @garywooding25363
        #468303
        Ex contributor
        Participant
          @mgnbuk

          Lower case "z" in second G2/G3 blocks rather than upper case ?

          Some systems use an "R" value rather than I/J in G2 G3 – do you have list of suported G codes for the router to check the required format ?

          Nigel B.

          #468306
          Bill Davies 2
          Participant
            @billdavies2

            Gary, does it expect G03 vs G3? The error indicates the G code in that line, although, as Nigel indicates, there may be within that line of code.

            Bill

            #468308
            Baz
            Participant
              @baz89810

              Don’t think it will be G03 vs G3, most systems allow you to drop leading zeros. Could be lower case z, I also note no decimal points, I was always taught to put one in ie x20. Or x.2 I was taught mainly on Fanuc systems and leading and trailing zeros could be omitted as could block numbers, I think the same holds true for Mach 3

              #468314
              RobC
              Participant
                @robc77385

                Hi Gary,

                This code is generating an error describes as:

                The motion command has an invalid target. G2, G3, and G38.2 generates this error, if the arc is impossible to generate or if the probe target is the current position.

                This means that your gcode doesn't make sense to the controller software.

                If you examine the gcode, you can see the problem. (I don't know where it came from, but it isn't really a helpful piece as a sample program).

                If you take a look at this link you can see how a counterclockwise arc (G3) is defined in gcode.

                G3 X0 Y0 I20 J0

                The command to move in an arc needs a start point, end point and centre point.

                The code in this line describes the end point and the centre point, but requires a start point to be identified before it can move.

                G3 – Start counter clockwise motion

                X0 Y0 – the end point

                I20 J0 – centre point of arc (relative to start point)

                You can probably see from this description that the start point is required. I would normally expect to see a line like this in front of the G3 command line:

                G1 X0 Y0

                This would set the start point at (0,0) and allow the second line to describe an arc between (0,0) and (0,0) centred at (20,0) – This describes a circle with radius 20.

                —————–

                Sample code it always tricky, particularly from an unverified source. A CNC machine is very unforgiving when things go wrong. They try to do exactly what they are told, with little or no reality checking along the way.

                They are fantastic fun, but have a pretty steep learning curve in the early stages.

                I hope this helps…

                Rob

                #468315
                RobC
                Participant
                  @robc77385

                  The Universal Gcode Sender software is happy with the upper/lower case lettering, the spaces, the preceding zeros. and the decimal places. So there's no need to worry about them.

                  #468317
                  Gary Wooding
                  Participant
                    @garywooding25363

                    This is all totally new to me, but the error message appears to about about line 6 of the program – ie, before it gets to the lower case "z".

                    The machine came as a box of bits with no instructions at all. Nothing. I assembled it, installed UGS on my Win10x64 system and eventually managed to connect and calibrate it, then found **THIS** video. I downloaded the spiral .gcode prgram and got the error the first time I ran it. That's all I know.

                    #468318
                    Martin Connelly
                    Participant
                      @martinconnelly55370

                      If you can jog it move the x and y axes to the approximately central position and z down at least 20mm from its highest position. Set x, y and z to zero if you can. This should allow the program to run without hitting soft limits if that is the problem.

                      Does everything home itself when first switched on?

                      Martin C

                      Ps. Check all zeros are 0 and not capital o. Also it may be worth adding m30 as a last line (program end) and adding a return after it as well. 

                      Edited By Martin Connelly on 01/05/2020 11:34:20

                      #468319
                      SillyOldDuffer
                      Moderator
                        @sillyoldduffer

                        Can't add anything to Rob's informative reply other than to suggest the general answer can be found by searching the linuxcnc GCode manual here. As nothing is ever easy, after navigating to the particular command of interest, scan for Paragraphs starting "It is an error if:" There may be more than one! For G2 and G3 arc:

                        It is an error if:

                        • No feed rate has been set.

                        • The P word is not an integer.

                        It is an error if:

                        • No feed rate is set with the F word.

                        • No offsets are programmed.

                        • When the arc is projected on the selected plane, the distance from the current point to the center differs from the distance from the end point to the center by more than (.05 inch/.5 mm) OR ((.0005 inch/.005mm) AND .1% of radius).

                        It is an error if:

                        • both of the axis words for the axes of the selected plane are omitted

                        • the end point of the arc is the same as the current point.

                        Unfortunately, the manual doesn't seem to cross-reference to the ID: number, and that information is hidden away in report.h and report.c on grbl github. May not be up to date, but with ID at the end:

                        // Define Grbl status codes.
                        #define STATUS_OK 0
                        #define STATUS_EXPECTED_COMMAND_LETTER 1
                        #define STATUS_BAD_NUMBER_FORMAT 2
                        #define STATUS_INVALID_STATEMENT 3
                        #define STATUS_NEGATIVE_VALUE 4
                        #define STATUS_SETTING_DISABLED 5
                        #define STATUS_SETTING_STEP_PULSE_MIN 6
                        #define STATUS_SETTING_READ_FAIL 7
                        #define STATUS_IDLE_ERROR 8
                        #define STATUS_ALARM_LOCK 9
                        #define STATUS_SOFT_LIMIT_ERROR 10
                        #define STATUS_OVERFLOW 11
                        #define STATUS_MAX_STEP_RATE_EXCEEDED 12

                        #define STATUS_GCODE_UNSUPPORTED_COMMAND 20
                        #define STATUS_GCODE_MODAL_GROUP_VIOLATION 21
                        #define STATUS_GCODE_UNDEFINED_FEED_RATE 22
                        #define STATUS_GCODE_COMMAND_VALUE_NOT_INTEGER 23
                        #define STATUS_GCODE_AXIS_COMMAND_CONFLICT 24
                        #define STATUS_GCODE_WORD_REPEATED 25
                        #define STATUS_GCODE_NO_AXIS_WORDS 26
                        #define STATUS_GCODE_INVALID_LINE_NUMBER 27
                        #define STATUS_GCODE_VALUE_WORD_MISSING 28
                        #define STATUS_GCODE_UNSUPPORTED_COORD_SYS 29
                        #define STATUS_GCODE_G53_INVALID_MOTION_MODE 30
                        #define STATUS_GCODE_AXIS_WORDS_EXIST 31
                        #define STATUS_GCODE_NO_AXIS_WORDS_IN_PLANE 32
                        #define STATUS_GCODE_INVALID_TARGET 33
                        #define STATUS_GCODE_ARC_RADIUS_ERROR 34
                        #define STATUS_GCODE_NO_OFFSETS_IN_PLANE 35
                        #define STATUS_GCODE_UNUSED_WORDS 36
                        #define STATUS_GCODE_G43_DYNAMIC_AXIS_ERROR 37

                        So 33 is 'STATUS_GCODE_INVALID_TARGET', which means the Gcode is valid, except it's been told to do something out of reach.

                        Not exactly noobie friendly but you can't help loving a system where not using the F word is an official error, ho ho!

                        Dave

                        PS Not a showstopper, just a duff example.  Try something else.

                        Edited By SillyOldDuffer on 01/05/2020 11:39:41

                        #468321
                        blowlamp
                        Participant
                          @blowlamp

                          I get this error message with your gcode.

                           

                          annotation 2020-05-01 115512.jpg

                           

                          Try this gcode instead. It's just a pattern of arcs.

                          G21 G17 G90
                          G01 X0 Y0 Z0 F100
                          G02 X0 Y20 I0 J10
                          G03 X0 Y40 I0 J10
                          G02 X0 Y60 I0 J10
                          G01 X40
                          G02 X40 Y40 I0 J-10
                          G03 X40 Y20 I0 J-10
                          G02 X40 Y0 I0 J-10
                          G01 X0 Y0 Z0

                           

                          Martin.

                          Edited By blowlamp on 01/05/2020 12:03:29

                          #468322
                          Martin Connelly
                          Participant
                            @martinconnelly55370

                            I have looked to see what the error code is telling you. G03 or G3 is an anticlockwise move around a point, in this case defined by i20 j0. Starting at x0 y0 and ending at x0 y0 would make sense as the radius will be a constant 20mm (assuming this is what everything is set up in). If however you try to start at some random place other than x0 y0 then the start point and end point are unlikely to have the same distance to the centre of rotation so a constant radius arc will be an error as flagged. If you add g01 x0 y0 z0 after f900 it should work (unless it runs out of space to move).

                            Martin C

                            #468326
                            RobC
                            Participant
                              @robc77385

                              OK, I also use UGS and have just plugged that code into my machine – it runs perfectly!

                              So, I believe that your issue is one of configuration, frustratingly.

                              #468327
                              RobC
                              Participant
                                @robc77385

                                Are you able to use the JOG functions in UGS to move your machine?

                                Have you set your zero positions (X,Y,Z) somewhere in the middle of your machine bed. Just so that it is possible for it to move around as requested?

                                #468331
                                Jan B
                                Participant
                                  @janb

                                  You must enter G54 as a work zero offset. The program must know the zero position of X, Y and Z.

                                  You can´t have a Z coordinate in G3 if you use G17, so remove Z.

                                  Jan

                                  #468339
                                  RobC
                                  Participant
                                    @robc77385

                                    I believe that Martin has the answer – you need to define a start position.

                                    So any of these should solve it:

                                    1. Set a machine zero position
                                    2. Set a work zero position / offset as Jan suggests
                                    3. Add a 'move to 0,0,0' command into the gcode before the arc (G1 X0 Y0 Z0)

                                    For 1 & 2 I think you can do these in the UGS interrface using the 'reset zero' command or the 'reset' buttons next to the X, Y, Z indicators.

                                    #468641
                                    Gary Wooding
                                    Participant
                                      @garywooding25363

                                      I'm really grateful to you guys. I tried the little program supplied by Martin, which worked fine. I then tried the suggestion of adding g01 x0 y0 z0 after the F900 in spiral, and that worked too.

                                      The 1310 is a very little machine and it ran out of space, but that's not important to me. Since this whole thing is entirely new, with an untested machine, I had no real way of knowing if the machine was faulty or had the wrong software in it. Since I'd managed to calibrate it and turn the spindle motor on, I was beginning to suspect the software level in the Arduino, and I had no idea how to go about upgrading.

                                      As mentioned in my 1st post, I'd already posted the problem to 2 apparently specialised forums, and had no responses whatsoever. In desperation I turned to this forum and got responses and solutions almost instantly.

                                      Did I say how grateful I am? This forum is amazing.

                                      #468651
                                      Neil Wyatt
                                      Moderator
                                        @neilwyatt
                                        Posted by Gary Wooding on 02/05/2020 15:46:24:

                                        Did I say how grateful I am? This forum is amazing.

                                        Wrong!

                                        It's the members of the forum who do the amazing bits!

                                        Neil

                                      Viewing 18 posts - 1 through 18 (of 18 total)
                                      • Please log in to reply to this topic. Registering is free and easy using the links on the menu at the top of this page.

                                      Advert

                                      Latest Replies

                                      Viewing 25 topics - 1 through 25 (of 25 total)
                                      Viewing 25 topics - 1 through 25 (of 25 total)

                                      View full reply list.

                                      Advert

                                      Newsletter Sign-up