Machsupport Forum

Mach Discussion => Mach SDK plugin questions and answers. => Finished Plugins for Download => Topic started by: area51 on October 06, 2010, 09:22:25 PM

Title: USB JoyPad and game device plugin - new version!
Post by: area51 on October 06, 2010, 09:22:25 PM
The USB JoyPad, joystick and game devices plugin has been updated to version 1.0.

News in this version:

Download the plugin, user manual and example macros from this post (bottom).

The JoyPad plugin supports most DirectInput (Microsoft DirectX) game devices with joysticks and buttons. The game device can be connected via the game port, USB or wireless.
I have tested with the Dual Action JoyPad from Logitech but I know other game devices will work as well.

In short the JoyPad plugin supports:

Tested on Windows XP SP3 but I assume that all newer Windows versions will work as long as Mach3 supports them.

Special tanks to Lee and Greg Cary for the help making the SmoothStepper jog code work.

Downloads:
JoyPad_1.0.zip - The plugin - unzip and double click to install.
User_manual_1.0.pdf - The user manual.
Macros_1.0.zip - ZIP file with button macro files and VBScript examples.

Hope you find this plugin useful  :)

- Joakim
Title: Re: USB JoyPad and game device plugin - new version!
Post by: pedropin on October 08, 2010, 05:04:43 PM
Area51
thank you very much for the contribution of the plugin good job.
I have poblem example:
To  Cycle Star (Alt-R)      macro M801   DoButton 0 push buttons 1 and perfect.
To  Rewind     (Ctrl-W)   macro M802   DoButton 2 press button 2 and perfect.
To Stop         (Alt S)      macro M803  DoButton 3 Press button 3 does not work.
To Reset                       macro M804  DoButton 21 push buttons 4 and runs but 4 pulse again and reset button does not return to normal.
use the version R3.042.020
 4 axis 12 buttons

Thank you very much
A special greeting to all.

pedropin
Title: Re: USB JoyPad and game device plugin - new version!
Post by: area51 on October 08, 2010, 09:25:50 PM
pedropin.

Thank you very much for the feedback - I need feedback like this to make the plugin better... don't hold back  ;)

I can explain why M803 is not working.
The plugin only allows joysticks and button action, when the machine is idle and not in EStop.
This is done (by design) to prevent unintended interruption of a running program... and is the situation with M803 (Alt S).

This is a limitation on normal button usage and I intend to remove this restriction, but only for buttons.

DoButton 21 will not work because the machine is in EStop - It is possible to allow button actions when in EStop, but I'm not sure if this is a wise decision.

I plan to release an new version, when there has been more feedback.

Hope this helps.

- area51
Title: Re: USB JoyPad and game device plugin - new version!
Post by: wvancura on October 09, 2010, 10:43:10 PM
Area51,
I have a 2-axis joypad with 10 buttons and a POV. I installed the new driver and updated MS DirectX as you have suggested. All 10 of the buttons work as expected, and there is carriage movement with the POV+(5/6). The POV buttons, however, do not seem to activate macros M821-M828 or M871-M878. I tried this on two different systems (XP-Pro and Win2K) and the results are the same.  I had one set up with a custom configuration and the other with the default. The only thing these macros do at this time is try to post a message. I must be doing something consistently wrong. Is it possible that the POV buttons are looking for the macros in a different place? Currently all of the joypad macros are in the same configuration directory as the other common macros.

BTW. The manual is terrific!

Once I get the POV button macros working, would it be possible/reasonable to activate a macro (say M829 and M879) when the POV returns to center?

Thanks, Bill
Title: Re: USB JoyPad and game device plugin - new version!
Post by: area51 on October 10, 2010, 07:31:18 PM
Hi wvancura.

Great that axes and buttons work :)
Does the POV act as joystick and move axes?
This could be the problem.

On the Logitech Dual Action I can select if the POV and first joystick changes places via a mode button. The POV can only be used as joystick (moving axes) or as buttons (calling macros), not both at the same time.

How many buttons are there on the POV?
( Logitech Dual Action has 8 )

- Joakim
Title: Re: USB JoyPad and game device plugin - new version!
Post by: wvancura on October 10, 2010, 08:55:19 PM
Joakim,
The POV will, according to the diagnostics, output 8 directions. The pad does move the X & Y axes in 8 different directions. I presume that the POV is really only 4 physical buttons where at most two adjacent buttons can be selected at the same time.

Selecting "not mapped" for X & Y does kill the axis movement, but does not activate the POV macro mode. When I open the configuration window, the POV 1 message always appears, but never at any other time. The joypad does appear to be active while in setup mode  but changes do not take effect until the setup window is closed.

Thanks,
Bill

