Correct approach to jogging

Home Forums TinyG TinyG Support Correct approach to jogging

Tagged: ,

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #4224
    Edward
    Member

    Hello, I’m afraid it’s me again!

    I’ve got my basic comms all up and running, but I’ve hit a bit of a wall (and the ends of my machine several times!) trying to get simple jogging control so that I can move my machine to z-zero off the top of the material block before sending a toolpath (I also just can’t seem to work out how this is done in tgFX, by the way, so, as an aside, any pointers there would be really appreciated too).

    In my own code I’ve got an analogue XBox controller wired-up and I’m using that to send a pretty rapid sequence of G0 positional moves to the TG. I precede each command with a feed hold, queue flush and cycle start so they are of the form – !%~{“gc”:”g0x0.5y0.25z0.5″} but it really doesn’t seem to like it once they stack up. After a few sr reports the returned x position suddenly varies wildly – usually resulting in a crash stop from me! I also get some reports where the JSON is preceded by ‘!!’?

    I guess the issue here is that the TG cannot keep up with the deluge of my move requests and I’m going to need some local caching, but I wondered whether there is a ‘standard’ pattern I should be using for this sort of thing or, in fact, whether anyone has already implemented this successfully and would be willing to give me some tips?

    Cheers

    E

    #4225
    Edward
    Member

    Just found this: https://github.com/synthetos/TinyG/wiki/TinyG-Feedhold-and-Resume

    So modifying accordingly.

    Cheers

    E

    #4240
    Edward
    Member

    Hello all,

    Just to update on this as it is looking pretty certain that the problem is down to my code and not the TinyG…

    I had an update loop that was *supposed* to issue commands one at a time, waiting for the command acknowledgement in between. It was also intended to keep track of subsequent (but asynchronous) status reports following command completion. However I became suspicious yesterday that I had probably not been taking account of the feed hold (!) and queue flush (%) commands correctly in my own command, acknowledgement, report cycle, and this could cause me to get out of synch with the TinyG. A quick test last night seems to confirm that I can reproduce the problem described above, but only when I send rapid commands without correctly waiting for an acknowledgement in between. I hope this information might still be useful if other encounter a similar issue.

    Cheers

    E

    #6463

    could you share what controller you are writing the gcode to? Is it an Arduino or similar platform.

    #7315
    Gordon
    Member

    Hello Edward,

    I saw your video no Youtube and was quite impressed—it looks like you worked out all of the details smoothly. I’m interested in setting up a similar system and am not sure where to start. Would you mind sharing your code?

    Thanks,
    Gordon

    #7317
    cmcgrath5035
    Moderator

    Wow, 2013! You were a trailblazer back then.

    I would suggest you give Chilipeppr a try, if only to see what is possible with minimal downloads and $0 cost.

    You could then decide to do something entirely different or maybe develops controller ad-in for CP.

    You can start the journey here:

    then perhaps here

    It is likely that the most accurate Z= setting is based on this touch-plate approach

    ChiliPeppr goes a step further, providing Auto-Leveling.

    • This reply was modified 9 years, 11 months ago by cmcgrath5035.
    #9350
    drlove
    Member

    Hi!

    Old topic I know 🙂
    But may I ask how you implemented jogging w/ a gamepad?
    I control my TG from Python and everything is working well and now I want to be able to jog the axis w/ a gamepad (and pygame.joystick library). I cant get my head around the jogging code! There is almost no information around on that, no examples afaik 🙁
    Would love a short code snipet to work from!

    Best regards, L

    #9354
    cmcgrath5035
    Moderator

    This comment applies to both your jogging posts –
    There is no Native command for jogging in the tinyG FW.
    All the interfaces I have experienced (a subset of what is out there) implement a two step process. First, you select a jogging granulatity, what distance you want a jog request to move, then Second an interface that selects which of the six movements to make jog, X+, X-, Y+,Y-, Z+, Z-.
    Jogs are sent as G0 or G1 Gcode commands.
    I have not see A,B,C rotational axis jog interfaces, but certainly the same strategy could be used.

    Since you have a joystick, you could also implement more complex jogs(G1 XxxYyy) by translating your proportional joystick direction into proportionally scaled XYZ movement parameters.

    But in the end, it all boils down to scaling the input(joystick, keyboard key, jog button) by you selected granularity (precision) then sending G0 or G1 commands.

    Hope that helps.

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