Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: Captain_sq on May 27, 2017, 03:26:06 AM

Title: USB gamepad as jogging device
Post by: Captain_sq 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
Title: Re: USB gamepad as jogging device
Post by: joeaverage 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
Title: Re: USB gamepad as jogging device
Post by: joeaverage 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
Title: Re: USB gamepad as jogging device
Post by: Captain_sq 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
Title: Re: USB gamepad as jogging device
Post by: Captain_sq on May 27, 2017, 05:01:51 AM
You can also get gimbals from f ex Ali express at a decent cost
Here (https://www.aliexpress.com/item/Joystick-w-25mm-Tube-for-Basecam-Storm32-Handle-Camera-Gimbal-Controller/32693481652.html?spm=2114.01010208.3.104.mZRvRT&ws_ab_test=searchweb0_0,searchweb201602_5_10152_10065_10151_10068_5010013_10136_10137_10157_10060_10138_10155_10062_10156_437_10154_10056_10055_10054_10059_303_100031_10099_10103_10102_10096_10147_10052_10053_10142_10107_10050_10051_10171_5020014_10084_10083_10080_10082_10081_10110_519_10111_10112_10113_10114_10182_10185_10032_10078_10079_10077_10073_10123_142-10102,searchweb201603_2,ppcSwitch_5&btsid=c6b4a3ea-d772-4006-89f6-b2b99fe0ec42&algo_expid=d9c82065-aaa5-465f-963d-e9b6df735944-14&algo_pvid=d9c82065-aaa5-465f-963d-e9b6df735944)
Title: Re: USB gamepad as jogging device
Post by: joeaverage 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
Title: Re: USB gamepad as jogging device
Post by: Captain_sq 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)
Title: Re: USB gamepad as jogging device
Post by: joeaverage on May 27, 2017, 04:53:05 PM
Hi,
VistaCNC P1A pendant.

Craig
Title: Re: USB gamepad as jogging device
Post by: Captain_sq 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  :)
Title: Re: USB gamepad as jogging device
Post by: soruud 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


Title: Re: USB gamepad as jogging device
Post by: Captain_sq on May 30, 2017, 10:49:09 AM
In Gothenburg. I have the "small" Pokeys57db25 motion controller so it has very limited capabilities. That's why I invested in a Vista pendant not to take focus away from what I want to do. In the future however, I just might get myself one of the fullsize PoKeys controllers to get more degrees of freedom. Rigth now I'm set on geting the CNC router to machine some PCBs for me. :)
Title: Re: USB gamepad as jogging device
Post by: joeaverage on May 30, 2017, 03:07:08 PM
Hi,
amongst the things I do with my mill is isolation routing of circuit boards. My success has improved considerably by using Autoleveller
software from the UK, any Google search will find it. I liked it that much I paid 20 quid for the subscription.

Craig
Title: Re: USB gamepad as jogging device
Post by: Captain_sq on May 31, 2017, 03:06:55 AM
Hi,
amongst the things I do with my mill is isolation routing of circuit boards. My success has improved considerably by using Autoleveller
software from the UK, any Google search will find it. I liked it that much I paid 20 quid for the subscription.

Craig

Hi, I'll check it out. Thanks.
/Thom
Title: Re: USB gamepad as jogging device
Post by: joeaverage on May 31, 2017, 03:38:30 AM
Hi Thom,
really really good addition fpr making circuit boards.

I made one about three weeks ago about 60x80mm with regular 35um copper. I 'etched' to a depth of only 50um and got
perfect isolation across the board and that was with TSSOP ICs, 0.3mm between the pads. Never been able to get such fine
detail until I started using Autoleveller.

Craig