PID servo tuning of leadshine ELM series AC servo motor with FEEDBACK to KFLOP AND KANALOG
Moderators: TomKerekes, dynomotion
-
- Posts: 134
- Joined: Tue Feb 20, 2018 7:35 am
- Location: India
PID servo tuning of leadshine ELM series AC servo motor with FEEDBACK to KFLOP AND KANALOG
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.
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
AMIT KUMAR
- TomKerekes
- Posts: 2676
- 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
Hi Amit,
HTH
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.I want to understand each and every parameter in above init.c file which is used for servo axis tuning of velocity mode servo. ?
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.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.
HTH
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
-
- Posts: 134
- Joined: Tue Feb 20, 2018 7:35 am
- Location: India
Re: PID servo tuning of leadshine ELM series AC servo motor with FEEDBACK to KFLOP AND KANALOG
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.?
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
AMIT KUMAR
Re: PID servo tuning of leadshine ELM series AC servo motor with FEEDBACK to KFLOP AND KANALOG
0 to 1023AmitKumar171 wrote: ↑Mon Dec 30, 2019 6:21 pmHi 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. ?
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.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.
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.
- TomKerekes
- Posts: 2676
- 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
Hi Amit,
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
The ranges are dependent on the components of your system.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. ?
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.
Tom Kerekes
Dynomotion, Inc.
-
- Posts: 134
- Joined: Tue Feb 20, 2018 7:35 am
- Location: India
Re: PID servo tuning of leadshine ELM series AC servo motor with FEEDBACK to KFLOP AND KANALOG
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
AMIT KUMAR
-
- Posts: 134
- Joined: Tue Feb 20, 2018 7:35 am
- Location: India
Re: PID servo tuning of leadshine ELM series AC servo motor with FEEDBACK to KFLOP AND KANALOG
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). I gave command of G53 G1 Y100 mm , i am getting 200200 encoder counts in position and 200000 counts in destination column (axis tab). I gave command of G53 G1 Y200 mm , i am getting 400200 encoder counts in position and 400000 counts in destination column (axis tab). I gave command of G53 G1 Y100 mm , i am getting 200250 encoder counts in position and 200000 counts in destination column (axis tab). 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). 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.
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). I gave command of G53 G1 Y100 mm , i am getting 200200 encoder counts in position and 200000 counts in destination column (axis tab). I gave command of G53 G1 Y200 mm , i am getting 400200 encoder counts in position and 400000 counts in destination column (axis tab). I gave command of G53 G1 Y100 mm , i am getting 200250 encoder counts in position and 200000 counts in destination column (axis tab). 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). 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
AMIT KUMAR
- TomKerekes
- Posts: 2676
- 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
Hi Amit,
Homing is the same regardless of axis type. See the SimpleHomeIndexFunctionTest.c example.Can you give some sample c program for index homing c program for DAC servo. as you said earlier.
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?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)
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
-
- Posts: 134
- Joined: Tue Feb 20, 2018 7:35 am
- Location: India
Re: PID servo tuning of leadshine ELM series AC servo motor with FEEDBACK to KFLOP AND KANALOG
Hi tom,
Thanks for the earlier reply.
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.
Thanks for the earlier reply.
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.That would be normal if the axis was not tuned (low P gain and no I Gain).
I followed the instructions but i am not getting how to do it ?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.
Yes i changed InputGain0 to 1.Did you change the InputGain0 to 1?
I changed input gain and velocity, acceleration, jerk in the init file. and P gain i made 0.02.What parts of the Basic Servo Tuning Overview have you performed?
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
AMIT KUMAR
- TomKerekes
- Posts: 2676
- 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
Hi Amit
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.
Responding like this is not helpful. Please describe in detail exactly what you do/don't understand, what you did, and what happened.I followed the instructions but i am not getting how to do it ?
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.
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.Yes i changed InputGain0 to 1.
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.