jog speed via joypad and pyvcp-keys

More
24 Apr 2021 14:39 #206953 by guido-52
Hallo,
I would like to jog via joypad and / or via the pyvcp keys.


I have two values, "pyvcp.jog-speed-f" coming from the panel and "joy_mux4.out" coming from the joypad.

The intention was to select the correct speed via a "mux2".
I came up with this construction;

net keuze_joy <= joy_mux4.out => mux2_s.in0
net keuze_toets <= pyvcp.jog-speed-f => mux2_s.in1



A message that "mux2_s.in0" does not exist

But as you can see in the screenshot, the "halmeter" does show this pin.
So,
With a "#" in front of the lines start axis, and the barometer indicates the pin.
Without the "#" I get the error.

Anyone have any idea what's going on?

Regards
Attachments:

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

More
26 Apr 2021 08:53 #207087 by guido-52
Hey,
Does anyone have any idea how I can fix it?
So I just want to select one of the two pins, depending on another pin.
Normally I would think this can be solved simply via a "mux2"

I am quite new to programming in linuxcnc so I try to go step by step.

So I create a "mux2;
- loadrt mux2 names=joy_op_af
- addf joy_op_af servo-thread
I start up and see through the halmeter;
that's the pin's joy_op_af.in0, joy_op_af.in1, joy_op_af.in0.out and joy_op_af.sel are made.

then i want to assign the variables to the pin's;
- setp joy_op_af.in0 100.0
- setp joy_op_af.in1 1000.0
but then axis won't start up, with the error that the pins don't exist.

for speed selection I use;
- loadrt mux4 names=joy_mux4
- addf joy_mux4 servo-thread
- setp joy_mux4.in0 0.0
- setp joy_mux4.in1 30.0
- setp joy_mux4.in2 150.0
- setp joy_mux4.in3 300.0

and that works, where is the difference?

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

More
26 Apr 2021 17:21 #207141 by guido-52
Hey,
After a lot of struggling I went a step further .....
Axis will now start up and the pins have the correct value
But now I run into the following problem .....

- setp joy_op_af.in0 pyvcp.jog-snelheid-f
- setp joy_op_af.in1 joy_mux4.out

in other words referring the set speed via joypad and pyvcp-slider to the two inputs of the mux is not possible.

"value 'pyvcp.jog-snelheid-f' invalid for flow"

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

More
27 Apr 2021 19:51 #207251 by Joco
Have a look at this thread. There may be some inspiration in the config used.

forum.linuxcnc.org/47-hal-examples/40280...gamepad-as-a-pendant

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

More
29 Apr 2021 08:35 #207355 by guido-52
Hey,
Thanks for the response, in the end it worked out for me too.
it is a certain learning process that I have had to go through, not always that easy.

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

More
01 May 2021 21:19 #207573 by andypugh
Sorry for the late reply. What was the problem?
My first guess would be that you were trying to use the mux2 in the HAL file before it was loaded?

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

More
02 May 2021 05:58 #207600 by guido-52
thanks for the follow-up, indeed a beginner's mistake .....

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

Time to create page: 0.106 seconds
Powered by Kunena Forum