-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reprapworld Keypad: Prevent key-mashing issues? #3957
Reprapworld Keypad: Prevent key-mashing issues? #3957
Conversation
7cabc7e
to
8e441ff
Compare
The only things that need some work are:
|
Also : if I press stop on the display it stops for half a second and then continues. |
The silly stop behaviour is not affected by disabling the keypad. so that has some other cause. |
There's no definite method for Marlin to check for "is printing" during host printing, only during SD printing, so it's not easy to disable the "home" button based on that. So I suppose it does have to be disabled based on the axes already being homed with |
Do you mean that it does this during manual moves from the LCD, or if you try to stop a print in progress? |
Probably just keeps adding more homing commands. Do the keys behave in such a way that you have to repeatedly tap them to get movement, or can you hold them down? It seems to me we should treat keypad events more like debounced keyboard (or button) events and less like generic controller-knob events. |
It is when a print is in progress.
this is only after a stop print is done(as above), and it is continuing its print. You can hold the key down, and it will do steps, for 10mm increments it will eventually do 1 move and not X steps |
I just tested the stop sd print behaviour on a "fresh" install and it happens also. new code in RCbugfix. |
When you use "Stop print" it should turn off all the heaters, kill SD printing, and show "Print aborted" on the LCD screen. I can't see any reason why Marlin would keep reading from the SD card after that point. I've made some additional changes to this PR (and branch):
So give this a test and make sure it won't allow homing in the middle of a print. The "Stop print" problem should be reported as a separate issue. |
bdc9c06
to
19c4166
Compare
@maukcc Looking forward to your feedback as soon as you can get this tested. |
OK, I am back to RCbugfix :)
G28 command does silly things (move X,Y and Z 10mm in + direction) when using the keypad now and I press and hold the button, it will not do anything until I release the button and then it moves Xmm. It used to move while I held the button down and stop when released(much better) It uses the default REPRAPWORLD_KEYPAD_MOVE_STEP which I (as user) want to control. I cant test more as it does not home |
Instead of |
19c4166
to
8117aa3
Compare
OK, using that PR
has to be:
but then the LCD did not work so I can not test further. |
8117aa3
to
a32c5e3
Compare
Sorry to hear the LCD is acting up. I've made the change you pointed out. Test again as soon as you have a working LCD. |
My LCD is working fine. It is just not working with this firmware :) |
@maukcc In what way is it not working? Are you able to make any tweaks or experiment with different options to get it working? What kind of LCD is it? |
Calling in testers from various online RepRap groups…. Let's get this thing tested and merged! |
My display was left out :)
|
How would you propose we change this? Do you want an option to change the distance per click from the menu?
That was absolutely my intention. I'm glad to hear that it's working as intended. From here I will need to work out a reasonable method to have an axis continue to move while the key is held down. But for now, this is what I wanted.
Perhaps. I will have a look at this. Did you try pressing multiple keys at once to see how it behaves? |
This is where the F1(move menu) button is/was for? unless:
if you are making it: the longer you press the button the faster it goes. and every step is 0.1.
I did not, but have now . I can not get it to do silly things :) |
I like your interface idea. Tap to move one small step, but hold down for a continuous, moderately accelerating, move after a half-second or so. I could do that. (Another option is to use a fast double-tap for 10mm, or a single tap for 1mm, removing the need to tap 10 times, or hold and wait, to move 10mm.) |
022206c
to
c7bd8e2
Compare
c7bd8e2
to
9844482
Compare
Here is the outcome of the serial debug
|
@maukcc From the log it appears that the keypad's buttons cannot be held down. The key bits appear to register a brief "on" signal then clear themselves until the next time you tap the key. So, no key repeat is possible with this hardware. Just to be sure, I've sent an email to ask whether there's some way to get persistent bits. |
This is how it works in RC6: |
9844482
to
653f1a5
Compare
@maukcc Hmm! I am surprised to see the key "repeating." The loop in the new code is very explicit about continuing for as long as any key is held down, and yet it exits the loop. Between your video of RC6 and the results of the log it looks lot like the keypad is continually sending on-off-on-off for the pressed key. But just to be sure, I've added even more logging to show us the actual keypad bits as they change. I also went one level up and added logging for the initial key press. After you test with this logging, we will know much more about how this keypad actually works. |
Here is the outcome of the new serial debug
|
e399555
to
57a7436
Compare
The bit logging was a little strange that time. I intended that it should only output the bits when they change. Maybe that part was working properly, but I made an error in not using a static string to store the hex output, so the printed values are bogus. Now that I've patched it up properly, please run the new code once more! Try the X, Y, and Z buttons so we get a good sampling of the bits. |
57a7436
to
e9cf0a5
Compare
I got a reply from tech support:
… and in reply to my saying we'd keep working on it …
|
Further info from Bart Meijer:
I have described our scenario, linked to this code, and provided our shift-register reading code for additional feedback. |
Here is the outcome of the new serial debug testX file:
testY file:
testZ file:
testMoveMenu file:
|
Darn-it, I'm sorry. Those HEX numbers are still screwy. There should only be 2 digits, for one thing. I need to debug the debugging code. How ironic. I got another reply from the maker of the keypad. He sent a piece of code that confirms we are reading the keypad the correct way. So, now I just have to get that hex output working correctly, and we can do one more test… |
We will be closed for holidays in August. |
@maukcc Thanks! That will help a lot. I really want to make this keypad work as well as possible. I'm unable to create an account because the form requires impertinent information, and I don't currently have an address of my own anyway, so you will have to ship care-of my friend's studio. Send me your email address using my contact form and I will send you my shipping address. |
Did you receive the UI? |
@maukcc Unfortunately for the UI I've been in Austin, Texas since mid-August, but I'm heading back to Portland next week. I've got to settle some affairs while I'm there, but I'm sure I will have plenty of spare time to work with the UI too. |
Did you have a chance to test the UI with the keypad? |
Addressing #3915
Pressing the Home key while also pressing a movement key can cause an axis to run out of control. This patch attempts to address the problem by preventing re-entrant handling of keypad moves, based on the speculation that this is the main reason for the anomalous behavior.
Additionally, this patch reduces the code for implementing keypad-based axis movement.
Download ZIP: https://github.com/thinkyhead/Marlin/archive/rc_reprapworldkeypad_tweaks.zip