7i76e: MPG and Analog inputs with pncconf?

More
7 years 9 months ago #124055 by phillc54
You can access that slider from python via a .axisrc file in your home directory or by a file pointed to by USER_COMMAND_FILE in the [DISPLAY] section of your ini file.

Defaults are:
lower value = 0.06
upper value = 1.0
resolution = 0.02

To change some/all of these: (upper value should not be > 1)
Code:
root_window.tk.call('.pane.top.jogspeed.s','configure','-from','0.01','to','1.0','-resolution','.010')

To read the current value:
Code:
value = float(root_window.tk.call('.pane.top.jogspeed.s','get')) print 'value =', value

To set a new value:
Code:
value = 0.75 root_window.tk.call('.pane.top.jogspeed.s','set',value)

You can also define a function that is called every time Axis updates itself:
Code:
def user_live_update(): print float(root_window.tk.call('.pane.top.jogspeed.s','get'))

Cheers, Phill.
The following user(s) said Thank You: trilobyte

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

More
7 years 9 months ago #124064 by trilobyte
@cmorley: it works now!

i made a working setup with the fixed pncconf. the mpgs for x and z are working, i can set the step width via two inputs.

i also have now the joystick wired to 4 inputs. pncconf made a setup with a fixed value for jog speed:

"net jog-speed halui.axis.jog-speed"
"sets jog-speed 100.000000"

this jog function is different to the arrow keys on the keyboard.
that's not what I expected, but it is no problem.

the question is: can i set this value für jog-speed with the analog input?

@phillc54: tnx for this explanation. maybe i can use this function to move the slider to the same value as the jog-speed has

peter

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

More
7 years 9 months ago #124065 by cmorley
You would need to scale the analog input to range of the max jograte required.
then connect the scaled rate to the signal 'jog-speed'

analog_input -> scaled component -> jog-speed

You'll have to look up the actual pin names and component detail.
they would probably be best to put in the postgui_hal file

Other's may have better ideas.

Chris M

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

More
7 years 9 months ago #124111 by rodw
Read up on the halui component. I think it will do what you want!

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

More
7 years 9 months ago - 7 years 9 months ago #124112 by trilobyte
it is working now! tnx guys!


i have this in the custom postui hal:

setp hm2_7i76e.0.7i76.0.0.analogin3-scalemax 460
net halui.maxjoganalog <= hm2_7i76e.0.7i76.0.0.analogin3 => halui.axis.jog-speed

something is a bit strange: if i start linuxcnc i can run a cnc programm without a homeing sequene (the last position is stored) but i can't move the machine with the mpg and the joystick.
with the arrow keys on the keybord it is possible directly after starting the machine.
mpg and the joystick are working after a homeing sequence, or after starting an stopping a ngc file!?


Peter
Last edit: 7 years 9 months ago by trilobyte.

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

More
7 years 9 months ago #124113 by phillc54

trilobyte wrote:
it is working now! tnx guys!
i have this in the custom postui hal:
setp hm2_7i76e.0.7i76.0.0.analogin3-scalemax 460
net halui.maxjoganalog <= hm2_7i76e.0.7i76.0.0.analogin3 => halui.axis.jog-speed

I am a bit confused as I have an up to date version of master and changing the value of halui.axis.jog-speed has no effect on the jog speed slider in Axis.

Cheers, Phill.

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

Moderators: cmorley
Time to create page: 0.130 seconds
Powered by Kunena Forum