Hello Guest it is October 23, 2019, 08:49:13 PM

Author Topic: USB JoyPad and game device plugin - new version!  (Read 37809 times)

0 Members and 1 Guest are viewing this topic.

Offline area51

*
  •  102 102
    • View Profile
    • Joakim's Technical Explorations
USB JoyPad and game device plugin - new version!
« 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:
  • Now supports SmoothStepper version 1.2!
  • Now with User manual!
  • New example button VBScript macros!
  • New rewritten internal state machine!

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:
  • It is free!
  • Control of up till 6 analog/digital axes.
  • Control of up till 16 buttons.
  • Control of one Point of View (POV or HAT).
  • Button function is programmed as VBScript (Marc3 macros).
  • Each axe can be scaled, inverted and mapped to any Mach3 axe.
  • Precision jogging is obtained with third order scaling of the absolute stick position.
  • Single or simultaneous multi axe jogging.
  • Besides Mach3 and Windows there is no need for extra software.
  • Works with Mach3 Parallel Port (PP).
  • Works with SmoothStepper version 1.2 (SS).

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
« Last Edit: October 06, 2010, 09:32:07 PM by area51 »
Re: USB JoyPad and game device plugin - new version!
« Reply #1 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

Offline area51

*
  •  102 102
    • View Profile
    • Joakim's Technical Explorations
Re: USB JoyPad and game device plugin - new version!
« Reply #2 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
Re: USB JoyPad and game device plugin - new version!
« Reply #3 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
« Last Edit: October 09, 2010, 10:51:39 PM by wvancura »

Offline area51

*
  •  102 102
    • View Profile
    • Joakim's Technical Explorations
Re: USB JoyPad and game device plugin - new version!
« Reply #4 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
Re: USB JoyPad and game device plugin - new version!
« Reply #5 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

Offline area51

*
  •  102 102
    • View Profile
    • Joakim's Technical Explorations
Re: USB JoyPad and game device plugin - new version!
« Reply #6 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
 
Re: USB JoyPad and game device plugin - new version!
« Reply #7 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

Offline area51

*
  •  102 102
    • View Profile
    • Joakim's Technical Explorations
Re: USB JoyPad and game device plugin - new version!
« Reply #8 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
Re: USB JoyPad and game device plugin - new version!
« Reply #9 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.