7i95 Encoder counter error

More
21 Mar 2024 19:20 - 21 Mar 2024 19:23 #296491 by kofsky0328
When I use 3 axes to move simultaneously, such as G0 X3000 Y3000 Z3000, and reciprocate from 0-3000, the encoder counts normally
But as soon as I move only one axis, any one, the encoder counts become inaccurate

All parameter settings for the three axes are the same
Last edit: 21 Mar 2024 19:23 by kofsky0328.

Please Log in or Create an account to join the conversation.

More
21 Mar 2024 19:43 #296495 by PCW
Replied by PCW on topic 7i95 Encoder counter error
Can you post your hal and ini files?

Please Log in or Create an account to join the conversation.

More
21 Mar 2024 19:47 #296496 by kofsky0328
Of course, forgot to mention that the encoder count comes from the servo drive
Attachments:

Please Log in or Create an account to join the conversation.

More
21 Mar 2024 20:17 - 21 Mar 2024 20:18 #296498 by PCW
Replied by PCW on topic 7i95 Encoder counter error
Not quite sure what you are trying to do here:You have velocity feedback from
the encoder (with a typo that probably doesn't matter)

net jonit-1-vel-fb <=> hm2_[MESA](BOARD).0.encoder.01.velocity => pid.y.feedback-deriv

but local position feedback from the stepgen:

net joint-1-pos-fb <=> joint.1.motor-pos-fb <= hm2_[MESA](BOARD).0.stepgen.01.position-fb => pid.y.feedback

and the encoder position values are not used
Last edit: 21 Mar 2024 20:18 by PCW.

Please Log in or Create an account to join the conversation.

More
21 Mar 2024 21:30 #296504 by kofsky0328
If I use encoder position feedback I get a follow error
So I use stepgen feedback to view the encoder count in halshow

Please Log in or Create an account to join the conversation.

More
22 Mar 2024 02:17 #296528 by PCW
Replied by PCW on topic 7i95 Encoder counter error
I would expect a following error because the PID tuning for encoder
feedback would be very different than the PID tuning for local stepgen
feedback (this is because of the significant delays between a commanded
step and the actual motion) It also depends on getting the encoder feedback
scaled properly in the the correct direction.

Also homing to index will not work with stepgen feedback unless
you use firmware that supports stepgen index. Without this
firmware, you must use encoder feedback to home to index.


 

Please Log in or Create an account to join the conversation.

More
22 Mar 2024 06:40 #296535 by kofsky0328
At first I thought it was a delay or something that caused the encoder counting error, but when I made the three axes move rapidly simultaneously, the encoder counting would not go wrong. This is what confused me.

about index, if the encoder feedback cannot be used to make a closed loop, I will use a grating ruler to connect the servo driver to make a closed loop without going through the mesa card, and the mesa card only connects the Z signal of the servo driver for homing, and the driver and the machine tool achieve a closed loop, but the driver Open the loop with Mesa. Obviously, this is not the optimal way to close the loop.

Please Log in or Create an account to join the conversation.

More
22 Mar 2024 14:02 #296544 by PCW
Replied by PCW on topic 7i95 Encoder counter error
Encoder feedback can be used to close the loop. To check this
you would need to lower the P term to say 10 and widen the following error
limits to see the system behavior using halscope.

If you only use index, you must have firmware that implements stepgen index
to be able to home to index, since the stepgen feedback position must be zeroed
at index occurrence, and this requires special stepgen hardware.

Also note that you must disconnect the encoder velocity feedback from
the PID in this case (actually this should always be disconnected even if encoder
feedback is used)

Here is 7I95 firmware that implements step/dir index:

 

File Attachment:

File Name: 7i95sdid.zip
File Size:125 KB


Note that with this firmware, there are now 2 index enable pins,
encoder.xx.index-enable and stepgen.xx.index-enable
and the proper one must be used in hal based on the feedback source

This firmware may require LinuxCNC 2.9 or master
Attachments:
The following user(s) said Thank You: kofsky0328

Please Log in or Create an account to join the conversation.

More
22 Mar 2024 17:42 #296552 by kofsky0328
Oh, you are the best, thank you very much for your help

But just using the index is the last resort, I think the closed loop from the mesa card to the drive is the optimal solution (is it?)

I will try to continue debugging the PID to achieve full speed operation without following errors

Please Log in or Create an account to join the conversation.

More
23 Mar 2024 01:56 #296568 by tommylight


I think the closed loop from the mesa card to the drive is the optimal solution (is it?)

I will try to continue debugging the PID to achieve full speed operation without following errors

Yes it is the optimal solution, although most of the time there is no difference, until some motor skips steps, then it becomes very, very useful.
And PID is quite easy to , example of my config
P = 50
I = 0
D = 0
FF0 = 0
FF1 = 0.38
FF2 = 0
BIAS = 0
DEADBAND = 0.001
Using Gecko G320 and Mesa 7i95
As PCW already mentioned (not sure if this topic) do not start tuning the PID without having the machine working in open loop first with scaling correct, then make sure encoders count in the right direction and with correct scaling, only then switch to closed loop and use the above values as a starting point.
The following user(s) said Thank You: kofsky0328

Please Log in or Create an account to join the conversation.

Time to create page: 0.219 seconds
Powered by Kunena Forum