585,705 active members*
3,835 visitors online*
Register for free
Login
Results 1 to 10 of 10
  1. #1
    Join Date
    Oct 2004
    Posts
    147

    KFLOP+Kanalog Analog Velocity Servo tuning

    Hello Dyno,

    I am having trouble tuning the Yaskawa Legend under load.

    How do you recommend arriving at a reasonable base line for PID?

    I do not understand enough about different hardware vendor's scaling values on PID params and haven't a clue how to calculate a reasonably safe and stable loop with your system.

    If I can get it where it is stable enough to accept commanded position under normal load, I can fine tune it I'm sure.

    Amplifier Model::
    SGDG-10GT Yaskawa Legend

    Manual::
    http://www.yaskawa.com/site/dmservo.nsf/link2/TKUR-5PHSY9/$file/LEGENDUsersVersionF.pdf



    Thanks,
    Brad Murry

  2. #2
    Join Date
    Oct 2004
    Posts
    147

    Init File

    Hello,

    I have ben focusing on the CH0(X) for now and I have tried many combinations of numbers for PID(including P=1,I=0,D=0).

    The numbers used here are nowhere close to what I am accustomed to on other devices(they all seem to be different).

    I need the magic decoder ring....

    Here is the int.c file I am using::

    Code:
    #include "KMotionDef.h"
    
    #define QA 26	// define to which IO bits the AB signals are connected 
    #define QB 27	
    
    main()
    {
      
    
        ch0->InputMode=ENCODER_MODE;
    	ch0->OutputMode=DAC_SERVO_MODE;
    	ch0->Vel=100000.000000;
    	ch0->Accel=1000000.000000;
    	ch0->Jerk=10000000.000000;
    	ch0->P=2.00000;
    	ch0->I=0.000000;
    	ch0->D=15.000000;
    	ch0->FFAccel=0.000000;
    	ch0->FFVel=0.000000;
    	ch0->MaxI=2000.000000;
    	ch0->MaxErr=20000.000000;
    	ch0->MaxOutput=2000.000000;
    	ch0->DeadBandGain=0.000000;
    	ch0->DeadBandRange=0.000000;
    	ch0->InputChan0=0;
    	ch0->InputChan1=0;
    	ch0->OutputChan0=0;
    	ch0->OutputChan1=0;
    	ch0->LimitSwitchOptions=0x20;
    	ch0->InputGain0=1.000000;
    	ch0->InputGain1=1.000000;
    	ch0->InputOffset0=0.000000;
    	ch0->InputOffset1=0.000000;
    	ch0->invDistPerCycle=0.000250;
    	ch0->Lead=0.000000;
    	ch0->MaxFollowingError=1000.000000;
    	ch0->StepperAmplitude=100.000000;
    	
    	ch1->InputMode=ENCODER_MODE;
    	ch1->OutputMode=DAC_SERVO_MODE;
    	ch1->Vel=100000.000000;
    	ch1->Accel=1000000.000000;
    	ch1->Jerk=10000000.000000;
    	ch1->P=1.00000;
    	ch1->I=0.00000;
    	ch1->D=24.000000;
    	ch1->FFAccel=0.000000;
    	ch1->FFVel=0.000000;
    	ch1->MaxI=2000.000000;
    	ch1->MaxErr=20000.000000;
    	ch1->MaxOutput=2000.000000;
    	ch1->DeadBandGain=0.000000;
    	ch1->DeadBandRange=0.000000;
    	ch1->InputChan0=1;
    	ch1->InputChan1=1;
    	ch1->OutputChan0=1;
    	ch1->OutputChan1=1;
    	ch1->LimitSwitchOptions=0x20;
    	ch1->InputGain0=1.000000;
    	ch1->InputGain1=1.000000;
    	ch1->InputOffset0=0.000000;
    	ch1->InputOffset1=0.000000;
    	ch1->invDistPerCycle=0.000250;
    	ch1->Lead=0.000000;
    	ch1->MaxFollowingError=1000.000000;
    	ch1->StepperAmplitude=100.000000;
    /*
    	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=1.000000;
    	ch1->iir[2].B1=0.000000;
    	ch1->iir[2].B2=0.000000;
    	ch1->iir[2].A1=0.000000;
    	ch1->iir[2].A2=0.000000;
    	 */
    	EnableAxis(0);
    	EnableAxis(1);
    	SetBit(152); // Amp Enable X
    	SetBit(153); // Amp Enable Y
     
    }

    Thanks,
    Brad Murry

  3. #3
    Join Date
    May 2006
    Posts
    4045
    Hi Brad,

    The basic process for setting up a Kanalog Servo is:

    #1 Check that the DAC can command Velocity to the Motor/Amplifier
    #2 Check the Encoder Feedback is working properly
    #3 Enable the axis and check that it servos
    #4 Perform a Move on the Step Response Screen to check the Response
    #5 Servo Tuning


    Step #1 (Check Amplifier)

    With the axis disabled, write values to the DAC using the Console Screen.

    The range of DAC values is +/-2047 counts which corresponds to +/-10V.

    ie.

    DAC0=100
    DAC0=-200
    DAC0=0

    The amplifier should be configured to control Velocity. If the amplifier performs a good velocity loop this makes closing the Position Loop very easy. Simple P gain should work reasonably well. If possible use tuning features in the Amplifier or other methods to optimize how well the amplifier is controlling velocity. If the Amplifier is controlling Velocity then load changes should not significantly change the motor speed. When commanded to zero speed it should resist motion (provide damping) and be hard to turn but not return back to where it was (that would be a position loop).

    If possible configure 10V (2047 DAC counts) to drive at least your max required speed and not much higher.

    Note that commanding zero will probably not command exactly zero speed due to noise and small offsets. This is not a problem. When the servo is enabled the servo will command whatever voltage necessary to hold position. The only real means of having no motion with the servo disabled is to disable the amplifier.


    Step #2 (Check Encoder)

    To check the encoder feedback a KFLOP Axis Channel must be configured as Encoder input for the Encoder Channel to be used.

    On the Config/Flash Screen load the Configuration

    KanalogInitialPID.mot

    Change the InputChan0 parameter to the Encoder Channel you are using.
    Change the OutputChan0 parameter to the DAC Channel you are using.

    Push "Download"

    On the Axis Screen the "Position" value should track the Encoder Position. Rotating the encoder should cause the encoder to count and then rotating the motor back to the original position should cause the Encoder Position to return to the original value.

    It may be helpful to Push the "Zero" button on the Step Response Screen to zero the Position at a particular Spot.



    #Step3 (Servo)

    Since the DAC/Motor/Amplifer are working and the Encoder is working we should be now able to servo.

    We have already set the default (low gain low output) servo parameters by loading the KanalogInitialPID.mot configuration.

    On the Step Response Screen push the "Zero" then "Enable" buttons. The servo should now hold position with a weak servo. If the motor is displaced it should return to where it was.

    If instead of servoing the motor runs away it is likely due to positive feedback causing the motor to drive away from the desired destination rather than toward the desired destination. A reversal anywhere in software, electrically, or mechanically can correct this. One simple method is to change the sign of the InputGain0 parameter from +1 to -1.



    Step #4 (move)
    On the Step Response Screen select a reasonable Move size (in encoder counts) and push "Move". The Axis should Disable the axis, download the parameters, Enable the axis, move the amount specified, then back to where it started, upload, and plot the results.

    The "Command, Position, Output vs Time" Plot mode should be selected at this time. The Command (Blue) plot is the trajectory (or Motion Profile) that was created using the Move Size, Max Velocity, Max Acceleration, and Max Jerk all in units of encoder counts.

    The Position (Red) Plot is the measured response.

    The Output (Green using Green axis on the right) is the DAC output to the Amplifier in DAC counts.


    Step #5 (tuning)

    The idea of servo tuning is to get obtain the required accuracy while remaining stable.

    This will be covered in more detail later, but the basic process it to:

    #1 increase PD gains until the system goes unstable then reduce them
    #2 add Filters - Low pass in Filter #2 reduce spikes in the output (ie 500Hz Q1.4)
    #3 add Lead/Lag compensator to increase phase margin (this often works better than using D gain)
    #3 increase Max values (Output, Integrator) to allow driving the motor amplifier higher to allow higher speeds

    #4 increase Vel, Acceleration, and Jerk to find optimal values
    #5 add I gain (typically small value of 0.0001) to reduce steady state (persistant errors).



    I hope this gets you started. Please let us know how far you were able to go and post plots of your results. *.png files work best. The Step Response, Config/Flash, and Filters screens are needed to see all the settings for an axis.

    Regards
    TK
    http://dynomotion.com

  4. #4
    Join Date
    Dec 2006
    Posts
    31
    Hi Brad,

    I'm using a similar system with Kmotion+Kanalog.
    I have used the method recommended by tom and made many tests to have a first satisfactory result. As you did I concentrated my efforts on a single axis then transposed to others with more or less success depending on the configuration of each axis.

    Actually I can say I have something good but much more important, stable.
    I'm working on automated routines like M6, M#... so I can give you that and help to transpose when appropriate.

    I'll ASAP read your posts on dynomotion groups and have a better idea.
    You can have a look on my folder : Fouijar CNC files.

    I'll keep in touch ASAP,

    Jerome

  5. #5
    Join Date
    Oct 2004
    Posts
    147
    Hello Tom,

    Turns out the coupling from the servo shaft to the gear box was in the wrong spot....

    Once the mechanical issue was resolved, I had stable motion at P1,I0,D0 and fair performance at P1.2,I0,D22.

    I still want to fine tune the system, but I ran out of time on this machine. There is one similar right behind it and I will have a little more time to dial it in.

    I want an aggressive but stable loop as I am accustomed to. These particular machines do not perform any coordinated motion, so I am after a severe trapezoidal profile. I think I heard a low jerk value will attenuate the smoothing?


    Thanks,

    Brad Murry

  6. #6
    Join Date
    Oct 2004
    Posts
    147
    Thanks Jerome!

    This particular machine uses custom software rather than M or G codes. That is one of the key features I like so much about the Kflop is that you can directly feed it line and arc segments for custom automation applications.

    I seemed to get decent initial performance out of the Legends, but I am certain things could be a lot better. As I have more time try to see what I can squeeze out of the loop, but I do not think many more machine in this configuration will be coming my way. The company is moving to servos that can accept step/dir signals.

    What numbers for PID did you wind up with?


    Thanks,
    Brad Murry

  7. #7
    Join Date
    Dec 2006
    Posts
    31
    Hi Brad,

    I actually have P: 4 I: 0.032 D: 35, the values aren't the same on each axis but they are all around this set of values.

    But this setup is based on large bandwidth with low following error. So if instantaneous dynamic precision isn't a concern...

    Do you have the Step/move graphs? And the bode plot? It could be interesting to see if any improvements are possible somewhere.
    I mean I don't have any idea how you system performs.

    Regards,

    J.

  8. #8
    Join Date
    May 2006
    Posts
    4045
    These particular machines do not perform any coordinated motion, so I am after a severe trapezoidal profile. I think I heard a low jerk value will attenuate the smoothing?
    Actually a trapezoidal velocity profile is an infinite Jerk situation. So if you want that set the Jerk to 1000X the Acceleration value.

    Regards
    TK
    http://dynomotion.com

  9. #9
    Join Date
    Jun 2012
    Posts
    35
    Hello,

    Total newbie at all this, but does the kflop enable all the servos/closed loop steppers to be monitors all at once? In other words instead of each one individually correcting, do they correct in tandem?

    Looking for a closed loop system that will do this for high accuracy, with Mach 3, or a mac compatible, if it exists, cnc software.

    Many thanks in advance,
    Chris

  10. #10
    Join Date
    May 2006
    Posts
    4045
    Hi Chris,

    I'm not sure I exactly understand your question. But yes all the closed loop control for all the axes happens continuously in parallel. KFLOP uses a 90us servo sample time. Every 90us the coordinated motion trajectory and/or the independent trajectories for all the axes is computed as well as all the servo calculations (PID+IIR filters+Feed Forwards+IO etc etc) is performed.

    Regards
    TK
    http://dynomotion.com

Similar Threads

  1. Replies: 158
    Last Post: 12-08-2014, 05:41 PM
  2. My Kflop/Kanalog test bed
    By PEU in forum Dynomotion/Kflop/Kanalog
    Replies: 6
    Last Post: 05-31-2013, 04:55 PM
  3. New CNC Router Project, Using Kflop, KANALOG, KMotion and Mach 3
    By Rickstar in forum Dynomotion/Kflop/Kanalog
    Replies: 3
    Last Post: 06-04-2012, 06:26 AM
  4. MACH 3 Motor Tuning Max Velocity 1150? No higher?
    By cjchands in forum Mach Mill
    Replies: 4
    Last Post: 10-16-2009, 04:25 PM
  5. Fine Tuning Velocity and Acceleration.
    By sunmix in forum Mach Software (ArtSoft software)
    Replies: 6
    Last Post: 09-30-2006, 07:46 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •