Dynamic jog speed from HAL, Possible?

More
2 years 2 months ago #308207 by slowpoke
I have a physical pot that is driving halui.axis.jog-speed.

Implementation in postgui.hal is as follows:

# Jog Speed
loadrt scale count=1
addf scale.0 servo-thread
setp scale.0.offset 0.0
setp scale.0.gain 0.12
net jog-pot-in scale.0.in <= arduino.ain.0
net jog-speed halui.axis.jog-speed <= scale.0.out

This works in the sense that I can change the jog speed and then the next jog will use that speed. however if while jogging I tweak the jog speed value with the pot, halui.axis.jog-speed changes however the actual speed does not change (until the next jog). Is there a way to make the jog speed follow the pot/halui.axis.jog-speed value while jogging?

Please Log in to join the conversation.

More
2 years 2 months ago #308214 by Aciera
This certainly works for me using panel buttons connecting to hal pins 'halui.axis.L.plus' and 'halui.axis.x.minus'.
Push the jog button and simultaneously change the jog speed with the potentiometer from 0..100%

[edit]
Just noticed that I also feed the potentiometer signal to 'gmoccapy.jog.jog-velocity.direct-value'. So maybe Gmoccapy has something to do with it.

Please Log in to join the conversation.

More
2 years 2 months ago #308217 by spumco
Maybe setting axis.L.jog-vel-mode to TRUE would cause in-process jogging to respond to speed changes?

Please Log in to join the conversation.

More
2 years 2 months ago #308252 by slowpoke

This certainly works for me using panel buttons connecting to hal pins 'halui.axis.L.plus' and 'halui.axis.x.minus'.
Push the jog button and simultaneously change the jog speed with the potentiometer from 0..100%

[edit]
Just noticed that I also feed the potentiometer signal to 'gmoccapy.jog.jog-velocity.direct-value'. So maybe Gmoccapy has something to do with it.
 
I found a note somewhere that stated in axis the feed slider responds to halui.feed-override.increase and .decrease, however I'm using a pot feeding halui.axis.jog-speed not up and down buttons, so I think I'm out of luck with axis, unless there is some other method?
Thanks for the input.

Please Log in to join the conversation.

More
2 years 2 months ago #308254 by slowpoke

Maybe setting axis.L.jog-vel-mode to TRUE would cause in-process jogging to respond to speed changes?
 
Thanks for that, I tried but  axis.L.jog-vel-mode  does not help.

At least the feed-override acts dynamically, it even updates the slider in Axis when I twiddle the pot

Please Log in to join the conversation.

More
2 years 2 months ago #308257 by Benb
halui.axis.jog-speed - This pin is for setting jog speed for plus/minus jogging.

To jog an axis you need to select axis, set jog speed using potentiometers and press plus or minus push button (PB) to jog axis. 

Most CNC machines built using Linuxcnc use joint (There is a whole spiel about axis/joint, google it if you would like to learn more about it).

Attached are function blocks of halui pins for axis to help visualize the jungle of pins. Halui has over 100 pins, I divided the related pins into function blocks to ease the visualization.For your info I added an external hadwired PB and UI widgets for +/- jog, you can use either or both.
 

Attachment not found



Linuxcnc hal netlisting 

# Load realtime Components and their counts
loadrt or2          count= 2
loadrt scale        count= 1

# Add functions to threads
addf or2.0                    servo-thread 
addf or2.1                    servo-thread 
addf scale.0                  servo-thread 

# Set parameters
setp scale.0.offset                              0.0   
setp scale.0.gain                                0.12    

# Connect Pins with hal signals/Wires
net arduino.ain.0              scale.0.in  
net axis.sel.z.sw               halui.axis.z.select  
net axis.speed.minus       halui.axis.selected.minus  or2.1.out  
net axis.speed.plus           or2.0.out  halui.axis.selected.plus  
net axis.x.sel.sw                halui.axis.x.select  
net axis.y.sel.sw                halui.axis.y.select  
net halui.axis.jog-speed   scale.0.out  halui.axis.jog-speed  
net minus.speed.pb          or2.1.in0  
net minus.speed.ui           or2.1.in1  
net plus.speed.pb             or2.0.in0  
net plus.speed.ui              or2.0.in1  
 

Please Log in to join the conversation.

Time to create page: 0.158 seconds
Powered by Kunena Forum