gerritv / Grbl-Panel

A control panel for Grbl
MIT License
180 stars 102 forks source link

Manually control stepper motor with joystick #115

Closed Camerutttt closed 7 years ago

Camerutttt commented 7 years ago

Hey I was wondering if it is possible to manually control a stepper motor with a joystick.

Right now, all I am able to do is to make the stepper motor turn for a certain number of revolutions when my joystick is pushed in a certain direction.

I want to make it such that the stepper motor will keep on turning for as long as I push my joystick and stop when I release my joystick.

tklus commented 7 years ago

I am currently using a joystick to run my machine and I can set the step distance to .1 inches and just hold the joystick and it will feed until I release the joystick.

there is a setting for the repeat rate when the joystick is held so you might be able to adjust that.

are you using the latest version of GRBL and GRBL Panel?

Camerutttt commented 7 years ago

I think I got the latest version since I just downloaded it today.

Pardon me, but I am new to GRBL. So from what you have done, I assume you map your joystick to the computer arrow keys? Since that is how I do it. My joystick is the 1 with 4 switches, so when you push it in a particular direction, 1 of the switches will be activated. Also, all I have to do is change the distance to 0.1 inches and set it on repeat rate?

tklus commented 7 years ago

You are correct, I am just using a joystick and mapping to the key strokes. I will have to look at my repeat rates but that is something you can try.

Camerutttt commented 7 years ago

So all I have to do in the GRBL Panel is to adjust the distance to 0.1 like so: http://imgur.com/WMzKalX?

and to play around with the repeat rates and check the Enable keyboard arrows like so: http://imgur.com/9jYfjsr?

tklus commented 7 years ago

Yup, give it a shot. It works with my machine....

Camerutttt commented 7 years ago

Alright thanks for your help. Unfortunately, all my stuff arent with me right now so I will let you know how it goes later on.

sonnylowe commented 7 years ago

Wow, this is good stuff, thanks for sharing!!!

tklus commented 7 years ago

what key mapper are you using? that could be the issue as well. maybe there is a setting for repeat in that too.

I am using antimicro for my key mapping

Camerutttt commented 7 years ago

Hey I just tested it and it appears to be running quite smoothly. However, when I release the joystick, the stepper motor will still continue to run for a few seconds before stopping. So for this issue I should play around with the repeat rates?

I am using JoyToKey and yes, there is also a setting for repeat too.

Camerutttt commented 7 years ago

Also, is there a way to have a return to zero position button using an external switch?

tklus commented 7 years ago

You can set up macro buttons in GRBL Panel and maybe we can request to have these macro buttons mapped to certain keys on the keyboard.

Camerutttt commented 7 years ago

I know that I can set macro buttons but I am unsure of how to map them to my keyboard

tklus commented 7 years ago

This would be a feature we would need to request from Gerrit...

Camerutttt commented 7 years ago

So as of now there is no other way to do this? Maybe through something like UGS?

gerritv commented 7 years ago

Adding some more key codes is easy, can someone pick values? I have other features to add but those are taking a bit more thinking. I think macro 0 has a key map already.

tklus commented 7 years ago

How about 1-9 number keys? or however many macro buttons are available, not sure off the top of my head how many there are.

Thanks for the support! Tim

gerritv commented 7 years ago

Implemented, macros map to F2-F6