Hello Guest it is January 29, 2020, 02:29:48 AM

Author Topic: USB gamepad as jogging device  (Read 1938 times)

0 Members and 1 Guest are viewing this topic.

USB gamepad as jogging device
« on: May 27, 2017, 03:26:06 AM »
Hi,
In MACH 3 there was a user contributed plugin for this. Anyone who knows if there might be one for MACH 4?
Alternatively, how to go about making one.

I'm an embedded systems designer so I'm used to programming but LUA and the Mach4 API are totally new to me
as well as accessing the USB gamepad device.

Best regards
Thom
Re: USB gamepad as jogging device
« Reply #1 on: May 27, 2017, 04:15:20 AM »
Hi,
not sure but my understanding is that what you require is a device plugin. Plugins are written in C/C++. Also I understand that
they need to be 'signed' or otherwise approved by Artsoft.

I imagine that if anyone were genuinely writing software for use with Mach4 there would be a great deal of approval/support for such
a venture. The sort of programming expertise required for a device plugins is restricted to few people, sounds like you are one of them.

I have considered writing a plugin for EtherCat capable servo drives. When I delve into it I realise that I'm biting off more than I can chew.
An EtherCat plugin would potentially have very widespread use over time and so probably justify the effort. Does the project you're thinking
of have sufficient audience to justify what could be a multi thousand hour programming venture?

Craig
My wife left with my best friend...
     and I miss him!
Re: USB gamepad as jogging device
« Reply #2 on: May 27, 2017, 04:37:06 AM »
Hi,
I've been thinking a little more on this...if I were going to make my own handheld jogging device I would take a leaf out
of CRS's book and use a PoKeys board as an input device. Search the Mach4 section of the forum for his posts, he has built
an advanced control panel for his mill.

Admittedly you would end up with as many wires as switches/encoders but you wouldn't have to write your own plugin. The
PoKeys boards are very capable data acquisition products.

Mach4 has a Modbus plugin which can use both TC/IP or serial comms. With your knowledge of embedded systems making a Modbus
device is probably very doable.

Craig
My wife left with my best friend...
     and I miss him!
Re: USB gamepad as jogging device
« Reply #3 on: May 27, 2017, 04:44:59 AM »
Honestly, I don't know. Time is a limited commodity right now.

There are several ways to approach this task. An Arduino device with an old RC radio gimbal talking ModBus might be one.

Second, from what I now Mach 3 plugins were plain DLLs. Mach4 plugins seem to be something else with reference to the .M4PW file type. If however, this is a DLL in "disguise", it doesn't really matter what language it is written in as long as you can output a DLL as project target. I'm quite proficient in the Delphi RAD development platform and it's possible to develope DLLs on this. What this will take is some sort of Mach4 SDK and a GamePad VCL Component, all which I know little about at the moment.

As a hobbyist, a gamepad is a device that almost everyone has lying around somewhere and it's excellent for jogging purpose being able to keep a close eye on the machine while moving around.

Thom
Re: USB gamepad as jogging device
« Reply #4 on: May 27, 2017, 05:01:51 AM »
You can also get gimbals from f ex Ali express at a decent cost
Here
Re: USB gamepad as jogging device
« Reply #5 on: May 27, 2017, 06:09:36 AM »
Hi,
all of the alternatives look time consuming, some much more so than others. It brings me back to the question does the result
justify the effort to achieve it?

I bought a VistaCNC pendant when I was using Mach3 and PP and updated to the Mach4 plugin when I upgraded to Mach4. Works
a treat. Certainly no need for me to invest the sorts of hours necessary to build my own.

I bought a secondhand servo off Ebay which I intended to use as a spindle motor. The servo looks like new but it is 20+ years old
and has a resolver rather than an encoder. Finding a drive within my budget proved impossible and so I decided to make a drive.
Have had to teach myself how to program TIs DSP micros to implement field oriented control. Cant be bothered to make a jog box but
have made the effort to make a 12A rms, 48A peak servo drive....

Craig
My wife left with my best friend...
     and I miss him!
Re: USB gamepad as jogging device
« Reply #6 on: May 27, 2017, 06:42:53 AM »
A better alternative for sure. Which type pendant did you buy?
(I was looking at the M1 or M2 as possible candidates but there seems no plugin for M2 for Mach4)
Re: USB gamepad as jogging device
« Reply #7 on: May 27, 2017, 04:53:05 PM »
Hi,
VistaCNC P1A pendant.

Craig
My wife left with my best friend...
     and I miss him!
Re: USB gamepad as jogging device
« Reply #8 on: May 28, 2017, 03:00:34 AM »
Hi, I chose the M1. Since I live in Sweden shipping and import duty adds about 50% to the cost.
But I'm going to save myself some time  :)
Re: USB gamepad as jogging device
« Reply #9 on: May 28, 2017, 04:02:19 AM »
So Captain sq... You live in sweeden :) Where in sweeden may I ask? I live in Norway myself. 1 hour cartrip from Charlottenberg.

 Using Pokeys57U for a control panel isnt a bad idea. I am doing the same, and allso got 6 PoextBus Output boards connected to it,
 so I get Additionally 48 Outputs to manage LED's in by buttons. The PoextBus dont steal any I/O's, so with 48 Outputs I still got 55 Inputs to use for MPG Handwheel and buttons. It allso
has 7 analog inputs , and I belive they can be used for analog joystic of own choise to use for jogging. I will try to set up analog jog on a board tonight.
BTW... Check my Youtube channel for some videos of my CNC Control panel build.. More videos are comming soon...  ;D
https://www.youtube.com/user/StigOveRuud/videos