Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: smav on March 22, 2018, 11:33:02 PM

Title: Mach 4 scaling and keyboard button mapping
Post by: smav on March 22, 2018, 11:33:02 PM
I have two issues with mach 4, just upgraded motion control card and up from mach 3.

1) mach 3 had scaling boxes next to the DROs to scale your project up or down and I did see a little bit on a thread where it appears someone added the same to their mach 4 back in 2014. I am by no means a programmer, i just build, import or convert pictures and models to cad drawings to create the toolpath and gcode for and that is about as far as I am interested in programming. So is there a simple/easy way to add the scale feature as was found in the mach 3 that I was running?

2) In regards to keyboard mapping, it appears the mapping feature that can be done in mach 4 under configure>plugins>Keyboard Shortcuts - Newfangled Solutions is pretty limited to the 4 axis movements and can't really assign a key for stop, e-stop, increase/decrease jog, spindle speed and so on. Is there a way to add those functions to the functions column in that table for configuring keyboard inputs?
Title: Re: Mach 4 scaling and keyboard button mapping
Post by: joeaverage on March 23, 2018, 01:42:24 AM
Hi,
a DRO calculator is already available. Under Operator Tab check DRO Auto Calc. Click on a DRO and enjoy.

I will have to do a little more thinking to answer your second query.

Craig
Title: Re: Mach 4 scaling and keyboard button mapping
Post by: smav on March 23, 2018, 10:06:43 PM
ya I kind of figured out that the dro calculator button is basically an on screen numeric key pad but what I want is to add the input DROs for scaling. I have seen a few mach 4 screenshots on one thread where it shows the scale DRO and one guy stated he figured it out and posted his script seen below. However I am no programmer and do not understand where you would place this script. I have played around with the program enough to know how to add stuff and modify my screen but not how to add a function as shown below so it will resize the project like you could do in mach 3 with the scale function. Why wasn't that just incorporated in to mach 4 as it was in mach 3? It should actually be on the program extents tab for easy reference once you re-size a project.

local chkVar3 = ReadReg("iRegs0/xscale");
    if (chk3 ~= chkVar3) then
        chk3 = chkVar3
        if (chkVar3 ~= 1) then
            code = string.format("G51 X%0.4f",tostring(chkVar3));
            scr.SetProperty('droX1', 'Fg Color', 'Red');
       else
            code = string.format("G50");
            scr.SetProperty('droX1', 'Fg Color', 'Green');
        end
        mc.mcCntlGcodeExecute(inst, code);
    end
Title: Re: Mach 4 scaling and keyboard button mapping
Post by: joeaverage on March 23, 2018, 11:15:11 PM
Hi,

Quote
Why wasn't that just incorporated in to mach 4 as it was in mach 3?

The reason is because Mach4 is NOT Mach3 and never will be.

For NFS to survive commercially they have to sell and Hobbyist and one off Industrial licence sales just wont do it, there is just not enough income to employ
staff and run a business. That requires OEM sales and lots of them.

OEMs have the clues and expertise to program Mach4 and their machines pretty much anyway they please due to Mach4's flexibility. As a Hobbyist you will
HAVE TO do the same. NFS is not going to waste time and resources because a hobbyist cant or cant be bothered to customize Mach to their liking.

That means for most of us that Mach4 is a distinct learning challenge, some refuse to take up the challenge, some drop out finding it beyond them and some
persevere. I have persevered, to date at least, and still really only scratching the surface but have found immense satisfaction in doing so. Further, among the regulars
on the forum this is a common theme, struggled at the beginning but once you get going really really luv it!

Craig
Title: Re: Mach 4 scaling and keyboard button mapping
Post by: joeaverage on March 23, 2018, 11:19:51 PM
Hi,
as to your second query you may have noted the responses in this thread:

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

And Daz has a video of exactly what you require:

https://www.youtube.com/watch?v=yzaf5pT0l50 (https://www.youtube.com/watch?v=yzaf5pT0l50)

