How to solve the problem that step motors run out of sync?

Moderators: TomKerekes, dynomotion

Post Reply
yethsts
Posts: 28
Joined: Sat Jul 25, 2020 11:17 pm

How to solve the problem that step motors run out of sync?

Post by yethsts » Tue Aug 11, 2020 1:40 am

Dear Dynomiton,
We use five step motors without any encoder module to constitute an open loop gantry system now. When I run a c program to initialize and seek the home position, both the two step motors in vertical direction (in my frame, up is the positive direction of z-axis, down is negative direction of z) work synchronously and fine. And when I first single-step run your example gcode program named as “Dynomotion.ngc”, the two step motors in vertical direction work synchronously and fine too. But if I run the gcode program continuously, the two step motors in vertical direction always run out of sync so the gantry is stuck. Then I realigned the gantry system and single-step run the gcode again, but this time the two vertical motors also run out of sync.The corresponding gcode is:

G1 X-37.939 Y8.793 Z16.000
G1 X-37.939 Y8.793 Z6.000
G1 X-35.617 Y8.793 Z6.000
G1 X-34.780 Y8.748 Z6.000
G1 X-34.060 Y8.622 Z6.000
G1 X-33.448 Y8.379 Z6.000

It must be pointed out that I have use the configuration “Ch->MasterAxis=” to configure one motor as slave and another as master in the initialization c program. But there is a load weighting about 5 kg on the crossbar. And sometimes the load is not in the middle position of the crossbar. This means the two step motors in vertical direction may not be under the same force.

I think this may because the two z-axis step motors move too quickly due to the gcode, isn’t it? Because in initialization c program they work fine. And they always work fine too when I click the green jog button of KmotionCNC. But how can I solve it? I think maybe I should reduce the motion speed of z-axis, but how can I do it without change the gcode program? I guess I should change the configuration in: “Tool setup-trajectory planner-Axis parameters”, is this right? In addition to this method, can we add some encoders in z-axis to constitute a close loop system and use the configuration of “Ch->MaxFollowingError” to limit the out of sync? Now this option is set as:1000000000 because there are no encoders now.

The third method I think maybe I can change the frame to make the vertical direction as y axis and z axis is a horizontal direction. I guess the author of “Dynomotion.ngc” program uses the y-axis as a vertical axis and z-axis as a horizontal axis, isn’t it? But this method can’t solve the problem of out of sync when the gantry moves fast in vertical direction.

Findally, I attach my trajectory planner screen here:
批注 2020-08-10 193153.jpg
Thank you very much for your kind reply.

Yours,
Huang Lei
08-10-2020

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

Re: How to solve the problem that step motors run out of sync?

Post by TomKerekes » Tue Aug 11, 2020 5:34 pm

Hi Huang,
I think this may because the two z-axis step motors move too quickly due to the gcode, isn’t it? Because in initialization c program they work fine. And they always work fine too when I click the green jog button of KmotionCNC. But how can I solve it? I think maybe I should reduce the motion speed of z-axis, but how can I do it without change the gcode program?
The GCode normally contains a F word to set the Feed Rate. Why can't you change the GCode?

I guess I should change the configuration in: “Tool setup-trajectory planner-Axis parameters”, is this right?
Yes you can set the maximum feed rate for each axis there. See also here.

In addition to this method, can we add some encoders in z-axis to constitute a close loop system and use the configuration of “Ch->MaxFollowingError” to limit the out of sync? Now this option is set as:1000000000 because there are no encoders now.
Yes, but this will not solve the problem, but rather allow you to detect any problem and stop


Findally, I attach my trajectory planner screen here:
It all depends on what type of system you have. But 10 inches/sec is quite fast for a stepper motor based machine. Also 30 inches/sec^2 acceleration is fairly aggressive.
Regards,

Tom Kerekes
Dynomotion, Inc.

yethsts
Posts: 28
Joined: Sat Jul 25, 2020 11:17 pm

Re: How to solve the problem that step motors run out of sync?

Post by yethsts » Tue Aug 18, 2020 12:12 am

Yes, after I decrease the feed rate and the v, A, j value in Trajectory planner. The problem is solved. Thank you.

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

Re: How to solve the problem that step motors run out of sync?

Post by TomKerekes » Tue Aug 18, 2020 12:19 am

Great. Thanks for taking the time to post back.
Regards,

Tom Kerekes
Dynomotion, Inc.

Post Reply