Title: Re: USB JoyPad and game device plugin - new version!
Post by: area51 on October 12, 2010, 02:46:27 AM
Wvancura,

that explains why the POV behaves as it does. Microsoft DirectInput (or game device driver) finds a POV, but decides to use it as joystick - in this case X- and Y-axe. The JoyPad plugin gets the information that a POV exist but get no POV signals (buttons) as the POV is already used as a joystick.
Disabling the X- and Y-axe in JoyPad configuration only ignores signals from the joystick but doesn't reassign its function.
On the Logitech Dual Action JoyPad is a button to reassign POV the function (switch with first joystick) - maybe there is a similar option on your game pad, on the device or in Control Panel.

When changes is made in JoyPad configuration it is saved when the dialog is closed, not before.
The changes is saved in Mach3 memory and is first permanently when Mach3 exits.

Hope thes helps.

- Joakim
 
Title: Re: USB JoyPad and game device plugin - new version!
Post by: wvancura on October 12, 2010, 10:12:37 AM
Area51;

The POV functionality is not configurable on this low budget unit.

It seems a waste that the POV is not usable for something without buttons 5/6 being pressed. However, the POV is a sloppy interface and trying to utilize it may not be worth the effort.

Thanks for all of your help.
Bill
Title: Re: USB JoyPad and game device plugin - new version!
Post by: area51 on October 12, 2010, 03:39:05 PM
Wvancura,

at the point where the JoyPad plugin gets data from DirectInput it can't see if input came from the POV (acting as joystick) or a real joystick - the data is presented as joystick input.
This is the reason why the safety buttons (5 and 6) are in effect.

USB game devices with two analog joysticks and POV are also very low budget units - I have seen prices below $10 on eBay.
This is one of the reasons why I started this plugin development ;)

- area51
Title: Re: USB JoyPad and game device plugin - new version!
Post by: Fiero Addiction on December 02, 2010, 02:46:09 PM
Thanks for the great plug-in! I just happened to have a Logitech Dual Action that came bundled with a PC, I'm not much of a gamer so I never had any use for it until I discovered this plug-in. It's exactly what I needed for my plasma machine, it lets me quickly and easily move the torch to the starting point of the material.

I think you should add a config option to allow the user to enable certain button presses while in E-stop or while program is running. It's not a feature I really need right now, but I can see how it could be usefull for stop and reset buttons. Maybe each button could even have settings independent of the others.
Title: Re: USB JoyPad and game device plugin - new version!
Post by: area51 on December 12, 2010, 06:32:33 PM
Thanks  :)

A new version is underway with focus on button setup; making it a lot easier to configure and assign functionality to buttons.
With a lot of help from atifeh we have predefined a standard setup for button assignment and buttons will be active even in EStop.
It will still be possible to program all buttons with script but for most common functionality no scripting is necessary - only assignment in a new setup program.

The new version will be posted in a new thread in this forum... soon...

- area51
Title: Re: USB JoyPad and game device plugin - new version!
Post by: wyzarddoc on December 30, 2010, 04:59:54 PM
area51;
Thanks for a great plug-in/macro it worked right out of the box just like the instructions described. I have decided to just output a button function message unless button 5 or 6 is pressed. Question I would like to change the right hand joystick axis to swap the Z and A joystick positions. Is this possible??
thanks
Doc
 
Title: Re: USB JoyPad and game device plugin - new version!
Post by: area51 on December 30, 2010, 09:10:22 PM
Thanks  :)

Question I would like to change the right hand joystick axis to swap the Z and A joystick positions. Is this possible??

In the JoyPad plugin configuration you can map all joystick axes to Mach3 axes - just set it up there (swap A and Z axe). If the axe is going the "wrong" way just invert it (check box).
You may have to restart Mach3 to reread the new setting before it takes effect.

Happy to have feedback from one using the plugin - tanks again.
At the moment I am working with Atifeh on a new version with a LOT of improvements, especially button assignment. Scripting is to difficult for most users. I hope to release soon as we are testing now...

- area51
Title: Re: USB JoyPad and game device plugin - new version!
Post by: Greolt on January 14, 2011, 02:16:16 AM
Joakim

Bought a JoyPad off ebay, for the total price of $5 shipped to Australia.  Just for the fun of it, to try your plugin.   :)

Works great.  Love it.  It might even usurp my Shuttle Pro.   ($100)   Which I have dropped numerous times.  Not sure how many times I will get away with that.   :o

 JoyPad for $5........... I could afford to have a spare or two.   :P

Please keep the ability to assign macros to buttons.  I like the flexibility.

Great work and thanks very much for your efforts.

Greg
Title: Re: USB JoyPad and game device plugin - new version!
Post by: area51 on January 14, 2011, 05:59:58 PM
Greg

Thanks for the feedback  :D It helps me improve the plug in in feature releases.

