Hello Guest it is March 29, 2024, 03:51:55 AM

Author Topic: Rotator switch for Jog increments  (Read 1739 times)

0 Members and 1 Guest are viewing this topic.

Rotator switch for Jog increments
« on: February 02, 2022, 07:20:36 PM »
Okay,

Read a bunch of topics on pendants and assigning buttons in screen4 etc but can't find specifics on assigning mach3 commands for an external rotary switch for Jog increments.

Maybe it's just not possible? (Think it would be with all the fancy pendants out there).

I have a 3 position switch next to my MPGs and just want to switch jog from 1.00, 0.10 and 0.01 increments from the dial.

Dial is a single pole 5V switch.
Wired to ports 7, 8, 9 on a C10 board (run through a ESS from warp9)
And I put buttons on the mach3 MPG screen already. I tried assigning hot keys but no luck.

Also tried searching for vBscript code to put in, but couldn't find what I needed ( and to be honest, don't really have an idea on what I am looking for lol).

Thanks,

Kyle

Photos are attached.
Re: Rotator switch for Jog increments
« Reply #1 on: February 02, 2022, 07:25:10 PM »
Won't let me attach files..
Re: Rotator switch for Jog increments
« Reply #2 on: February 02, 2022, 07:30:22 PM »
Other photo
Re: Rotator switch for Jog increments
« Reply #3 on: February 03, 2022, 01:22:05 AM »
Hi,
do you actually use the switch?

I had previously used a VistaCNC P1A pendant, and it had a switch for changing jog increments....which I hardly ever used. So much so
that I basically wore the pendant out and that switch is still new.

When I made my own pendant I just have a single sprung loaded toggle switch for jog mode. In the normal position it is in Incremental
mode, and I have found that 0.05mm to be almost prefect, fast enough to jog a reasonable distance and yet sufficiently fine to touch off
for anything but the most demanding of jobs. With the switch in the off-normal (sprung) position the machine is in Velocity jog mode,
which is great for traversing big distances....but absolute disaster for touching off, hence releasing the toggle switch and the machine
reverts to the much safer Incremental mode. The switch requires one, just one, signal wire, too easy!

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Rotator switch for Jog increments
« Reply #4 on: February 03, 2022, 01:25:58 AM »
Hi,
do you actually use the switch?

Craig

Hey Craig!

Yep I will, I do some cutting manually with my mpgs. Computer is on the far end of the lathe and walking back and forth to swap is a pain 😂.

The switch is what I got and is fully wired in currently so putting some code in or assigning proper buttons seems the easy route 🤔

Thanks,

Kyle

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: Rotator switch for Jog increments
« Reply #5 on: February 03, 2022, 06:26:58 AM »
ok let's make an example

0,01 input is assigned to OEMTrigger(10)
0,10 input is assigned to OEMTrigger(11)
1,00 input is assigned to OEMTrigger(12)

and these three stepp are confgured in Config -> General Config -> Jog Increments

then you create in macros\your profile name a textfile named M300.M1S
then open this file with texteditor and put this code in:

Code: [Select]
SetTRiggerMacro(301)

now go to Config -> General Config -> Initialisazio String and enter M300  at the end of the existing.

then you create in macros\your profile name a textfile named M301.M1S
then open this file with texteditor and put this code in:

Code: [Select]
Sub Main()

  If IsActive (OEMTRIG10) Then
    dooembutton (191)
  End If

  If IsActive (OEMTRIG11) Then
    dooembutton (192)
  End If

  If IsActive (OEMTRIG12) Then
    dooembutton (193)
  End If

End Sub

save the file and restart Mach, and with a little bit of luck it will work.

If M300.M1s and M301.M1s is allready there chose any free number.


anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Rotator switch for Jog increments
« Reply #6 on: February 03, 2022, 02:00:21 PM »
ok let's make an example

0,01 input is assigned to OEMTrigger(10)
0,10 input is assigned to OEMTrigger(11)
1,00 input is assigned to OEMTrigger(12)

and these three stepp are confgured in Config -> General Config -> Jog Increments

then you create in macros\your profile name a textfile named M300.M1S
then open this file with texteditor and put this code in:

Code: [Select]
SetTRiggerMacro(301)

now go to Config -> General Config -> Initialisazio String and enter M300  at the end of the existing.

then you create in macros\your profile name a textfile named M301.M1S
then open this file with texteditor and put this code in:

Code: [Select]
Sub Main()

  If IsActive (OEMTRIG10) Then
    dooembutton (191)
  End If

  If IsActive (OEMTRIG11) Then
    dooembutton (192)
  End If

  If IsActive (OEMTRIG12) Then
    dooembutton (193)
  End If

End Sub

save the file and restart Mach, and with a little bit of luck it will work.

If M300.M1s and M301.M1s is allready there chose any free number.

Okay, this is promising but didn't work. Likely didn't work cause I don't have a setting proper haha.

In ports and pins what do I assign for the OEM Triggers?

In hot keys what do I assign?

And lastly, the buttons in screen4 are they correct?

I attached photos of each place. The two scripts are in the mach3 turn profile under macros. And I attached a photo of the initialization screen - is that right?

Thanks!

Kyle
Re: Rotator switch for Jog increments
« Reply #7 on: February 03, 2022, 02:00:48 PM »
Last photo.

Offline MN300

*
  •  297 297
    • View Profile
Re: Rotator switch for Jog increments
« Reply #8 on: February 03, 2022, 05:51:34 PM »

Here is my crazy idea for the day, inspired by something Kfischer wrote.
Quote
Yep I will, I do some cutting manually with my mpgs.

It would be possible to use a 2 axis analog joystick and an Arduino to generate two quadrature signals with their speeds proportional to the joystick X and Y positions. If the MACH software can handle two encoder signals at the same time you could drive your spindle in any direction, at a controllable rate.

I played with an Arduino Nano this afternoon and generated a 4000 step per second quadrature signal.
Using Graig's suggested increment of 0.05mm, a 1 cm per second travel speed would only need 200 steps per second.

This looks like an affordable joystick. Better but more expensive ones are available.
https://www.digikey.com/en/products/detail/adafruit-industries-llc/3102/6152821.

Is this just a crazy idea or might someone actually find it useful?

John
Re: Rotator switch for Jog increments
« Reply #9 on: February 03, 2022, 09:20:05 PM »

Here is my crazy idea for the day, inspired by something Kfischer wrote.
Quote
Yep I will, I do some cutting manually with my mpgs.

It would be possible to use a 2 axis analog joystick and an Arduino to generate two quadrature signals with their speeds proportional to the joystick X and Y positions. If the MACH software can handle two encoder signals at the same time you could drive your spindle in any direction, at a controllable rate.

I played with an Arduino Nano this afternoon and generated a 4000 step per second quadrature signal.
Using Graig's suggested increment of 0.05mm, a 1 cm per second travel speed would only need 200 steps per second.

This looks like an affordable joystick. Better but more expensive ones are available.
https://www.digikey.com/en/products/detail/adafruit-industries-llc/3102/6152821.

Is this just a crazy idea or might someone actually find it useful?

John

Would have went with something like this before investing in what I got.

Oh well, gunna make this work and be happy 😊 hahaha.!