double pid loop ?

More
19 Jul 2016 18:19 - 19 Jul 2016 18:19 #77667 by vre
Replied by vre on topic double pid loop ?
no i have not tunned yet the drives now iam reading manual how to tune.
thank you.
Last edit: 19 Jul 2016 18:19 by vre.

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

More
24 Jul 2016 03:20 - 24 Jul 2016 03:23 #77898 by vre
Replied by vre on topic double pid loop ?
I have checked various P/I/D/FF1 values but the best results i get is with P=0/I=0/D=0/FF1=1
with these values i get this in halscope with G0 Z40 (mm).
It seems that ferror is proportional to velocity-cmd

Attachments:
Last edit: 24 Jul 2016 03:23 by vre.

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

More
24 Jul 2016 03:41 - 24 Jul 2016 13:55 #77899 by PCW
Replied by PCW on topic double pid loop ?
If you get a error proportional to velocity it means FF1 is wrong
( or equivalently FF1=1 and either the input (encoder) or output ( step) scales or both are wrong )

Edit I think I'm wrong its not a FF1 problem (because it ends up in the right place even with no feedback)
But it may be that you have set your acceleration faster than your drive settings can follow

Or perhaps the drive has a long delay from step input to actual motion.
This might be due to some filtering option on the drive that you can disable

Also, with velocity mode and encoder feedback you _MUST_ have some P or you will get long term drift
Last edit: 24 Jul 2016 13:55 by PCW.
The following user(s) said Thank You: vre

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

More
25 Jul 2016 01:55 #77959 by vre
Replied by vre on topic double pid loop ?
I have reduced ferror to more than half with P=0 I=0 D=1.3 FF1=1
D has a huge effect on ferror that is proportional to velocity-cmd

Attachments:

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

More
25 Jul 2016 02:05 - 25 Jul 2016 02:10 #77960 by PCW
Replied by PCW on topic double pid loop ?
P would make a lot more sense (and as I say without P you _will_ have drift)

But the error is so huge that it indicates something is fundamentally wrong
probably in the drive setup

it almost looks like there is a 50 ms or so delay from steps to feedback position
Last edit: 25 Jul 2016 02:10 by PCW.

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

More
25 Jul 2016 04:10 - 25 Jul 2016 04:22 #77961 by vre
Replied by vre on topic double pid loop ?
You are right something is wrong with the drive.
But i think i found it (manual is crap in chinese and iam using auto translator)
1)disabled an S shaped filter
2)set position loop feedforward gain to 100% from 0%
results with p/i/d=0 FF1=1 :)




Now its time for fine tuning...
I have ordered and one analog servo mesa card for speed mode loop and i think i will get better results with this setup.
Attachments:
Last edit: 25 Jul 2016 04:22 by vre.

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

More
27 Jul 2016 06:05 - 27 Jul 2016 06:07 #78061 by vre
Replied by vre on topic double pid loop ?
I have observed a strange behavior...
My scales for encoders and step generators are 10000 for 1 mm
so if i give G0 1 it means 1mm distance and 10000 pulses from step generator
but i read with halmeter hm2_5i24.0.0encoder.00.count pin 10001 pulses.
Linuxcnc sends more pulses about 1 pulse more every 10000 and sometimes linuxcnc sends pulses when no command executed .
I have closed loop step-dir with p/i/d/ff0/ff2=0 ff1=1 .
(If i add some p i get exact the pulses i give with some time delay and some oscillation and no drifting)

In open loop step dir if i give G0 1 i read with halmeter hm2_5i24.0.0encoder.00.count pin 10000 pulses exactly and no drifting.
I have in open loop step-dir p=1000 i/d/ff0/ff2=0 ff1=1

It seems that the servos working more normal in open loop.

Can i configure linuxcnc open loop step dir and have encoders only as dro and no as full closed loop ?
Last edit: 27 Jul 2016 06:07 by vre.

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

More
27 Jul 2016 13:18 - 27 Jul 2016 14:20 #78066 by Todd Zuercher
Replied by Todd Zuercher on topic double pid loop ?
That would be normal and expected behavior for a closed loop system. All servos will have some error of at least a few encoder counts. Whether or not you run the system open or closed loop in Linuxcnc I would be very surprised if the actual following error of the servo is much different.
You didn't say what your P term numbers were when you were testing closed loop. They likely will be something less than the 1000 that you use when running open loop (they have to be because of delays and reaction times of the mechanical system vs. the near perfect reaction of the open loop) but it also needs to be >0. Figuring out what the ideal numbers should be is servo tuning.

You can run it open loop and still use the encoder feedback for DRO and more, just connect the encoder position feed back (hal pin something like hm2_5i25.0.encoder.00.position) to the axis.N.motor-pos-fb, but keep the stepgen position (and velocity) feedbacks connected to the PID loops.
Last edit: 27 Jul 2016 14:20 by Todd Zuercher.

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

More
27 Jul 2016 14:10 #78070 by PCW
Replied by PCW on topic double pid loop ?
If you have no P, you are guaranteed that the counts will be off by a small amount
(an over a long time can be off by any amount, there is no limit)

If you cannot use any P without oscillation, this suggests that the drive still has a large lag between command (step pulses)
and actual motion (or delay in reporting the encoder count) So it may simply be not suitable for external closed loop control

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

More
27 Jul 2016 22:16 - 27 Jul 2016 22:48 #78084 by vre
Replied by vre on topic double pid loop ?
with P=30 / I=0 / D=0.1 / FF0=0 / FF1=1 / FF2=0 iam getting max 0.005mm following error.
In my ini file i have
FERROR = 0.02
MIN_FERROR = 0.02
and with these FERROR MIN_FERROR values passed several tests of G-code successfully
(motor is big 1.8kw so rotor have high inertia)

Attachments:
Last edit: 27 Jul 2016 22:48 by vre.

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

Moderators: PCWjmelson
Time to create page: 0.488 seconds
Powered by Kunena Forum