Correct approach to jogging

From the original Synthetos forum (2011–2025)

Started by Edward on in TinyG Support. 7 replies, last activity Feb 18, 2016.

#

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

#

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

#

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

#

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

Staff #

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:

https://github.com/synthetos/TinyG/wiki/Chilipeppr

then perhaps here

https://plus.google.com/communities/104346367498010042037?hl=EN

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

https://github.com/synthetos/TinyG/wiki/Automatic-Z-Homing-When-Milling-PCBs

ChiliPeppr goes a step further, providing Auto-Leveling.

#

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

Staff #

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.

This topic is from the original forum (February 2016). Your reply starts a new discussion linked to it.

Reply

Different problem? Ask a new question

Back to TinyG Support or latest activity.