Change jog speed while jogging?

More
10 Jun 2020 00:31 #170894 by Doug Crews
Replied by Doug Crews on topic Change jog speed while jogging?
Hello Aceria (and others).

I’m wanting to have the same jog speed control that you achieved for the same reasons. I currently use small encoders for Feed Override and Rapid Override and this code:

#load manual override encoders
loadrt encoder num_chan=2
addf encoder.capture-position servo-thread
addf encoder.update-counters servo-thread

# connect feed-override encoder
setp encoder.0.x4-mode 1
net fo-chanA hm2_5i25.0.7i77.0.0.input-15 => encoder.0.phase-A
net fo-chanB hm2_5i25.0.7i77.0.0.input-17 => encoder.0.phase-B
net output encoder.0.counts => halui.feed-override.counts
setp halui.feed-override.count-enable 1
setp halui.feed-override.scale 0.02

# connect rapid-override encoder
setp encoder.1.x4-mode 1
net ro-chanA hm2_5i25.0.7i77.0.0.input-18 => encoder.1.phase-A
net ro-chanB hm2_5i25.0.7i77.0.0.input-19 => encoder.1.phase-B
net ro-output encoder.1.counts => halui.rapid-override.counts
setp halui.rapid-override.count-enable 1
setp halui.rapid-override.scale 0.05

I was hoping to do the same thing for Jog-Speed but I found as you did there are no similar halui pins to use for a Jog Override. It’s too bad because these little encoders are sweet, they have no rotation stops and you can set the scaling as fine as you wish. I was searching the forum to see if anyone has created halui pins for this application or what it would entail to create them when I found your post.

If you don’t mind could you share the relevant code that gave you this control.

I’m assuming you took advantage of the halui.jog.analog pin? Did you use something like a 10k pot?

Or, maybe there’s another way of using the encoder. I’m running 2.7.14 and still a relative noob. I bet Andy – Todd -Chris you guys have something slick that works for encoders. I’m glad you all are out there. I read through so many posts that you all are involved in I can almost hear voices now.

Thanks
Doug

Please Log in or Create an account to join the conversation.

  • Aciera
  • Aciera's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
More
10 Jun 2020 04:00 #170908 by Aciera
Replied by Aciera on topic Change jog speed while jogging?
Doug,
I use potentiometers and gmoccapy. As far as I remember there are also pins for encoder feed overrides in gmoccapy. I can't help you much with axis gui.
So if you are interested in the gmoccapy approach let me know and I will upload my config.

Please Log in or Create an account to join the conversation.

More
10 Jun 2020 04:33 #170910 by cmorley
Replied by cmorley on topic Change jog speed while jogging?
Linuxcnc has no internal reference of jog rate - each gui has it's own.
Unfortunately, AXIS doesn't expose the jograte as a HAL pin by default.

using .axisrc option to add custom code to AXIS I'm sure you could make this work.
But you'll have to wait for the AXIS gurus to help you out :)

Please Log in or Create an account to join the conversation.

More
10 Jun 2020 08:04 #170922 by andypugh
Replied by andypugh on topic Change jog speed while jogging?

I was hoping to do the same thing for Jog-Speed but I found as you did there are no similar halui pins to use for a Jog Override.


It's best not to use halui for jogging in places where you have a choice, as halui is a user-space program.

You should use the joint / axis jog pins if you can as they are associated with the motion module running in realtime.

linuxcnc.org/docs/2.7/html/man/man9/motion.9.html

Just change the jog-scale pin and the jog speed will change.

"halui" should be thought of as a GUI without a G :-)

Please Log in or Create an account to join the conversation.

More
11 Jun 2020 00:15 #171020 by Doug Crews
Replied by Doug Crews on topic Change jog speed while jogging?
Thanks for the offer David,
But I’m too new to migrate away from Axis for the time being. Good to know there are options.

I’ve been testing Andy’s suggestion and have only been able to get the encoder to behave like an MPG. I tried a few different scenarios but in order to get the jog to move I had to include axis.N.enable which only moves when the encoder count changes. I linked the jog button to the axis.n.enable but it only made me haft to push and hold the jog button while turning the encoder for the jog to move. It moves like a typical MpG incrementing..its been a good exercise.

So it seems there’s two paths to jogging, one is through halui and the other is through the motion module. I have them both set-up but haven’t had the guts get a jog going using halui while turning the nob on the encoder that is sending discrete incremental pulses via motion module…don’t know what will happen.! Don’t want to break my new “Precious”

Changing the jog speed while jogging would be great, but a next best thing would be to have the jog speed value update to a newly selected value when the button is off so at the next press its jogging at the new speed.