Craig
Title: Re: Mach 4 scaling and keyboard button mapping
Post by: smav on March 24, 2018, 12:09:51 AM
thanks that was a great video on assigning keys to functions not listed under the regular keyboard function list.
Title: Re: Mach 4 scaling and keyboard button mapping
Post by: smav on March 24, 2018, 08:11:19 PM
Does anyone know how to create and install the DROs circled in the attached picture to have the same functionality in mach 4 as they do in mach 3? If so and you are interested let me know what you would charge to modify my mach 4 program so that it has those same buttons and functions

NOTE: Couldn't get picture to insert in to this text box or get it to send as an attachment. I kept getting an error that I have already attached that file, although I have never attached a file to any post, but the buttons I am asking about are the scale DROs next to the axis DROs in mach 3.

(http://C:\Users\shop\Desktop\CaptureB.PNG)
Title: Re: Mach 4 scaling and keyboard button mapping
Post by: joeaverage on March 25, 2018, 12:35:15 AM
Hi,
use 'Additional Options' to the lower left of the text input box. It wiil allow you to browse to a file to attach.

Note that if the Mach Forum detects that you have already posted a file which will sometimes happen if you bobble a post you will have to rename it to re-post.

The correct way to scale axes is to use G50 and G51. You could make an on screen button which MDIs a G50 which would scale that particular Gcode file or until
a G51.

Another possibility is to change the 'Steps per Unit', this could be done programmatically but I think most would regard it as poor practice. The APIs for such purposes were
intended as configuration aids not as regularly used programmatic tools.
Title: Re: Mach 4 scaling and keyboard button mapping
Post by: smav on March 25, 2018, 05:57:53 PM
UPDATE--I went back to the mach 3 program and dug around in some of there scripts and oem codes and figured out how they performed the scaling in that. I had to make several modifications to the code that I had found in post under mach 4 from 2014 in order to get that to work. For the most part that code that the user had shared on his post got me in to the ball park but there were some errors and things left out that caused issues.

I have one basic issue at this point and that is figuring out how to get it to only issue the gcode command once instead of getting stuck in a loop or at least I think that is what is occuring. At this time I can resize my image to whatever I want but when I click the enable button, it appears that the gcode starts executing and toggles between line 1 and 2 and the timer starts running. I basically only need to the code to execute when i change the value in the dro and/or click on regen tool path.
Title: Re: Mach 4 scaling and keyboard button mapping
Post by: smav on March 25, 2018, 06:29:16 PM
LAST UPDATE---Figured out the "looping" problem and I can now scale any axis by simply entering the value in to the DRO's and they will scale just like you could do in mach 3. When  I select regen tool path it will resize the picture on the tool path table as well as update the extents.
Title: Re: Mach 4 scaling and keyboard button mapping
Post by: chuck767 on March 28, 2020, 11:07:57 PM
LAST UPDATE---Figured out the "looping" problem and I can now scale any axis by simply entering the value in to the DRO's and they will scale just like you could do in mach 3. When  I select regen tool path it will resize the picture on the tool path table as well as update the extents.


What would it take for me to have MACH4 Feel like MACH 3 Relative to changing the Axis scale percentage in a box next to the axis DRO
Title: Re: Mach 4 scaling and keyboard button mapping
Post by: joeaverage on March 29, 2020, 02:04:46 AM
Hi,

Quote
What would it take for me to have MACH4 Feel like MACH 3

Probably not that much....but why? Mach4 is light years ahead of Mach3......I don't want to go back to Mach3,
I'm all for making Mach4 the way I want and to hell with Mach3.

Craig
Title: Re: Mach 4 scaling and keyboard button mapping
Post by: chuck767 on March 29, 2020, 10:50:00 AM
Hi,

Quote
What would it take for me to have MACH4 Feel like MACH 3

Probably not that much....but why? —————-Craig

Craig,
Thanks for the response.
 I understand what you’re saying about MACH4 being so much better Then MACH 3

In my shop, I frequently use the X and Y axis percent scale feature within MACH 3 quite often.

I have MACH 3 on three different machines and will be converting 2 of them to MACH4 and would really like to have the same feature for scale on all three machines. 

So I’m really interested in what it would take to make my MACH4 machines do the Axis  scaling like MACH 3.

Thanks,
Chuck


Title: Re: Mach 4 scaling and keyboard button mapping
Post by: smav on March 29, 2020, 10:59:49 PM
Adding the dro for percentage scaling can be done like they had in Mach3. I used it quite a bit on stuff like 2d carvings and text. It has been quite a while since I added it to my mach4 and I only really run my mill in the winter time unless I have to make something or fix something in the summer. Every winter if I want to add or change something I come across I usually have to do two days of research to remember how to make the modifications and programming.
Title: Re: Mach 4 scaling and keyboard button mapping
Post by: chuck767 on March 30, 2020, 11:02:25 AM
Thank you for the reply.

I totally understand having to reacquaint yourself with Modifications you’ve done after A period of time.

Would it be possible for you to send your MACH 4 profile?

Since you have it working on your machine, maybe I could modify your profile to fit my machine?


Thank you,
Chuck
 

Title: Re: Mach 4 scaling and keyboard button mapping
Post by: smav on March 30, 2020, 11:39:12 AM
Chuck--I should be able to help you out with that. When I get some time I will fire it up and see what I have and send it to you.
Title: Re: Mach 4 scaling and keyboard button mapping
Post by: chuck767 on March 30, 2020, 12:39:02 PM
Thank you, I would appreciate that.

With all the projects I have in work, there’s no hurry.

Regards,
Chuck
Stay safe
Title: Re: Mach 4 scaling and keyboard button mapping
Post by: smav on March 30, 2020, 05:40:29 PM
Chuck I sent you what I had in a message from the link on your info avatar so if you don't get an email from me please let me know.
Title: Re: Mach 4 scaling and keyboard button mapping
Post by: chuck767 on April 02, 2020, 01:16:00 PM
Up and running, MACH4 now has the same scaling capabilities as MACH 3

So from my Interest, the subject is closed. 

Thank you,
Chuck
Title: Re: Mach 4 scaling and keyboard button mapping
Post by: chuck767 on September 08, 2022, 11:19:00 AM
Chuck I sent you what I had in a message from the link on your info avatar so if you don't get an email from me please let me know.

Hi  Craig,
It’s been a while since you sent this to me.

Would it be possible for you to resend your mach4 profile for scaling.

Long story, but I lost it.

pls Send to my email address Chuck767@gmail.com

Thanks,
Chuck

Title: Re: Mach 4 scaling and keyboard button mapping
Post by: joeaverage on September 08, 2022, 06:29:12 PM
Hi chuck,
my profile, or more technically correct, screenset never had a DRO for scaling, I always used G50 and G51 for scaling whenever I've needed it.

Over the last couple of years my screenset has changed as I've built a new machine, much bigger, more powerful and more rigid, using servos
rather than steppers, and so I rather doubt my screenset is of any particular use to you.

What I have found is that my screenset is 99.99% standard as shipped by NFS....all I've really added are those specific features I need for my machine,
things like individual alarm inputs for each servo, and the inputs for a wired pendant for example. All and anything I can possibly require is already built into Mach4.

Craig
Title: Re: Mach 4 scaling and keyboard button mapping
Post by: chuck767 on September 08, 2022, 07:25:52 PM
Thanks for the reply Craig,

For some reason I thought you sent me a profile that included scaling like in Mach3 two years ago.

I apologize, my memory apparently isn’t very good.

I will end up doing as you are doing with G50 & G51

Again I apologize for my poor memory and thanks again for responding to me.
Chuck

Title: Re: Mach 4 scaling and keyboard button mapping
Post by: joeaverage on September 08, 2022, 07:44:06 PM
Hi,
'the good thing about Alzheimer's is that your always meeting someone new.'

Craig
Title: Re: Mach 4 scaling and keyboard button mapping
Post by: chuck767 on September 08, 2022, 07:56:37 PM
Right on, and I like the part where you can read the same good book more than once   😊

FYI, the machine I converted was a Shizoka mill master, 28 inch X travel with FANUC servos
Title: Re: Mach 4 scaling and keyboard button mapping
Post by: joeaverage on September 08, 2022, 08:07:12 PM
Hi,
kool, a very substantial machine!

Craig
Title: Re: Mach 4 scaling and keyboard button mapping
Post by: chuck767 on September 09, 2022, 12:10:39 AM
Yes very substantial, it weighs in at 11,000 pounds.

In addition to milling I installed a 180W CO2 laser on it and I can also do plasma cutting with it.