585,763 active members*
4,191 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > Dynomotion/Kflop/Kanalog > Need help setting up KFlop and KAnalog with Analog Servo Drives and Mach 3
Results 1 to 10 of 10
  1. #1
    Join Date
    Nov 2012
    Posts
    18

    Need help setting up KFlop and KAnalog with Analog Servo Drives and Mach 3

    I'm rebuilding a CNC mill with analog servo drives and want to run it with Mach 3. I have KFlop and Kanalog but the documentation on how to connect anything to Kanalog, or how to actually program it seems to be pretty sparse. I'm hoping that someone here has the experience and a working setup that would be able to help me in this regard.

  2. #2
    Join Date
    May 2006
    Posts
    4045

    Re: Need help setting up KFlop and KAnalog with Analog Servo Drives and Mach 3

    Hi MetalStorm,

    Attached are two Kanalog wiring diagrams submitted by other Users. You might also read this Thread:
    http://www.cnczone.com/forums/dynomo...ion-kflop.html

    The basic connections are the Kanalog DACs connect to your analog drive inputs and your differential encoder outputs connect the Kanalog differential encoder inputs.

    First get everything working using KMotion.exe before attempting to run Mach3.

    Let us know how much you understand and then ask specific questions.

    HTH
    Regards
    TK
    http://dynomotion.com

  3. #3
    Join Date
    Nov 2012
    Posts
    18

    Re: Need help setting up KFlop and KAnalog with Analog Servo Drives and Mach 3

    So I'm more familiar with how to connect the boards to the drive now, which is good. But I was wondering if the +5V and ground for the encoders should sourced from KAnalog or can I use a seperate power supply?

    I entered DAC0=100 in to the console and saw the changes in voltage, which is good, but I'm still having a hard time getting my head around the setup script. If I have the encoders feeding into KAnalog, will it servo with my current script? It will eventually be a 4 axis setup, but with 1 axis being the knee on the mill, and the same direction used for the quill, but I don't know how to denote that in the define coordinate system function.


    Perhaps you can take a look:

    Code:
    #include "KMotionDef.h"
    
    #define QA 26	// define to which IO bits the AB signals are connected 
    #define QB 27	
    
    main()
    {
    	int BitA,Change1=0,Change2=0, DiffX2;
    	int PosNoWrap, NewPos, Pos=0, wraps;
    	double Factor=0;
    	
    	SetBit(152);
    	SetBit(157);
    	SetBit(158);
    	
    	ch0->InputMode=ENCODER_MODE;
    	ch0->OutputMode=DAC_SERVO_MODE;
    	ch0->Vel=40000;
    	ch0->Accel=400000;
    	ch0->Jerk=4e+006;
    	ch0->P=0.2;
    	ch0->I=0;
    	ch0->D=0;
    	ch0->FFAccel=0;
    	ch0->FFVel=0;
    	ch0->MaxI=200;
    	ch0->MaxErr=200;
    	ch0->MaxOutput=200;
    	ch0->DeadBandGain=1;
    	ch0->DeadBandRange=0;
    	ch0->InputChan0=0;
    	ch0->InputChan1=1;
    	ch0->OutputChan0=0;
    	ch0->OutputChan1=1;
    	ch0->MasterAxis=-1;
    	ch0->LimitSwitchOptions=0x100;
    	ch0->LimitSwitchNegBit=0;
    	ch0->LimitSwitchPosBit=0;
    	ch0->SoftLimitPos=1e+009;
    	ch0->SoftLimitNeg=-1e+009;
    	ch0->InputGain0=1;
    	ch0->InputGain1=1;
    	ch0->InputOffset0=0;
    	ch0->InputOffset1=0;
    	ch0->OutputGain=1;
    	ch0->OutputOffset=0;
    	ch0->SlaveGain=1;
    	ch0->BacklashMode=BACKLASH_OFF;
    	ch0->BacklashAmount=0;
    	ch0->BacklashRate=0;
    	ch0->invDistPerCycle=1;
    	ch0->Lead=0;
    	ch0->MaxFollowingError=10000;
    	ch0->StepperAmplitude=250;
    
    	ch0->iir[0].B0=1;
    	ch0->iir[0].B1=0;
    	ch0->iir[0].B2=0;
    	ch0->iir[0].A1=0;
    	ch0->iir[0].A2=0;
    
    	ch0->iir[1].B0=1;
    	ch0->iir[1].B1=0;
    	ch0->iir[1].B2=0;
    	ch0->iir[1].A1=0;
    	ch0->iir[1].A2=0;
    
    	ch0->iir[2].B0=1;
    	ch0->iir[2].B1=0;
    	ch0->iir[2].B2=0;
    	ch0->iir[2].A1=0;
    	ch0->iir[2].A2=0;
        
    	ch1->InputMode=ENCODER_MODE;
    	ch1->OutputMode=DAC_SERVO_MODE;
    	ch1->Vel=40000;
    	ch1->Accel=400000;
    	ch1->Jerk=4e+006;
    	ch1->P=0.2;
    	ch1->I=0;
    	ch1->D=0;
    	ch1->FFAccel=0;
    	ch1->FFVel=0;
    	ch1->MaxI=200;
    	ch1->MaxErr=200;
    	ch1->MaxOutput=200;
    	ch1->DeadBandGain=1;
    	ch1->DeadBandRange=0;
    	ch1->InputChan0=0;
    	ch1->InputChan1=1;
    	ch1->OutputChan0=0;
    	ch1->OutputChan1=1;
    	ch1->MasterAxis=-1;
    	ch1->LimitSwitchOptions=0x100;
    	ch1->LimitSwitchNegBit=0;
    	ch1->LimitSwitchPosBit=0;
    	ch1->SoftLimitPos=1e+009;
    	ch1->SoftLimitNeg=-1e+009;
    	ch1->InputGain0=1;
    	ch1->InputGain1=1;
    	ch1->InputOffset0=0;
    	ch1->InputOffset1=0;
    	ch1->OutputGain=1;
    	ch1->OutputOffset=0;
    	ch1->SlaveGain=1;
    	ch1->BacklashMode=BACKLASH_OFF;
    	ch1->BacklashAmount=0;
    	ch1->BacklashRate=0;
    	ch1->invDistPerCycle=1;
    	ch1->Lead=0;
    	ch1->MaxFollowingError=10000;
    	ch1->StepperAmplitude=250;
    
    	ch1->iir[0].B0=1;
    	ch1->iir[0].B1=0;
    	ch1->iir[0].B2=0;
    	ch1->iir[0].A1=0;
    	ch1->iir[0].A2=0;
    
    	ch1->iir[1].B0=1;
    	ch1->iir[1].B1=0;
    	ch1->iir[1].B2=0;
    	ch1->iir[1].A1=0;
    	ch1->iir[1].A2=0;
    
    	ch1->iir[2].B0=1;
    	ch1->iir[2].B1=0;
    	ch1->iir[2].B2=0;
    	ch1->iir[2].A1=0;
    	ch1->iir[2].A2=0;
    	
    	ch2->InputMode=ENCODER_MODE;
    	ch2->OutputMode=DAC_SERVO_MODE;
    	ch2->Vel=40000;
    	ch2->Accel=400000;
    	ch2->Jerk=4e+006;
    	ch2->P=0.2;
    	ch2->I=0;
    	ch2->D=0;
    	ch2->FFAccel=0;
    	ch2->FFVel=0;
    	ch2->MaxI=200;
    	ch2->MaxErr=200;
    	ch2->MaxOutput=200;
    	ch2->DeadBandGain=1;
    	ch2->DeadBandRange=0;
    	ch2->InputChan0=0;
    	ch2->InputChan1=1;
    	ch2->OutputChan0=0;
    	ch2->OutputChan1=1;
    	ch2->MasterAxis=-1;
    	ch2->LimitSwitchOptions=0x100;
    	ch2->LimitSwitchNegBit=0;
    	ch2->LimitSwitchPosBit=0;
    	ch2->SoftLimitPos=1e+009;
    	ch2->SoftLimitNeg=-1e+009;
    	ch2->InputGain0=1;
    	ch2->InputGain1=1;
    	ch2->InputOffset0=0;
    	ch2->InputOffset1=0;
    	ch2->OutputGain=1;
    	ch2->OutputOffset=0;
    	ch2->SlaveGain=1;
    	ch2->BacklashMode=BACKLASH_OFF;
    	ch2->BacklashAmount=0;
    	ch2->BacklashRate=0;
    	ch2->invDistPerCycle=1;
    	ch2->Lead=0;
    	ch2->MaxFollowingError=10000;
    	ch2->StepperAmplitude=250;
    
    	ch2->iir[0].B0=1;
    	ch2->iir[0].B1=0;
    	ch2->iir[0].B2=0;
    	ch2->iir[0].A1=0;
    	ch2->iir[0].A2=0;
    
    	ch2->iir[1].B0=1;
    	ch2->iir[1].B1=0;
    	ch2->iir[1].B2=0;
    	ch2->iir[1].A1=0;
    	ch2->iir[1].A2=0;
    
    	ch2->iir[2].B0=1;
    	ch2->iir[2].B1=0;
    	ch2->iir[2].B2=0;
    	ch2->iir[2].A1=0;
    	ch2->iir[2].A2=0;
    
        EnableAxis(0);
    	EnableAxis(1);
    	EnableAxis(2);
    
        DefineCoordSystem(0,1,2,-1);
    }

  4. #4
    Join Date
    May 2006
    Posts
    4045

    Re: Need help setting up KFlop and KAnalog with Analog Servo Drives and Mach 3

    Hi MetalStorm,

    You can use Kanalog +5V for your encoders if you wish. Kanalog's Encoder Inputs, KFLOP, and the PC all share common DC GND anyway.

    Don't worry about the C Program at this stage. First get an axis to servo using the KMotion Screens. Then later merge the final settings into the Initialization C Program.

    You will need to configure 4 KFLOP Axis channels for your XYZA configuration. Your C program currently only configures 3 Axis Channels. You can use KMotions C Code-> clip board Feature on the Config/Flash Screen to create the C code for Axis Channel #3 then paste it into your C Program after Axis #2

    Your C program has all of your axis using the same encoder inputs and DAC. Instead configure for InputChan0 to 0,1,2,3 and OutputChan0 to 0,1,2,3 respectively.

    You might also read these Threads:
    http://www.cnczone.com/forums/dynomo...ml#post1534388
    http://www.cnczone.com/forums/dynomo...ion-kflop.html

    I would define KFLOP axis channel #3 to be the Knee Axis and define the GCode A axis to be the Knee with:

    DefineCoordSystem(0,1,2,3); // define XYZA

    HTH
    Regards
    TK
    http://dynomotion.com

  5. #5
    Join Date
    Nov 2012
    Posts
    18

    Re: Need help setting up KFlop and KAnalog with Analog Servo Drives and Mach 3

    Hi Tom,

    It sounds like you are suggesting the axis will be able to servo without any C Program? If so what is it's purpose?

    It's not clear to me if the axis will be able to servo with my current program posted above, for example I read in a different thread somewhere that the KanalogInitialPID.Mot file had to be loaded which I did, but had I not stumbled upon that information, how would I have known it was required?

    What is being defined with this:
    #define QA 26 // define to which IO bits the AB signals are connected
    #define QB 27

    Also, would the +-10V analog signal from kAnalog be considered single ended? My drive is currently configured for a differential input and it looks like a resistor has been removed to run in that configuration, there will be some effort required to figure out what the value of the resistor should be so that I can replace it and use it single ended if that is correct. Alternatively is it possible to have my output as a differential +-10V? If so how is that achieved?

  6. #6
    Join Date
    May 2006
    Posts
    4045

    Re: Need help setting up KFlop and KAnalog with Analog Servo Drives and Mach 3

    Hi MetalStorm,

    It sounds like you are suggesting the axis will be able to servo without any C Program? If so what is it's purpose?
    Correct. The C Program doesn't do the servo loop. It just sets parameters used by KFLOP's Internal Servo Control.

    It's not clear to me if the axis will be able to servo with my current program posted above, for example I read in a different thread somewhere that the KanalogInitialPID.Mot file had to be loaded which I did, but had I not stumbled upon that information, how would I have known it was required?
    There are a number of ways to configure KFLOP Axis Channels. This Video (Flash is required) may help with the concept.
    http://www.dynomotion.com/Help/Flash...ers/index.html
    You don't need any C Program at all to get your axes to servo and move. You can just use the settings in the KMotion Screens. Later after everything is working you can create the C program so that the KMotion Program and Screens are no longer required.

    What is being defined with this:
    #define QA 26 // define to which IO bits the AB signals are connected
    #define QB 27
    Those are not currently used in your program. They were originally defining where an MPG may be connected.

    Also, would the +-10V analog signal from kAnalog be considered single ended? My drive is currently configured for a differential input and it looks like a resistor has been removed to run in that configuration, there will be some effort required to figure out what the value of the resistor should be so that I can replace it and use it single ended if that is correct. Alternatively is it possible to have my output as a differential +-10V? If so how is that achieved?
    The Kanalog Outputs are Single Ended (a signal and GND). If you have a differential input just connect the - terminal to Kanalog GND

    HTH
    Regards
    TK
    http://dynomotion.com

  7. #7
    Join Date
    Nov 2012
    Posts
    18

    Re: Need help setting up KFlop and KAnalog with Analog Servo Drives and Mach 3

    If the output from kanalog is single ended, are you sure it will work when connected to a device that is expecting a differential input?

  8. #8
    Join Date
    May 2006
    Posts
    4045

    Re: Need help setting up KFlop and KAnalog with Analog Servo Drives and Mach 3

    Hi MetalStorm,

    I believe it will work. To minimize errors run the - differential input as a separate wire (with the + input) connected to GND at Kanalog.

    Regards
    TK
    http://dynomotion.com

  9. #9
    Join Date
    Nov 2012
    Posts
    18

    Re: Need help setting up KFlop and KAnalog with Analog Servo Drives and Mach 3

    Would you expect to see half the full scale speed range available when connecting single ended to a differential input? For example, you command +10V on your single ended output. But the differential input is expecing +10V on one line and -10v on the other. I guess I'm not really clear how a differential analog input works, as I guess it can't just average it, as it will always be 0.

  10. #10
    Join Date
    May 2006
    Posts
    4045

    Re: Need help setting up KFlop and KAnalog with Analog Servo Drives and Mach 3

    Hi MetalStorm,

    A differential input only sees the difference between the two inputs. So for example if the - Input was at -1V relative to GND, and the + Input was at +2V relative to GND, the circuit would "see" an input of +3V. Connecting the - Input to 0V effectively makes the input a single-ended ground-referenced input.

    HTH
    Regards
    TK
    http://dynomotion.com

Similar Threads

  1. Kflop/Kanalog Wiring for Yaskawa SGDH drives
    By upsyd0wn in forum Dynomotion/Kflop/Kanalog
    Replies: 35
    Last Post: 07-25-2014, 12:39 AM
  2. Servo drive enable connections - KFlop/KAnalog connection?
    By DeanW in forum Dynomotion/Kflop/Kanalog
    Replies: 7
    Last Post: 06-11-2013, 04:44 AM
  3. KFlop + External Servo Drives
    By arvidj in forum Dynomotion/Kflop/Kanalog
    Replies: 5
    Last Post: 12-13-2012, 11:16 PM
  4. KFLOP+Kanalog Analog Velocity Servo tuning
    By bradodarb in forum Dynomotion/Kflop/Kanalog
    Replies: 9
    Last Post: 07-01-2012, 01:19 AM
  5. 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

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
  •