This behavior seems like something that could be done in haui. This code works, But it’s a fixed at a rate. 60 in/min.
setp halui.jog-speed 60
net jog-x-pos <=  halui.jog.0.plus <= hm2_5i25.0.7i77.0.0.input-20
Is there a way to have signal / variable in place of the 60? Something tied to a selector switch with a couple of choices that I could set would be good.

As usual thank you all.

-Doug

Please Log in or Create an account to join the conversation.

More
11 Jun 2020 00:34 #171023 by andypugh
Replied by andypugh on topic Change jog speed while jogging?

I’ve been testing Andy’s suggestion and have only been able to get the encoder to behave like an MPG.


Clearly I have been misunderstanding what you are trying to achieve. I had assumes that you were wanting the encoder as an MPG.

Can you describe what controls you have, and what you want them to do?

Please Log in or Create an account to join the conversation.

More
11 Jun 2020 03:49 #171070 by Doug Crews
Replied by Doug Crews on topic Change jog speed while jogging?
Hey Andy,

From my end I was looking to install physical jog buttons instead of using the mouse or keyboard to jog. More than once I was bringing a tool down to touch a part in Z using the mouse and it “hung” meaning my finger was off the mouse button and the z was still moving!. I nearly punched the estop button through the panel the first time it happened. I figure a direct button to i/o card would be a more robust solution than the mouse and keyboard, so I’ve been working that way.

I would like to push a physical jog button for z-minus have it jog at maximum speed and when I start to get close to the part or toolsetter I dial down the jog speed eventually down to 0.3 inches per minute to hit zero on my setter indicator or kiss the part. It’s what I currently do with the mouse in Axis. I’m planning to use physical buttons for xyzbc. Hopefully no need to use the mouse at all for jogging.

-Doug

Please Log in or Create an account to join the conversation.

More
11 Jun 2020 21:56 #171186 by andypugh
Replied by andypugh on topic Change jog speed while jogging?
[quote="Doug Crews" post=171070I would like to push a physical jog button for z-minus have it jog at maximum speed and when I start to get close to the part or toolsetter I dial down the jog speed eventually down to 0.3 inches per minute to hit zero on my setter indicator or kiss the part. It’s what I currently do with the mouse in Axis. I’m planning to use physical buttons for xyzbc. Hopefully no need to use the mouse at all for jogging.[/quote]

Take a look at the SImple Remote Pendant for how to do that. The details will be different, but the idea is the same:
wiki.linuxcnc.org/cgi-bin/wiki.pl?Simple_Remote_Pendant
The relevant part is section 5, which shows how to select a jog speed.
If you want the jog speed to be continuously variable, then the trick would be to set the encoder scale accordingly, then pass the "position" to the jog speed pins.
You might want a "lincurve" component to reverse, limit and de-linearise the encoder position. (so that 0 counts is full speed, and -100 counts is zero speed. And -110 is still zero, and +100 is still only full speed)

Please Log in or Create an account to join the conversation.

More
12 Jun 2020 02:20 #171207 by Doug Crews
Replied by Doug Crews on topic Change jog speed while jogging?
Andy, there should be something more than just saying thanks (if we all bought you a beer it would probably be somewhere between a 40 semitrailer full or quite possibly a container ship…!).

I’m just blown away by the years of support you have given. Not limited to just you, I could make a list of the others and I just might. It’s been such an interesting journey reading through the years of postings. Yesterday I found cncnoob1979 Bridgeport retrofit, his panel seemed to be what I was aiming for so I started reading it from the beginning. I found he had nearly all the identical speed bumps I have had. I was staring at his z-axis jog speed control .hal code trying hard to get my head around the mux components when you replied pointing me to the exact spot in the wki for clear info.


Anyway, Success! I’ve got it working on one test axis. I’m using the mux component, I figure I need to get some level of competence with that component before going into your even better suggestion.

I’m now curious if I could expand this mux type selection to include a separate set of jog speeds for each axis. My two rotary axes (b&c) rapid jog speeds are very different from each other and also from xyz. I’m thinking of two selector switches, one for selecting axis and the other selecting the jog speed to use on the selected axis. It’s similar to a standard MPG setup, the difference is that each axis has its own 3 speeds that differ from the others. Now that I’ve written it out it seems there must away to do this because the rotary axis use different units than the linear ones.

If you had a gut feel on whether this it’s a go or a no-go that would be enough for me.

I think its best that I plan a spot on the panel for the selector switch.

Have great evening. Wish I could buy you that beer
-Doug
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

More
12 Jun 2020 16:07 #171274 by Doug Crews
Replied by Doug Crews on topic Change jog speed while jogging?
After sleeping on it (sort of sleeping).. It would be a drag to haft to use the axis selector switch. I think I can figure out a way to expand on the existing mux jog speed selection to have each jog button go to a set of jog speeds.
-Doug

Please Log in or Create an account to join the conversation.

Time to create page: 0.073 seconds
Powered by Kunena Forum