Jogging not working properly when not on preview tab
- snowgoer540
- Offline
- Moderator
Less
More
- Posts: 2388
- Thank you received: 779
28 Mar 2022 10:28 - 28 Mar 2022 11:09 #238518
by snowgoer540
While that is specifically in reference to QtVCP, I would suspect that the same issue with autorepeat is happening here. From memory when we were working this issue in QtPlasmaC, it seemed that different OS cause different interferences. At any rate, the halscope plot posted looks identical.
Try this:
1. When you are on a tab that causes the choppy jogging, open a terminal window.
2. In the terminal type:3. Try jogging again.
If the axis jogs fine, just to be 100% sure, you could:
4. In the terminal window type:5. Jog again, issue should be back
If "xset -r" solves your issue:
You can either turn off autorepeat entirely for the computer, or I believe you could run a custom python script on startup of Axis (called from the INI file).
For reference, all QtVCP screens disable autorepeat by default. QtPlasmaC disables autorepeat entirely, and the other QtVCP screens disable autorepeat for just the jogging keys.
The only issue I can see is that when you close Axis, autorepeat would be still be disabled. There is probably a way around that, but it would likely require editing Axis files to do so.
In case it helps here's the code from /lib/python/qtvcp/qt_action.py:
QtPlasmaC does use these functions, we just call ' ' for the key which disables/enables them all.
and to disable
Replied by snowgoer540 on topic Jogging not working properly when not on preview tab
I looked through the version 2.9 manual and found a spot that lists a known issue of keyboard jogging doing as you have described.
see section 4.7.18.1
2.9 manual
While that is specifically in reference to QtVCP, I would suspect that the same issue with autorepeat is happening here. From memory when we were working this issue in QtPlasmaC, it seemed that different OS cause different interferences. At any rate, the halscope plot posted looks identical.
Try this:
1. When you are on a tab that causes the choppy jogging, open a terminal window.
2. In the terminal type:
xset -r
If the axis jogs fine, just to be 100% sure, you could:
4. In the terminal window type:
xset r
If "xset -r" solves your issue:
Warning: Spoiler!
You can either turn off autorepeat entirely for the computer, or I believe you could run a custom python script on startup of Axis (called from the INI file).
For reference, all QtVCP screens disable autorepeat by default. QtPlasmaC disables autorepeat entirely, and the other QtVCP screens disable autorepeat for just the jogging keys.
The only issue I can see is that when you close Axis, autorepeat would be still be disabled. There is probably a way around that, but it would likely require editing Axis files to do so.
In case it helps here's the code from /lib/python/qtvcp/qt_action.py:
# Some systems need repeat disabled for keyboard jogging because repeat rate is uneven
def DISABLE_AUTOREPEAT_KEYS(self, keys={'34','35','80','81','83','85','88','89','111','112','113','114','116','117'}):
for k in keys:
subprocess.Popen('xset -r {}'.format(k), stdout = subprocess.PIPE, shell = True)
def ENABLE_AUTOREPEAT_KEYS(self, keys={'34','35','80','81','83','85','88','89','111','112','113','114','116','117'}):
for k in keys:
subprocess.Popen('xset r {}'.format(k), stdout = subprocess.PIPE, shell = True)
QtPlasmaC does use these functions, we just call ' ' for the key which disables/enables them all.
ACTION.ENABLE_AUTOREPEAT_KEYS(' ')
and to disable
ACTION.DISABLE_AUTOREPEAT_KEYS(' ')
Last edit: 28 Mar 2022 11:09 by snowgoer540.
Please Log in or Create an account to join the conversation.
05 May 2022 12:27 - 05 May 2022 12:35 #242033
by moh
Replied by moh on topic Jogging not working properly when not on preview tab
Sorry I haven't been replying to the comments, I don't seem to receive notifications on responds, so i though the thread was dead.
I will try the xset -r solution tomorrow.
In the mean time, I've tried to update to the newest linuxcnc 2.9 (with python3), which has made the situation a bit worse.
Now whenever I am in an embedded tab (havent tested DRO) the keyboard input is lagging by 1 command, which means any button press cycle registers as
<Key-Release>
<Key-Press>
Instead of the other way around, which makes the jogging motion run forever (until Escape is pressed).
I already crashed a probe through this.
Funny enough Arrow keys are not detected, only page-up + page-down (jog z) as well as Shift+Arrow (rapid x/y).
I found that key actions are lagging by 1, by nserting:
root_window.bind_class("all", "<KeyPress>", lambda e: print("P: " + e.keysym)
root_window.bind_class("all", "<KeyRelease>", lambda e: print("R: " + e.keysym)
into axis.
(Not at machine right now, so the lines are just from memory, and there may be an error.
I have no idea how to fix this.
I will try the xset -r solution tomorrow.
In the mean time, I've tried to update to the newest linuxcnc 2.9 (with python3), which has made the situation a bit worse.
Now whenever I am in an embedded tab (havent tested DRO) the keyboard input is lagging by 1 command, which means any button press cycle registers as
<Key-Release>
<Key-Press>
Instead of the other way around, which makes the jogging motion run forever (until Escape is pressed).
I already crashed a probe through this.
Funny enough Arrow keys are not detected, only page-up + page-down (jog z) as well as Shift+Arrow (rapid x/y).
I found that key actions are lagging by 1, by nserting:
root_window.bind_class("all", "<KeyPress>", lambda e: print("P: " + e.keysym)
root_window.bind_class("all", "<KeyRelease>", lambda e: print("R: " + e.keysym)
into axis.
(Not at machine right now, so the lines are just from memory, and there may be an error.
I have no idea how to fix this.
Last edit: 05 May 2022 12:35 by moh.
Please Log in or Create an account to join the conversation.
05 May 2022 12:45 #242036
by moh
Replied by moh on topic Jogging not working properly when not on preview tab
I've just looked through some more of the Axis code, and I see a lot of references to trivkins as kinematics module (search for kins_is_trivkins)
I'm not running trivkins, I'm running a custom kinematics (millkins, to compensate X and Y axes).
The machines run perfect in auto mode, so I'm pretty sure the kinematics module is functioning correctly, but maybe there is an issue between Axis, Embedded Tabs and Custom Kinematics?
I'm not running trivkins, I'm running a custom kinematics (millkins, to compensate X and Y axes).
The machines run perfect in auto mode, so I'm pretty sure the kinematics module is functioning correctly, but maybe there is an issue between Axis, Embedded Tabs and Custom Kinematics?
Please Log in or Create an account to join the conversation.
05 May 2022 22:47 #242081
by andypugh
Replied by andypugh on topic Jogging not working properly when not on preview tab
I think that is unlikely. The kins and the UI are very far separated in the system.maybe there is an issue between Axis, Embedded Tabs and Custom Kinematics?
Please Log in or Create an account to join the conversation.
06 May 2022 10:02 #242113
by moh
Replied by moh on topic Jogging not working properly when not on preview tab
I just tested by setting kinematics back to trivkins, and the issue persisted, so no luck there.
Also tried the xset -r command, but still no luck.
Does anyone have an idea of how to debug this?
I'm quite sure it has something to do with how keypresses are registered in axis/embedded tabs, but not sure how to proceed debugging.
If anyone has an idea on what information is needed to find the issue, then I'll make sure to provide that.
Also tried the xset -r command, but still no luck.
Does anyone have an idea of how to debug this?
I'm quite sure it has something to do with how keypresses are registered in axis/embedded tabs, but not sure how to proceed debugging.
If anyone has an idea on what information is needed to find the issue, then I'll make sure to provide that.
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19196
- Thank you received: 6434
06 May 2022 10:23 #242117
by tommylight
Replied by tommylight on topic Jogging not working properly when not on preview tab
Not sure how old the PC is, but check the BIOS for "typematic rate setting" or something similar.
Please Log in or Create an account to join the conversation.
06 May 2022 12:01 #242125
by moh
Replied by moh on topic Jogging not working properly when not on preview tab
Same situation on 2 different PC's.
Both are quite new (like 8.th gen intel core i5).
Cant see any BIOS setting for this option.
Both are quite new (like 8.th gen intel core i5).
Cant see any BIOS setting for this option.
Please Log in or Create an account to join the conversation.
07 May 2022 14:47 #242236
by moh
Replied by moh on topic Jogging not working properly when not on preview tab
Í dived deeper into xembed.py and keyboard_forward, and for some reason all keyboard forwards are lagging by an event in axis.
If i print the event passed to fw.send_event(fe) (in xembed.py) and the events detected in axis.py, then I can see that axis is detecting a previous event and not the most recent.
But even if i modify xembed.py to send duplicate events (2x fw.send_event(fe)), then axis will still detect the previous keypress/keyrelease on both events.
No idea how to solve it, so for now i just disabled keyboard_forward to avoid dangerous movements.
If i print the event passed to fw.send_event(fe) (in xembed.py) and the events detected in axis.py, then I can see that axis is detecting a previous event and not the most recent.
But even if i modify xembed.py to send duplicate events (2x fw.send_event(fe)), then axis will still detect the previous keypress/keyrelease on both events.
No idea how to solve it, so for now i just disabled keyboard_forward to avoid dangerous movements.
Please Log in or Create an account to join the conversation.
Time to create page: 0.086 seconds