Mesa 7i76e + 7i85S encoder feedback problem

More
24 Jan 2021 19:45 - 24 Jan 2021 19:49 #196461 by fenolski
Hi Guys

I built open-loop LinuxCNC milling machine. I tuned the axis. I decided to add linear TTL 5um encoders.
I connected 7i85s, programmed 7i76e+7i85s, mounted and connected encoders. I set encoder scale to 250 to get rig of follow error (see photos). This scale is strange as it should be something like 200 for this encoders.

When I move x axis all is fine until I stop. When I stop jog I get en error "Joint 0 following error" and the machine goes off-line. When I try to make machine online, X stepper motor tries to rotate, LinuxCNC puts immediately "Joint 0 following error" and goes off-line. To make another one-move test I need to restart LinuxCNC.

Worse case is when I try to use homing X. Then after LinuxCNC restart machine still is in homing procedure. In this case I need also to turn the mesa power off and on.

I really have no idea what is happening. I measured 7i85 voltage - 4.98V - so it's not a case. A and B readings are not good (see photos) even in 16k samples mode.
I attached HAL and INI files and HAL scope graphs
Attachments:
Last edit: 24 Jan 2021 19:49 by fenolski. Reason: Wrong photos

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

More
24 Jan 2021 20:00 #196464 by andypugh
You won't be able to see the scale quadrature pulses properly if your only thread is the servo thread, except at low speeds (ie, less than 5mm/S, possibly 1/4 that)

Yes, 5um scales should be 200 pulse/mm so 250 does not make sense. Is your primary scale correct? ie, do the axes actually move the programmed distance?

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

More
24 Jan 2021 20:15 #196467 by fenolski
I set all scales properly, but I crosscheck tomorrow. I'll change also A/B at low speeds.
And what about error and this strange behavior of linuxcnc?

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

More
24 Jan 2021 20:32 #196469 by andypugh
I don't know about the rest of it, but it _could_ be a scale mismatch.

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

More
24 Jan 2021 20:39 #196470 by chris@cnc
check that the jumpers on the 7i85s are set to ttl mode. second idea. start the config without encoder. so you See the encoder in halshow, measure and count. somehow you have to get to 200. And double check wiring.

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

More
24 Jan 2021 20:40 #196471 by PCW
For encoder feedback I would first get open loop working properly
and the verify that the encoder position is correct and repeatable
before closing the feedback loop.

Note as Andy said, that the A/B signals displayed in halscope are not
representative of the inputs unless you are moving _very_ slow because
you are only sampling the inputs at the servo thread rate.

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

More
25 Jan 2021 20:07 #196550 by fenolski
Hi Guys

Today I configured again fresh openloop-mill. All worked fine, steppers rotated smoothly.
I did new encoder connectors to 7i85S.
I tested slowly with halscope A/B signals which looked perfectly.
I repaired some mistakes in .ini file of closed-loop mill.
Encoders scales are now correct - 200.
I put in attachment photo of x-pos-cmd, x-pos-fb and follow error represented by sum2.0.out signal. All looks good. Sorry that it's not a screenshot but I'm a rookie in Linux world.

Unfortunately I still have some problems:
1. even if I set in .ini file ferror =10, 100 or even 1000 I always get "joint 0 follow error". This error appears only in the moment of releasing jog button. As you can see on the photo follow error is lower that 0.2mm. No idea where is a problem.
2. After closing a loop stepper motor works strange. In open loop mode it rotated smoothly. Now it looks like the stepper do some small jumps. It rotation is not smooth. Any idea? (P=1000, the rest is set to 0)
Attachments:

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

More
25 Jan 2021 20:43 #196557 by PCW
First I'm not sure why you have the sum2 function, closed loop following error
should be handled exactly the same as open loop following error. Its simply the
difference between the commanded joint position and the actual joint position and
calculated internally. It does not need any additional hal support.

Second a P gain of 1000 is way too high for a system using encoder feedback
1000 is used for open loop systems because they are nearly perfect first
order control loops. For closed loop, I would start at 10 or so and work my way up

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

More
25 Jan 2021 21:51 #196567 by fenolski
sum2 = x-pos-cmd + (-1*x-pos-fb) so it shows an error between commanded and current position. This error is low.

I'll try tomorrow other PID devices.

Any idea why I get follow error just after I release the jog button?

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

More
25 Jan 2021 22:03 #196571 by PCW
LinuxCNC already calculates this: joint.N.f-error
and this is the value to monitor as it is what is checked
for exceeding the following error limits.

Not sure why you are getting the following error, but
in any case joint.N.f-error is what to monitor.

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

Time to create page: 0.120 seconds
Powered by Kunena Forum