PID servo tuning of leadshine ELM series AC servo motor with FEEDBACK to KFLOP AND KANALOG

Moderators: TomKerekes, dynomotion

Post Reply
AmitKumar171
Posts: 65
Joined: Tue Feb 20, 2018 7:35 am
Location: India
Contact:

PID servo tuning of leadshine ELM series AC servo motor with FEEDBACK to KFLOP AND KANALOG

Post by AmitKumar171 » Mon Dec 30, 2019 10:33 am

Hi tom,

I am using kflop board wired with kanalog board for my LEADSHINE ELM series AC servo motor and in that servo motor i have encoder feedback also connected to kanalog encoder input A+,A-,B+,B-.

ch1->InputMode=ENCODER_MODE;
ch1->OutputMode=DAC_SERVO_MODE;
ch1->Vel=53000;
ch1->Accel=260000;
ch1->Jerk=1e+06;
ch1->P=0.02;
ch1->I=0;
ch1->D=0;
ch1->FFAccel=0;
ch1->FFVel=0;
ch1->MaxI=100;
ch1->MaxErr=160000;
ch1->MaxOutput=2047;
ch1->DeadBandGain=1;
ch1->DeadBandRange=0;
ch1->InputChan0=1;
ch1->InputChan1=1;
ch1->OutputChan0=1;
ch1->OutputChan1=1;
ch1->MasterAxis=-1;
ch1->LimitSwitchOptions=0x100;
ch1->LimitSwitchNegBit=2;
ch1->LimitSwitchPosBit=4;
ch1->InputGain0=0.16;
ch1->InputGain1=1;
ch1->InputOffset0=0;
ch1->InputOffset1=0;
ch1->invDistPerCycle=1;
ch1->Lead=0;
ch1->MaxFollowingError=1000000000;
ch1->StepperAmplitude=20;

ch1->iir[0].B0=1.000000;
ch1->iir[0].B1=0.000000;
ch1->iir[0].B2=0.000000;
ch1->iir[0].A1=0.000000;
ch1->iir[0].A2=0.000000;

ch1->iir[1].B0=1.000000;
ch1->iir[1].B1=0.000000;
ch1->iir[1].B2=0.000000;
ch1->iir[1].A1=0.000000;
ch1->iir[1].A2=0.000000;

ch1->iir[2].B0=0.000769;
ch1->iir[2].B1=0.001538;
ch1->iir[2].B2=0.000769;
ch1->iir[2].A1=1.920810;
ch1->iir[2].A2=-0.923885;
EnableAxisDest(1,0);

the above is my init file .

I am controlling servo in velocity mode.

I want to understand each and every parameter in above init.c file which is used for servo axis tuning of velocity mode servo. ?

and When i press init.c on kmotioncnc, DAC voltage in kmotion.exe became DAC -3 = 0.015v and motor rotates by slight rotation and then stops. please help me with the both problems.

Waiting for your kind reply.

Waiting for your kind reply.
Thank You

AMIT KUMAR

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

Re: PID servo tuning of leadshine ELM series AC servo motor with FEEDBACK to KFLOP AND KANALOG

Post by TomKerekes » Mon Dec 30, 2019 5:09 pm

Hi Amit,
I want to understand each and every parameter in above init.c file which is used for servo axis tuning of velocity mode servo. ?
See the Help for the Step Response Screen Parameters. Click on Help then on any Parameter for a description. Also see the wiki on tuning.


When i press init.c on kmotioncnc, DAC voltage in kmotion.exe became DAC -3 = 0.015v and motor rotates by slight rotation and then stops.
Kanalog DACs and analog amplifiers often have some offset. You might read this. In your case the output must be 0.015V to stop moving. When you enable the axis an output of 0 will cause some movement. With only P Gain the axis will move until there is enough error to cause the output to be 0.015V and stop the motion. Because of such low P Gain the error will need to be relatively large. Also the small input Gain 0.16 will increase the movement. With any I Gain the error would be 0.

HTH
Regards,

Tom Kerekes
Dynomotion, Inc.

AmitKumar171
Posts: 65
Joined: Tue Feb 20, 2018 7:35 am
Location: India
Contact:

Re: PID servo tuning of leadshine ELM series AC servo motor with FEEDBACK to KFLOP AND KANALOG

