Hello Guest it is May 25, 2019, 05:31:12 AM

Author Topic: Steps/Inch on Lathe = 75,000; Seems a Tad High  (Read 6190 times)

0 Members and 2 Guests are viewing this topic.

Re: Steps/Inch on Lathe = 75,000; Seems a Tad High
« Reply #20 on: September 04, 2014, 05:50:44 PM »
Well, I guess the jerk units must be inches/sec.^3. I must have been asleep when I wrote that.

Offline mc

*
  •  381 381
    • View Profile
Re: Steps/Inch on Lathe = 75,000; Seems a Tad High
« Reply #21 on: September 04, 2014, 06:01:07 PM »
It's count/sec^3, where count is either encoder counts, or microsteps depending on what you're driving.

KFlop has no interest in whether you're working in inches or mm, it's only interested in raw numbers. It's upto Mach/KmotionCNC/whatever other interface you're using to create the raw numbers via a format that humans are more likely to comprehend.

Offline mc

*
  •  381 381
    • View Profile
Re: Steps/Inch on Lathe = 75,000; Seems a Tad High
« Reply #22 on: September 04, 2014, 06:32:30 PM »
Just realised the bit I mentioned about making sure Mach isn't slowed by the KFlop settings might be causing you issues.

Take your 75000 steps per inch figure as an example.
Ignoring acceleration for now, if you command a move of 60inch per minute, you need KFlop to generate 75000 steps per second.
Now if you have the axis/channel in KFlop set at a max speed of say 50'000, that means the KFlop/actual motion is going to trail Mach's planned trajectory by an ever increasing 25'000 steps per second, or 1/3" per second.

This also applies to acceleration, but you also have the added complication of jerk.
Using the same 75'000 figure, say you have your acceleration set at 1"/sec^2, this means after 1 second Mach expects motion to be at 1"/sec, and the KFlop should be outputting 75'000 steps per second to acheive this, which you would think is acheivable by setting an acceleration rate of 75'000 in your axis/channel.
However, that doesn't allow for Jerk. If you have Jerk set to 75'000, it's going to take 1 sec for the KFlop to reach max acceleration, by which point you're lagging behind the Mach trajectory.

I can't remember how KFlop handles the lag scenario, but I suspect it just continues to buffer motion.
And having just searched the yahoo list, the axis commanded position will keep increasing while the actual position lags, to the point where either the axis disables because of max following error limit being exceeded, or if trajectory stops allowing the axis to catch up, the axis will come to an abrupt uncontrolled stop.

So the moral of the story is, make sure you're conservative with your Mach settings.
Re: Steps/Inch on Lathe = 75,000; Seems a Tad High
« Reply #23 on: September 12, 2014, 04:26:20 PM »
I am still fooling with this. I'm trying to figure out as much as I can so I don't waste other people's time too much.

I learned more new stuff. It appears that I shouldn't even think about setting things in Mach3 until I've tried KMotion. And if I use KMotionCNC, I have to remember to go through that, too. I am trying to resist downloading mot files out of habit.

It turns out KMotionCNC has an area where you set the motor up. It's in Tool Setup/Trajectory Planner. I had to go in there and tell the software how many counts per inch I wanted. For unknown reasons, on x, I ended up with 81958 and change. The x axis appears to be accurate to within a thousandth over half an inch, which is not something I'm going to complain about on a Chinese mini-lathe.

Now I'm having fun with backlash correction. This is found in the init.c file, and to turn it on, I have to change "ch0->BacklashMode=BACKLASH_OFF;" to "ch0->BacklashMode=BACKLASH_LINEAR;." You would think the opposite of "off" would be "on," but no. It's "linear."

My problem now is figuring out when the backlash correction is added and how. The x backlash is less than a thousandth, which I don't understand, but anyway, it's so small, it's difficult to know whether correction works or not. I am trying to use z to figure it out.

The documentation says the correction works in the "positive" direction, but it doesn't say what that means. If I enter a number of steps (you can't enter thousandths) adding up to 10 thousandths, does that mean I put the lathe at zero with the backlash taken out and turn it on, and then it moves the dial ten thousandths the other way and THEN starts counting the z travel? Danged if I know.

To make things even worse, I bought Dolphin CAD/CAM, so if I ever get KMotionCNC figured out, I'll have to start over with Dolphin. But it looks like a great program.

I'm still blown away by the fact that KMotion reckons the steps/inch thing in inverse distance per cycle, where a cycle is four steps, but I'm sure there is some solid engineer reason for it.

Offline mc

*
  •  381 381
    • View Profile
Re: Steps/Inch on Lathe = 75,000; Seems a Tad High
« Reply #24 on: September 15, 2014, 05:49:33 AM »
The official quote from the manual-
Quote
Sets or gets the Backlash Compensation mode from either BACKLASH_OFF (0) to BACKLASH_LINEAR (1).  When the backlash mode is set to Linear mode, whenever the commanded destination begins moving in the positive direction, a positive offset of the amount, BacklashAmount, will be applied.  The offset will be ramped upward as a linear function of time at the rate specified as the BacklashRate.  Whenever the commanded destination begins moving in the negative direction the offset will be removed by ramping downward toward zero at the same rate.

What it essentially means, is that when you move in the positive direction, the backlash amount gets added, at the rate specified by BacklashRate.
So to use some random figures, say you have backlash set at 1000, with a backlash rate of 1000.
Now you command a move of say 3000 steps at 1000 steps per second. As the axis moves at the set rate, it applies the backlash on top of the set motion rate*, so after 1 second, the axis has actually moved 2000 steps. After the backlash has been applied, the axis then continues to move at it's set motion rate of 1000 steps per second until it reaches 4000 steps, which if your backlash is set correctly should be the equivalent of moing 3000 steps.
If you then command another move in the same direction of say 1000, as backlash has already been applied, the axis simply moves 1000 steps, so the axis should of now physically of moved 4000 steps (or 5000 steps with backlash applied)

In reverse, the exact same thing happens, but things count down instead of up. So if you start at a physical 4000 steps (5000 with backlash applied), and command a move of 4000 to return to zero, as the axis starts to move, an additional 1000 steps will be added to the first second of motion to remove the backlash amount.

The idea is, that due to backlash applying no load to the drive system, it can be added quickly to motion moves, so that backlash is removed prior to the axis physically starting to move. The 1000 step example I used is very high setting for most systems, and in practical use a backlash setting that high will cause problems. Backlash is essentially a sticking plaster solution, and only really meant to handle very minimal backlash which can't be removed through other means.
Any large amounts of backlash where the tool can pull/push against the backlash, means that if you use a high backlash rate, you can miss steps due to a large amount of backlash being too quickly applied against axis load, however if you use too low a backlash rate, then the backlash won't be applied quickly enough during moves.

Offline mc

*
  •  381 381
    • View Profile
Re: Steps/Inch on Lathe = 75,000; Seems a Tad High
« Reply #25 on: September 15, 2014, 05:52:36 AM »
And the Backlash_Linear is because it leaves open the option to add other backlash modes at a later date.
Linear is the simplest method to handle backlash, but there are other more complex methods.