The ability to assign script to buttons will stay put. You're right; it is very flexible and some tasks can only be done in script like probing or other more complex tasks.
In the upcoming release more simple tasks will be pre-programmed into the plug in.
Tasks like zero an axe, toggle flood, raise/lower spindle speed, cycle start, pause etc. will be very easy to assign to buttons in an easy to use GUI application.
This way users can still benefit from using the plug in and not knowing anything about script.

But of cause it will still be possible to program these tasks in script as well  ;)

- Joakim
Title: Re: USB JoyPad and game device plugin - new version!
Post by: Greolt on January 14, 2011, 06:26:54 PM
Joakim

Glad to hear that.

Can we have the analogue joysticks motion honour the maximum jog rate specified in the Mach slow jog rate percentage DRO?

I was a bit surprised to see this was being overridden.  This is a bit of a problem for me. 

Mostly for me, a pendant is useful for sneaking up on an edge whilst using a feeler gauge or such.  So I am looking for very small controllable movement.

As it is I can not get this without setting the plugin scale percentage low.  Then it is too slow for general jogging.

If it honoured the Mach jogging rate, I could assign a button to increase or decrease that.     I can not control the plugin scale rate via button.  Or can I?

Of course I can set up buttons to do small set steps, but I would use up a lot of my available buttons to do this.

It is possible that my super cheap Joypad does not have as finer analogue control as a Logitech one does.

What do you think?

Greg
Title: Re: USB JoyPad and game device plugin - new version!
Post by: area51 on January 14, 2011, 07:20:14 PM
Greg

The plug-in is using the maximum speeds for each axe as it is setup in Mach for the machine.
On the Logitech JoyPad I get speeds below 0.1 % of maximum speed (below 1/1000).
This is slow; but for fast machines I see the problem... or when sneaking up ...  ;)

Step jogging is a new feature in the coming release, honoring the step jog speeds setup in jogging screen (screen 50) - maybe you can use that in the final approach. Step jogging is activated by another safety key and using the same joysticks - they will then be in single step mode using the current step size in the jogging screen (1.000/0.100/0.010/0.001 or user defined).

Generally I avoid using screen only values as they are screen-set depend and not validated by Mach.
Only using Mach build in values will ensure the plug in works with any screen set.
I will put your request on my to do list - if there is an internal Mach value with the current Slow Jog Rate it can be used to reduce the jog speed along with the percentage setup in the JoyPad setup.

- Joakim
Title: Re: USB JoyPad and game device plugin - new version!
Post by: Greolt on January 14, 2011, 10:20:00 PM

On the Logitech JoyPad I get speeds below 0.1 % of maximum speed (below 1/1000).
This is slow; but for fast machines I see the problem... or when sneaking up ...  ;)


With my cheap JoyPad I doubt that I am getting that level of control precision.

Quote

Generally I avoid using screen only values as they are screen-set depend and not validated by Mach.
Only using Mach build in values will ensure the plug in works with any screen set.


The jog speed is just a DRO value, which I think will be found on any screenset.  Certainly on any that I have made or seen.  And even if it is not present, Mach reads it as if it is anyway.
Rapid speed, as set in motor tuning, is just a var that can be read or set much the same as a DRO, via VB.  Not so different I think.

Quote

Step jogging is a new feature in the coming release, honoring the step jog speeds setup in jogging screen (screen 50) - maybe you can use that in the final approach.
Step jogging is activated by another safety key and using the same joysticks - they will then be in single step mode using the current step size in the jogging screen (1.000/0.100/0.010/0.001 or user defined).


I have set up the POV and some other buttons with VB to jog each axis using the value of the Jog Increment DRO.  This works fine but does use up a lot of buttons.

Some way to slow the analogue jog rate would be good.  Utilising the existing jog rate DRO would make sense to me.  ;)

Anyway thanks for the great work.

Greg
Title: JoyPad plug-in Jog Slow Rate: Solution
Post by: area51 on January 15, 2011, 09:14:25 AM
Greg

With my cheap JoyPad I doubt that I am getting that level of control precision.

If the finer joystick control is missing on some of the more inexpensive devices its a problem. I have a game pad for testing, bought from eBay for less than $5. Besides different placement of buttons 1 - 4 it is mechanical stable and and have the same functionality as the more expensive Logitech Game Pad.

But Back to the solution; I found that Mach has an internal value for Jog Slow Rate representing the DRO readout. This value can be accessed on any screen set and will be part of the jog speed calculation in the upcoming release.
Jog speed will be as before but scaled down by the Jog Slow Rate as you suggested.

In testing I found it possible to jog as slow as 0.09 units/min; on my machine it is something like 1 micro step per second...
The internal lower speed limit in the plugin is now 1/100 000 of max speed for a given axe. This low limit could give drifting problems; time will show.