Post by AmitKumar171 » Mon Dec 30, 2019 6:21 pm

Hi tom,

Thanks for the earlier reply.

I have 2 doubts, first is what will be the range of P, I and D for dac servo control method. Or how should i start any starting value of P, I and D so i can tune it properly. ?

Second doubt is , i have absolute encoder 17 bit in motor and feedback is connected to kanalog, is there any way to get homing location of that absolute encoder in kflop or kanalog using c program for DAC controlled servo. ? So for getting machine coordinate it will be easy.

Waiting for your kind reply.?
Thank You

AMIT KUMAR

Moray
Posts: 152
Joined: Thu Apr 26, 2018 10:16 pm

Re: PID servo tuning of leadshine ELM series AC servo motor with FEEDBACK to KFLOP AND KANALOG

Post by Moray » Mon Dec 30, 2019 9:09 pm

AmitKumar171 wrote:
Mon Dec 30, 2019 6:21 pm
Hi tom,

Thanks for the earlier reply.

I have 2 doubts, first is what will be the range of P, I and D for dac servo control method. Or how should i start any starting value of P, I and D so i can tune it properly. ?
0 to 1023
Second doubt is , i have absolute encoder 17 bit in motor and feedback is connected to kanalog, is there any way to get homing location of that absolute encoder in kflop or kanalog using c program for DAC controlled servo. ? So for getting machine coordinate it will be easy.
The drive will be internally converting the 17bit encoder to quadrature, and as part of that, it should also have the option to either output an index pulse (usually referenced as Z/_Z), and/or the drive will have inbuilt homing.

Both options involve moving the axis to a known position (usually a homing switch, or if configured correctly you can use a limit switch), then using the first method you move the axis until the index pulse is detected (there should be an index homing C program example). Using the second method, once at the known position, you trigger the drive to carry out it's own homing routine.

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

Re: PID servo tuning of leadshine ELM series AC servo motor with FEEDBACK to KFLOP AND KANALOG

Post by TomKerekes » Mon Dec 30, 2019 10:04 pm

Hi Amit,
what will be the range of P, I and D for dac servo control method. Or how should i start any starting value of P, I and D so i can tune it properly. ?
The ranges are dependent on the components of your system.

You already have a starting value for P. Please read and follow the tuning overview.

I is often a small number as it accumulates rapidly every sample (90us). You might start with 0.001

D is often a number 10-100X larger than P. One way I think about D is it is extrapolating forward in time 10-100 sample times (each 90us) where the axis should be in the future.

These assume you leave the input and output gains at 1.

Regards
Regards,

Tom Kerekes
Dynomotion, Inc.

AmitKumar171
Posts: 65
Joined: Tue Feb 20, 2018 7:35 am
Location: India
Contact:

Re: PID servo tuning of leadshine ELM series AC servo motor with FEEDBACK to KFLOP AND KANALOG

Post by AmitKumar171 » Tue Dec 31, 2019 5:41 am

The drive will be internally converting the 17bit encoder to quadrature, and as part of that, it should also have the option to either output an index pulse (usually referenced as Z/_Z), and/or the drive will have inbuilt homing.

Both options involve moving the axis to a known position (usually a homing switch, or if configured correctly you can use a limit switch), then using the first method you move the axis until the index pulse is detected (there should be an index homing C program example). Using the second method, once at the known position, you trigger the drive to carry out it's own homing routine.


hi there,

thanks for the reply now i understand homing using index pulse Z/_Z.

But how it works in kflop ?

Can you give some sample c program for index homing c program for DAC servo. as you said earlier.

WAiting for your kind reply.
Thank You

AMIT KUMAR

AmitKumar171
Posts: 65
Joined: Tue Feb 20, 2018 7:35 am
Location: India
Contact:

Re: PID servo tuning of leadshine ELM series AC servo motor with FEEDBACK to KFLOP AND KANALOG

Post by AmitKumar171 » Tue Dec 31, 2019 1:27 pm

Hi tom,

I tried what you said for PID servo tuning and i have some doubts.

I am using axis channel 1 for my servo tuning axis.

My counts per inch is 50800 counts per inch (2000 counts per mm). I am getting 50 counts difference in encoder position from command direction change using DAC servo system.

