Having trouble with first g2core baby steps

Home Forums TinyG TinyG Support Having trouble with first g2core baby steps

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #10920
    justinclift
    Member

    Hi all,

    Started looking back at TinyG2 (g2core) for using with an Arduino Due + several A4988 stepper drivers. All just on a breadboard at the moment, while I get the hang of concepts. πŸ˜‰

    I’m able to compile and flash the Due using edge branch git repo code without issue. Using CentOS 7 x64 if that helps.

    As a first go, just blindly following the instructions on the g2 wiki page for compiling I used the make CONFIG=TestV9 command, then flashed the .bin to the board.

    Using the “g2” nodeJS cli, I’m then able to connect to /dev/ttyACM1 and feed it G-Code. The responses back (in JSON, ugh) seem to indicate that it would be moving motors if things were hooked up. So, seems like a win to that point.

    g2# G0 X10 Y10 Z10
    Pos: X=1.97 Y=1.97 Z=1.97 A=0.00 Vel:1732.05 (Running)
    Pos: X=6.13 Y=6.13 Z=6.13 A=0.00 Vel:1732.05 (Running)
    Pos: X=9.85 Y=9.85 Z=9.85 A=0.00 Vel:619.25 (Running)
    Pos: X=10.00 Y=10.00 Z=10.00 A=0.00 Vel:0.00 (Stop)
    Pos: X=10.00 Y=10.00 Z=10.00 A=0.00 Vel:0.00 (Stop)
    {"line":0,"posx":10,"posy":10,"posz":10,"feed":0,"vel":0,"momo":0,"stat":3}

    Trying the same thing through the “CNCjs” web based UI, that also seems to work. Jogging around using the direction arrows steps the virtual pointer. Again, things seems on track.

    However, trying to then hook up real steppers to the Due board is failing badly for me so far.

    Trying with just a single stepper, and (after reading further on the wiki) I’ve recompiled using make PLATFORM=DUE BOARD=gShield, then flashed the result to the Due.

    However, neither g2 nor CNCjs seems to want to “do anything” now. They’ll both connect to /dev/ttyACM1 happily… but feeding (the exact same) G-Code to g2 gives a response like it’s not moving anything.

    g2# G0 X10 Y10 Z10
    Pos: X=0.00 Y=0.00 Z=0.00 A=0.00 Vel:0.00 (Stop)
    {"line":0,"posx":0,"posy":0,"posz":0,"posa":0,"feed":20,"vel":0,"unit":1,"coor":1,"dist":0,"admo":1,"frmo":1,"momo":0,"stat":3}

    Same for CNCjs.

    At this point I’m just super frustrated, as it’s not making any sense whatsoever. I’m using the exact same commands now that were “working” with the TestV9 config, except now that the flash is for the “correct” board type… they’re not working, and nothing seems to indicate WTF is wrong.

    Any hints? Kind of guessing it’ll be something super simple, but I’m just not seeing it.

    Regards,

    Justin Clift

    #10921
    cmcgrath5035
    Moderator

    Did you run a “make clean” before your second compile?

    Indeed, a V9 build seemed to logically run fine when I did it, but the pinouts were no where near close to correct.

    Make clean will remove all object files an force a completer rebuild.

    When you reflash, you should see the characteristic G2 ‘heart beat’ slow pulsing of the LED near the native USB connector.

    Also be aware – G2core builds with all motors disabled.
    You need to re-enable them with CLI commands.

    I would suggest starting with a G2 Master build first – should result in a 100.26 build I believe.

    Edge tends to be real edgy in G2

    #10922
    justinclift
    Member

    > Did you run a β€œmake clean” before your second compile?

    Definitely. πŸ™‚

    I used these two git commands to refresh the git repo state back to pristine before the second compile:

    $ git clean -dffx
    $ git reset --hard HEAD

    Thanks for the pointer about the heartbeat led, and suggestion for using master instead of edge. I’ll try master tomorrow when I’m back on this, and keep an eye out for the heartbeat led just for awareness.

    With the G2 code building with motors disabled… that sounds like it might have been the problem. I’ll go looking for the correct CLI commands tomorrow too then. πŸ™‚

    #10923
    cmcgrath5035
    Moderator

    I am not all that familiar with git clean, but assume it would have similar affect.

    I have no idea how far off the pinouts would be with a V9 build.
    I was only looking for a logical response from G2core when I did it.

    Good luck, and be mindful that both Chilipeppr and cnc.js were developed against tinyG. There may be some issues with line mode, not sure.

    #10925
    justinclift
    Member

    Took a day longer to get back to this, but on it now. Noticing what seems like a few initial mistakes in the wiki page data, but figured I’d ask here just in case it’s me misunderstanding. πŸ˜‰

    With the “Configuring System Groups” page here:

    https://github.com/synthetos/g2/wiki/Configuring-0.99-System-Groups

    Under “{hp:n} Hardware Platform”, it has the return values listed as:

    {hv:1}  TinyG Xmega series
    {hv:2}  Arduino Due G2 (ARM)
    {hv:3}  TinyG v9 G2 (ARM)

    Should those be hp instead of hv? When manually typing in {hp:n}, the return values I receive start with hp.

    On the Power Management page, under “Global Power Management” there is a table with “Setting”, “Description”, “Notes”:

    https://github.com/synthetos/g2/wiki/Power-Management#global-power-management-settings

    The Notes for both the enable and disable setting list the exact same command to run: {md:0}. That seems wrong. Shouldn’t enable be {me:0}?

    #10926
    justinclift
    Member

    Hmmm, the {hp:n} return value I’m getting seems incorrect. For master branch, compiled with make PLATFORM=DUE BOARD=gShield, I’m getting this return value:

    {“r”:{“hp”:3},”f”:[1,0,8]}

    From the Configuring System Groups page, the “3” return value seems to indicate it’s a TinyG v9 G2, when it should be “2”, indicating “Arduino Due G2”.

    At a guess, the PLATFORM=DUE line taken from the PDF doc needs updating:

    https://github.com/cmcgrath5035/G2core-DUE-External-Interfaces/blob/master/G2core%20DUE%20External%20Interfaces.pdf

    Will experiment a bit shortly…

    #10927
    justinclift
    Member

    Ugh. Still can’t get this to work. πŸ™

    If I build and flash g2core (master branch) using CONFIG=TestV9, then when I issue simple G-Commands they immediately run. eg X/Y/Z position changes (talking logically here, without any stepper drivers/motors hooked up).

    For example:

    {clear:n}
    {"r":{"clear":null},"f":[1,0,11]}                                                                                              
    {"sr":{"line":0,"posx":0,"posy":0,"posz":0,"feed":0,"vel":0,"momo":4,"stat":1}}
    {ej:0}
    ?stat
    Line number:         0                                                                                                         
    X position:          0.000 mm                                                                                                  
    Y position:          0.000 mm                                                                                                  
    Z position:          0.000 mm                                                                                                  
    Feed rate:           0.000 mm/min
    Velocity:            0.000 mm/min
    Motion mode:         G80 - cancel motion mode (none active)
    Machine state:       Ready
    g2core[mm] ok>
    G0 X10 Y10 Z10 F20
    $pwr
    [pwr1] Motor 1 power level:       0.000
    [pwr2] Motor 2 power level:       0.000
    [pwr3] Motor 3 power level:       0.000
    [pwr4] Motor 4 power level:       0.000
    g2core[mm] ok> 
    $1pm
    [1pm] m1 power management         2 [0=disabled,1=always on,2=in cycle,3=when moving]
    $posx
    X position:         10.000 mm
    $mpox
    X machine posn:     10.000 mm

    This part seems to work. πŸ™‚

    When building and flashing g2core using PLATFORM=DUE BOARD=gShield (as per the PDF), as I’m using a Due board and can hook up the stepper drivers to the pins mentioned in the PDF… simple G-Code commands don’t run. Even with motors (logically) definitely enabled before giving the G-Code commands.

    
    {clear:n}
    {"r":{"clear":null},"f":[1,0,11]}
    {"sr":{"line":0,"posx":0,"posy":0,"posz":0,"posa":0,"feed":0,"vel":0,"unit":1,"coor":1,"dist":0,"admo":1,"frmo":1,"momo":4,"stat":1}}
    {ej:0}
    ?stat
    Line number:         0
    X position:          0.000 mm
    Y position:          0.000 mm
    Z position:          0.000 mm
    A position:          0.000 deg
    Feed rate:           0.000 mm/min
    Velocity:            0.000 mm/min
    Units:               G21 - millimeter mode
    Coordinate system:   G54 - coordinate system 1
    Distance mode:       G90 - absolute distance mode
    Arc Distance mode:   G91.1 - incremental distance mode (default mode)
    Feed rate mode:      G94 - units-per-minute mode (i.e. feedrate mode)
    Motion mode:         G80 - cancel motion mode (none active)
    Machine state:       Ready
    g2core[mm] ok> 
    $1pm
    [1pm] m1 power management         0 [0=disabled,1=always on,2=in cycle,3=when moving]
    g2core[mm] ok> 
    $1pm=2
    [1pm] m1 power management         2 [0=disabled,1=always on,2=in cycle,3=when moving]
    g2core[mm] ok> 
    $2pm=2
    [2pm] m2 power management         2 [0=disabled,1=always on,2=in cycle,3=when moving]
    g2core[mm] ok> 
    $3pm=2
    [3pm] m3 power management         2 [0=disabled,1=always on,2=in cycle,3=when moving]
    g2core[mm] ok> 
    $4pm=2
    [4pm] m4 power management         2 [0=disabled,1=always on,2=in cycle,3=when moving]
    g2core[mm] ok> 
    $1pm
    [1pm] m1 power management         2 [0=disabled,1=always on,2=in cycle,3=when moving]
    g2core[mm] ok> 
    $2pm
    [2pm] m2 power management         2 [0=disabled,1=always on,2=in cycle,3=when moving]
    g2core[mm] ok> 
    $3pm
    [3pm] m3 power management         2 [0=disabled,1=always on,2=in cycle,3=when moving]
    g2core[mm] ok> 
    $4pm
    [4pm] m4 power management         2 [0=disabled,1=always on,2=in cycle,3=when moving]
    g2core[mm] ok> 
    G0 X10 Y10 Z10 F20
    g2core[mm] ok> 
    Feed rate:          20.000 mm/min
    Motion mode:         G0  - linear traverse
    Machine state:       Stop
    $posx
    X position:          0.000 mm
    g2core[mm] ok> 
    $mpox
    X machine posn:      0.000 mm
    g2core[mm] ok>
    

    In this second case, the commands are accepted but nothing “runs”. I’ve been reading through all kinds of docs, looking through tonnes of the source… but literally nothing seems to address this. It just seems like there’s something missing to make it “Ok, start now…”.

    Any hints?

    #10928
    justinclift
    Member

    Note, it’s not a feed hold / resume thing. Tried that already. πŸ˜‰

    #10929
    justinclift
    Member

    Aha, seems like the axis for the gShield/Due boards are disabled by default.

    
    [xam] x axis mode                 0 [disabled]
    [yam] y axis mode                 0 [disabled]
    [zam] z axis mode                 0 [disabled]
    [aam] a axis mode                 0 [disabled]
    

    Next step, lets see if the steps are being send to the correct pins. πŸ™‚

    #10930
    justinclift
    Member

    Excellent, motors can be turned. k, this is enough to start with.

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.