Thanks for pointing out the problem.

- Joakim
Title: Re: USB JoyPad and game device plugin - new version!
Post by: equalizer700 on January 21, 2011, 03:00:10 PM
Joakim,

Are the button assignments for the new release posted anywhere?  My son and I are just about to learn how to use JoyPad and would like to not have to re-learn what the buttons do after the new release.  We would configure to match the upcoming release if the future button assignments are posted anywhere.

Thanks

John & John
Title: Re: USB JoyPad and game device plugin - new version!
Post by: area51 on January 22, 2011, 08:47:38 PM
John & John

Sorry no, the button assignments is not posted.
Doing so will not benefit current users of the plugin as the button templates uses some new features in the coming release.
There are some limitations in the current release which prevents implementing the new button layouts.

The missing piece before release is the User manual - currently it is in the last commenting stages...

- Joakim
Title: Re: USB JoyPad and game device plugin - new version!
Post by: equalizer700 on January 23, 2011, 10:13:32 AM
It sounds great!  We're looking forward to the new release.
Title: USB JoyPad and game device plugin - New Version 2.0
Post by: area51 on February 05, 2011, 01:30:11 PM
New USB JoyPad plugin version 2.0 Released!

As promised a new version is now ready for download.
This version has a lot of improvements and additions, follow the link below to download and read more...

http://www.machsupport.com/forum/index.php/topic,17385.0.html (http://www.machsupport.com/forum/index.php/topic,17385.0.html)

- Joakim

Title: Re: USB JoyPad and game device plugin - new version!
Post by: equalizer700 on February 06, 2011, 11:45:30 AM
Got ot installed and running, and it's AWESOME!

Thanks!
Title: Re: USB JoyPad and game device plugin - new version!
Post by: Yianni - VJ - Glaux on March 25, 2011, 01:33:20 AM
Congrats Joakim !
It really is awesome !

Small question: I need to be able to step jog without pressing a safety button, I went through the manual but could not find how to do it, can you advise?
Title: Re: USB JoyPad and game device plugin - new version!
Post by: area51 on March 25, 2011, 09:22:40 PM
You could reassign PN, PE, PS and PW buttons to do the step jogging via script code.
Safety buttons for joystick movements are always on - its hard coded into the plugin and part of the design.

- Joakim
Title: Re: USB JoyPad and game device plugin - new version!
Post by: atifeh on May 05, 2011, 05:03:39 PM
So far it seems everybody is happy with the plugin. Since this plugin was designed to  provide cheap solutions for all users, therefore it has the flexibility and  potential to become more sophisticated.

We would like to have your comments and ideas on:

What brand of Gamepad do you use? an attached picture would be very useful.
The manual and your suggested improvements.
Any custom layout that you have designed and to your experience deemed more appropriate, which could be incorporated in the manual.
Keys that you feel should be incorporated in the menu.
A picture of the machine that you are using it with the gamepad.
Any experience that could be shared.

Best regards,
Nader

P.S. Please respond to the new thread announced in Reply #22
Title: Re: USB JoyPad and game device plugin - new version!
Post by: Captain Midnight on July 01, 2012, 12:09:35 PM
I have installed the plugin and buttons work fine, but joystick moves in steps only. I can't get continuous jogging to work. I'm pressing SL and joystick. Any insight?
Title: Re: USB JoyPad and game device plugin - new version!
Post by: atifeh on July 01, 2012, 01:55:46 PM
In your Mach3 screens, check if you have selected the step mode instead of continuous mode for jogging.
Title: Re: USB JoyPad and game device plugin - new version!
Post by: Captain Midnight on July 03, 2012, 12:13:09 AM
While in continuous mode, if I push SL and move joystick, it changes back to step mode by itself. It will not stay in continuous mode. Jogging with keypad works normally.
Title: Re: USB JoyPad and game device plugin - new version!
Post by: atifeh on July 03, 2012, 03:13:52 PM
It seems that your joystick is acting as BW "West Button" . Did you check your joystick on the "Control Panel/Game Controller"?
Title: Re: USB JoyPad and game device plugin - new version!
Post by: Captain Midnight on July 06, 2012, 01:02:10 PM
Yes, I'm good there. I purchased a Joypad off e-bay, when it gets here, I'll see if it works differently than the Lodgitech Attack 3.
Thank you for working with me. I'm hopefull I can get a joystick to work.
Title: Re: USB JoyPad and game device plugin - new version!
Post by: Captain Midnight on July 21, 2012, 02:04:15 AM
I received my new Joypad and it won't contiuosly jog either. Any ideas why it won't jog? It is setup as manual says. I have read all the posts. I have reviewed the manual.
Thanks for help