Setting up Metric machine Servo parameters

Moderators: TomKerekes, dynomotion

Post Reply
RogerFroud
Posts: 78
Joined: Tue Mar 30, 2021 8:07 am

Setting up Metric machine Servo parameters

Post by RogerFroud » Mon May 31, 2021 6:56 am

My machine has Metric leadscrews and encoders, so I'm confused as to why the Trajectory Planner tab only shows Inches for all of the parameters. Mach just calls the setup value as Units, ie not Imperial or Metric. Does this mean that I need to put my figures for Metric units in as is they were Inches?
If this is the case, surely it would be better to call them Units and not Inches?

I see that there's a check box that says 'Degrees' for the A,B & C axes when setting up a rotary axis. Presumably that has to do with rollover at 360?

I see there are radio buttons for Inch/Metric on the KMotionCNC screen. How is that affected?

I need to set up the machine as follows...
X/Y Counts/unit 2000
X/Y Accel Units/s2 1000
X/Y Velocity Units/sec 3000

Z Counts/unit 4000
Z Accel Units/s2 1000
Z Velocity Units/sec 2000

A Counts/unit 100
A Accel Units/s2 10000
A Velocity Units/sec 30000

I see that microstepping is used, and the manual says it's 16 times the step. Does that mean I need to put 16 times the above values in the setp page?

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: Setting up Metric machine Servo parameters

Post by TomKerekes » Mon May 31, 2021 4:53 pm

Hi Roger,
My machine has Metric leadscrews and encoders, so I'm confused as to why the Trajectory Planner tab only shows Inches for all of the parameters.
The Trajectory Planner settings are in inches as labeled. To convert mm values to inches divide by 25.4

I see that there's a check box that says 'Degrees' for the A,B & C axes when setting up a rotary axis. Presumably that has to do with rollover at 360?
It controls how feedrates are determined. Configured with degrees and 0 radius, when non-pure angular motions are made (ie which involve XYZ movement) the angles are excluded from feedrate calculations unless they are limiting.

I see there are radio buttons for Inch/Metric on the KMotionCNC screen. How is that affected?
Operators can select mm or inch units for running Jobs, GCode, and Offsets. It has no effect on the Tragectory Planner Settings.

I see that microstepping is used, and the manual says it's 16 times the step. Does that mean I need to put 16 times the above values in the setp page?
From KMotionCNC's perspective it needs to know how many total steps are required to move 1 inch regardless of what electronic or mechanical factors are involved.

HTH
Regards,

Tom Kerekes
Dynomotion, Inc.

RogerFroud
Posts: 78
Joined: Tue Mar 30, 2021 8:07 am

Re: Setting up Metric machine Servo parameters

Post by RogerFroud » Mon May 31, 2021 10:17 pm

Thanks for that.

So if I understand that correctly, I need 2000 steps for 1mm so I need 50,800 steps for one inch of travel for the X & Y ie multiply by 25.4 (not divide) since it takes 25.4 times more steps to travel an Inch?

I'm afraid I don't understand the 'Degrees' check box. My 'A' axis is a rotary one, so I presume I need to check that? I don't understand what a radius has to do with a rotary motion? Surely it's degrees per second?

I want to remove the Inch/Metric radio buttons, it's an accident waiting to happen and I'll never use Inches on the machine. How can I make sure that it initialises always in Metric when the buttons are hidden? Presumably there's a line that can be added to the Initialisation 'C' file?

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: Setting up Metric machine Servo parameters

Post by TomKerekes » Tue Jun 01, 2021 1:46 am

Hi Roger,
So if I understand that correctly, I need 2000 steps for 1mm so I need 50,800 steps for one inch of travel for the X & Y ie multiply by 25.4 (not divide) since it takes 25.4 times more steps to travel an Inch?
Correct. Counts/mm you would multiply. mm/sec or mm/sec^2 you would divide.
I'm afraid I don't understand the 'Degrees' check box. My 'A' axis is a rotary one, so I presume I need to check that?
yes

I don't understand what a radius has to do with a rotary motion? Surely it's degrees per second?
With a rotary axis maintaining a constant feed rate with combined XYZ + angular coordinated motion is somewhat complex. For a given angular speed If the tool tip is near the axis of rotation the cutting rate will be low but if far from the axis of rotation the feedrate will be high. Furthermore if the induced angular motion is in the same direction as the XYZ motion or the opposite or some angle will need to be considered. KMotionCNC supports Kinematics which is the best approach. But short of doing Kinematics another approach is to handle things in CAD/CAM. In that case Inverse Time Feedrate can be used. In this case the CAD system has all knowledge of the geometry of the machine and uses this to specify the time each XYZ + angular motion should take and specifies that on every line of GCode. But short of doing that another even simpler approach is to just assume some constant radius. In this case KMotionCNC assumes any angular motion will result in a tool tip motion at a velocity orthogonal to all other axes based on that radius. This mode works well on something like engraving on a cylinder. But can also work reasonably well in other cases. You might watch these examples:






I want to remove the Inch/Metric radio buttons, it's an accident waiting to happen and I'll never use Inches on the machine. How can I make sure that it initialises always in Metric when the buttons are hidden? Presumably there's a line that can be added to the Initialisation 'C' file?
I wouldn't recommend that. The units mode is normally specified in the GCode as a G20 or G21 code. So even without the buttons the mode may be switched by GCode and then you wouldn't be able to see the mode. If you want to remove the Inches mode from the GCode Interpreter you would need to modify the Interpreter source code.

You can control the default startup GCode Interpreter Setting in the KMotionCNC | Tool Setup | Files | Setup File. See here. There is an example setup file for this called MM.set
Regards,

Tom Kerekes
Dynomotion, Inc.

RogerFroud
Posts: 78
Joined: Tue Mar 30, 2021 8:07 am

Re: Setting up Metric machine Servo parameters

Post by RogerFroud » Tue Jun 01, 2021 7:19 am

Thanks for that, I see how to set the step parameters now.

I see the issue with contouring with the 4th axis now. I use the CAM to generate all arcs as straight lines, so that would probably make life much easier for the planner. As it happens, I only use the 4th axis for indexing, so it won't be a problem.

I've modified the CAM post processor to strip out the dozens of unnecessary and confusing commands, including the Inch/Metric ones. I like a really clean output because it makes reading the G-Code so much simpler so that you know what's going to happen, especially when single stepping. It also makes restarting a program part way through much easier. I haven't read anything about how to go about that with KMotionCNC, I presume you can start from any line?

There's no need for any unit changeover, it's never going to be Inch units. I'll be removing those controls, as well as the Abs/Rel motion controls which will never be used. I'll set them once in the Initialisation and they will never change. I don't like unnecessary buttons and controls that just take up space and can inadvertently get pressed.

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: Setting up Metric machine Servo parameters

Post by TomKerekes » Tue Jun 01, 2021 4:54 pm

Hi Roger,
It also makes restarting a program part way through much easier. I haven't read anything about how to go about that with KMotionCNC, I presume you can start from any line?
Right click on the line and select Set Next Statement. KMotionCNC will make some basic checks but you must make sure it is safe to proceed from that point.
Regards,

Tom Kerekes
Dynomotion, Inc.

RogerFroud
Posts: 78
Joined: Tue Mar 30, 2021 8:07 am

Re: Setting up Metric machine Servo parameters

Post by RogerFroud » Tue Jun 01, 2021 9:11 pm

Thanks, that's great.

Post Reply