In Kmotion.exe axis i have attached images for the problem as well.

First condition is G53 G1 Y0 mm, i am getting 250 encoder counts in position and 0 counts in destination column (axis tab).
y0_.png
I gave command of G53 G1 Y100 mm , i am getting 200200 encoder counts in position and 200000 counts in destination column (axis tab).
y100_.png
I gave command of G53 G1 Y200 mm , i am getting 400200 encoder counts in position and 400000 counts in destination column (axis tab).
y_200.png
I gave command of G53 G1 Y100 mm , i am getting 200250 encoder counts in position and 200000 counts in destination column (axis tab).
y-100_.png
after I gave again command of G53 G1 Y0, i am getting 250 encoder counts in position and 0 counts in destination coulumn (axis tab).
y0_.png
in positive direction i.e. y0 to y100, i am losing 50 counts. (200250 should be the actual value but i am getting 200200)

in negative direction i.e. y100 to y0 , all count are ok. (200250 i am getting)

Please give solution for the above problem.

I already sent the init file in starting of this thread.

Waiting for your kind reply.
Thank You

AMIT KUMAR

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

Re: PID servo tuning of leadshine ELM series AC servo motor with FEEDBACK to KFLOP AND KANALOG

Post by TomKerekes » Tue Dec 31, 2019 5:27 pm

Hi Amit,
Can you give some sample c program for index homing c program for DAC servo. as you said earlier.
Homing is the same regardless of axis type. See the SimpleHomeIndexFunctionTest.c example.

in positive direction i.e. y0 to y100, i am losing 50 counts. (200250 should be the actual value but i am getting 200200)

in negative direction i.e. y100 to y0 , all count are ok. (200250 i am getting)
That would be normal if the axis was not tuned (low P gain and no I Gain). You don't seem to be following or responding to our instructions. Don't run GCode until after you have the Axis configured and tuned. Did you change the InputGain0 to 1? What parts of the Basic Servo Tuning Overview have you performed?
Regards,

Tom Kerekes
Dynomotion, Inc.

AmitKumar171
Posts: 65
Joined: Tue Feb 20, 2018 7:35 am
Location: India
Contact:

Re: PID servo tuning of leadshine ELM series AC servo motor with FEEDBACK to KFLOP AND KANALOG

Post by AmitKumar171 » Thu Jan 02, 2020 5:56 am

Hi tom,

Thanks for the earlier reply.
That would be normal if the axis was not tuned (low P gain and no I Gain).
How to tune it please explain as i have gone through the manual but i am not understanding which parameters are significant for the DAC servo tuning.
You don't seem to be following or responding to our instructions. Don't run GCode until after you have the Axis configured and tuned.
I followed the instructions but i am not getting how to do it ?
Did you change the InputGain0 to 1?
Yes i changed InputGain0 to 1.
What parts of the Basic Servo Tuning Overview have you performed?
I changed input gain and velocity, acceleration, jerk in the init file. and P gain i made 0.02.

How to proceed with servo tuning as manual is not clear. ?

What parameters are significant enough to give the error that i am getting 50 counts. ?

and How to resolve that error as well. ?

Waiting for your kind reply.
Thank You

AMIT KUMAR

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

Re: PID servo tuning of leadshine ELM series AC servo motor with FEEDBACK to KFLOP AND KANALOG

Post by TomKerekes » Thu Jan 02, 2020 6:16 pm

Hi Amit
I followed the instructions but i am not getting how to do it ?
Responding like this is not helpful. Please describe in detail exactly what you do/don't understand, what you did, and what happened.

Servo Tuning is complex and involves many steps. Any single thing not set properly can have a bad result. You will need to put some effort into communicating and understanding. If you wish for us to tune your system for you we can connect into your system and do this for a fee. We charge $250/hr with a 2 hour minimum.

You seem to be at step - #3 Determine maximum level of P Gain

Please do this. Increase P until the system goes unstable, then decrease ~30% to be stable. Show us a Step Response Plot of the error while doing a Move.

Yes i changed InputGain0 to 1.
Good. But you said you were using the previous parameters. Always post the parameters you are actually using. All the parameters for an axis are on the Config/Flash, Step Response, and IIR Filters screens.
Regards,

Tom Kerekes
Dynomotion, Inc.

Post Reply