Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: chuck767 on October 26, 2022, 12:08:49 AM

Title: Mach4 scaling using M51
Post by: chuck767 on October 26, 2022, 12:08:49 AM


Recently converted over to Mach 4 from Mach3

In Mach3, I frequently used the scaling features by simply typing in the scaling factor for the X,Y or Z axis.

In Mach4   I was introduced to M51 for scaling.

Has anybody automated this in the form of a “button/window“on the main screen?

Thanks for any help here.
Chuck
Title: Re: Mach4 scaling using M51
Post by: Bill_O on October 26, 2022, 08:36:31 AM
I think you are referring to g51.
I use an mc.AxisSetScale with a camera that finds fiducials and scales the x and y accordingly.
This is where it sets the scaling.
                        --calculate y scale amount
         ScaleAmountY = (BCOffTtlLnth / BCGcdTtlLnth)
         --set x scale amount
         mc.mcAxisSetScale(inst, 1, ScaleAmountY)
Title: Re: Mach4 scaling using M51
Post by: chuck767 on October 26, 2022, 09:49:15 AM
You’re correct I did mean G 51.

Please tell me more about the axis set scale, I am not familiar with it.
Title: Re: Mach4 scaling using M51
Post by: Bill_O on October 26, 2022, 09:52:28 AM
Like in my code i showed you i  set a variable and then set the scaling to that variable.
A value of 1 is 100%
Title: Re: Mach4 scaling using M51
Post by: chuck767 on October 26, 2022, 10:01:12 AM
Thanks, being new to Mach4 I think this is beyond my comprehension this time. 

Title: Re: Mach4 scaling using M51
Post by: Bill_O on October 26, 2022, 10:18:30 AM
You will have to do some coding.
It does appear much harder than it is once you have started.
Here is a link for a document I made as I was learning how to do it.
It should help you.
https://www.machsupport.com/forum/index.php?action=dlattach;topic=43260.0;attach=54239
Title: Re: Mach4 scaling using M51
Post by: chuck767 on October 26, 2022, 10:25:51 AM
Thanks, I appreciate your input.

So far I am very impressed with Mach4 and want to learn more about using all of its capabilities.
Title: Re: Mach4 scaling using M51
Post by: chuck767 on October 31, 2022, 05:14:25 PM
Tell me more about “ camera that finds fiducials”

Thanks,
Chuck
Title: Re: Mach4 scaling using M51
Post by: Bill_O on November 01, 2022, 07:52:40 AM
It finds some dots printed on material and adjusts the scaling for x and y and compensates for rotation.
Lot of math.
Title: Re: Mach4 scaling using M51
Post by: Bill_O on November 01, 2022, 09:32:52 AM
Here is the code.
I use a lot over variables and some registers but you might be able to follow it.
Title: Re: Mach4 scaling using M51
Post by: chuck767 on November 01, 2022, 10:22:38 AM
Thanks, very impressive.