544,051 active members*
1,872 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > Dynomotion/Kflop/Kanalog > Kflop with Kanalog running step and direction drivers
Results 1 to 9 of 9
  1. #1
    Registered
    Join Date
    Aug 2006
    Posts
    654

    Kflop with Kanalog running step and direction drivers

    So let me preface my questions by letting everyone know that I'm already way out of my knowledge depth, but I'm trying to learn more about C and electronics in general, so I've forced myself to learn by buying a Kflop and Kanalog boards, but I'll need your patience as I'm still very much over my head at this moment. If these questions have already been addressed I apologize, but there is a lot to learn and a lot of information to try and sift thru.

    I have a little CNC lathe that I've been running with mach3 and generic breakout boards to get everything to work. Well, I've always wanted linear encoders to give me true position feeback, so I bought the Kflop and Kanalog boards as the Kanalog seems like the best option for reading the encoders. So the situation I find myself is I need to run a bare minimum of one stepper on step/dir signals (my ATC), but preferably 3 (X,Z, and ATC). It seems the easiest option is to steal the JP5 off Kflop and loose the additional encoder input capability from JP2 on the Kanalog. That's not a problem as I'll only need 3 encoders (X,Z, and an MPG). So my questions are:

    A) is that the best option, I know I can get step/dir signals off JP4 &JP6, but I'd have to tap into both of them to get 3 channels.

    B) If I tap into JP5 (or if I need to use JP4 and JP6) is there opto-isolation built into Kflop, or will I need a 3rd party break out board to provide that protection?

    C) if I were to use JP5, is there any special C-code that needs to be included so the Kflop knows that's no longer connected to the Kanalog? Similar to how there is a need to muliplex JP4 and JP6 if I were to use them?

  2. #2
    Junior Member
    Join Date
    May 2006
    Posts
    3773

    Re: Kflop with Kanalog running step and direction drivers

    Hi CS900,


    A) is that the best option, I know I can get step/dir signals off JP4 &JP6, but I'd have to tap into both of them to get 3 channels.
    JP5 is usually the best option if your drives need Open Collector mode for 5V signals.


    B) If I tap into JP5 (or if I need to use JP4 and JP6) is there opto-isolation built into Kflop, or will I need a 3rd party break out board to provide that protection?
    There isn't any Opto isolation in KFLOP for Step/Direction signals. Usually the Drive has opto isolation. What kind of Drives do you have and what are their specifications?


    C) if I were to use JP5, is there any special C-code that needs to be included so the Kflop knows that's no longer connected to the Kanalog? Similar to how there is a need to muliplex JP4 and JP6 if I were to use them?
    No
    TK
    http://dynomotion.com

  3. #3
    Registered
    Join Date
    Aug 2006
    Posts
    654

    Re: Kflop with Kanalog running step and direction drivers

    Quote Originally Posted by TomKerekes View Post
    Hi CS900,


    JP5 is usually the best option if your drives need Open Collector mode for 5V signals.


    There isn't any Opto isolation in KFLOP for Step/Direction signals. Usually the Drive has opto isolation. What kind of Drives do you have and what are their specifications?


    No
    Hi Tom,
    Thanks for the quick response.

    Currently I have 2 of the Gecko 251X drives which do not appear to have any opto isolation built in, but can accept either 3.3V or 5V input signals. The other drive I have is an amazon cheapy DM556 which does appear to have opto isolation.

    I'm not particularly attached to any of these drives, it just what I happen to have on hand when I originally converted the lathe to CNC. I've been contemplating replacing the 2 Gecko drives (my X and Z axis) and steppers with some DYN2 drives from DMM which have analog inputs as it is, but I'll still be suck with at least 1 stepper due to the design of my ATC.

  4. #4
    Junior Member
    Join Date
    May 2006
    Posts
    3773

    Re: Kflop with Kanalog running step and direction drivers

    Hi CS900,

    Yes I don't think those Gecko drives have opto isolation. Those could potentially be driven in TTL mode from KFLOP JP4/JP6.

    Good luck
    TK
    http://dynomotion.com

  5. #5
    Registered
    Join Date
    Aug 2006
    Posts
    654

    Re: Kflop with Kanalog running step and direction drivers

    Thanks Tom, I'm sure I'll be back with more questions at some point but this will get me headed in the right direction.

  6. #6
    Registered
    Join Date
    Aug 2006
    Posts
    654

    Re: Kflop with Kanalog running step and direction drivers

    So I'm back already with a few more questions. I ended up replacing the gecko drives with more of the opto isolated drivers and ran cables right to JP4 and JP6. Channels 0 (connected to JP4, pins 13 and 14) and 2 (connected to JP6 pins 13 and 14) work great, but I can't seem to get channel 1 (connected to JP4 pins 15 and 16) to respond. I double checked my wiring and my connections to the kflop are solid, and I made sure it wasn't the driver or motor wiring by swapping the step/direction wires from channel 0. I also copied the channel setting in kmotion from channel 0 and just updated the channel number in the output field to try and eliminate any errors I may have made there. Is there anything else that I can check? Here's my initial file for reference:

    "#include "KMotionDef.h"

    main()
    {
    printf("Hello World!\n"); // send message to console

    FPGA(STEP_PULSE_LENGTH_ADD)=32 + 0x40;

    ch0->InputMode=ENCODER_MODE;
    ch0->OutputMode=CL_STEP_DIR_MODE;
    ch0->Vel=20000;
    ch0->Accel=100000;
    ch0->Jerk=1e+06;
    ch0->P=1;
    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+30;
    ch0->SoftLimitNeg=-1e+30;
    ch0->InputGain0=35.2268;
    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=1000000000;
    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=CL_STEP_DIR_MODE;
    ch1->Vel=20000;
    ch1->Accel=100000;
    ch1->Jerk=1e+06;
    ch1->P=1;
    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=1;
    ch1->InputChan1=1;
    ch1->OutputChan0=1;
    ch1->OutputChan1=1;
    ch1->MasterAxis=-1;
    ch1->LimitSwitchOptions=0x100;
    ch1->LimitSwitchNegBit=0;
    ch1->LimitSwitchPosBit=0;
    ch1->SoftLimitPos=1e+30;
    ch1->SoftLimitNeg=-1e+30;
    ch1->InputGain0=35.2268;
    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=1000000000;
    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=NO_INPUT_MODE;
    ch2->OutputMode=STEP_DIR_MODE;
    ch2->Vel=40000;
    ch2->Accel=400000;
    ch2->Jerk=4e+06;
    ch2->P=0;
    ch2->I=0.01;
    ch2->D=0;
    ch2->FFAccel=0;
    ch2->FFVel=0;
    ch2->MaxI=200;
    ch2->MaxErr=1e+06;
    ch2->MaxOutput=200;
    ch2->DeadBandGain=1;
    ch2->DeadBandRange=0;
    ch2->InputChan0=2;
    ch2->InputChan1=0;
    ch2->OutputChan0=2;
    ch2->OutputChan1=0;
    ch2->MasterAxis=-1;
    ch2->LimitSwitchOptions=0x100;
    ch2->LimitSwitchNegBit=0;
    ch2->LimitSwitchPosBit=0;
    ch2->SoftLimitPos=1e+09;
    ch2->SoftLimitNeg=-1e+09;
    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=1000000000;
    ch2->StepperAmplitude=20;

    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=0.000769;
    ch2->iir[2].B1=0.001538;
    ch2->iir[2].B2=0.000769;
    ch2->iir[2].A1=1.92081;
    ch2->iir[2].A2=-0.923885;



    }"



    Lastly I could use another set of eyes on my gain calculation. My axis has 44704 steps/in and my linear encoders are .005mm (0.000197in) resolution. If I understand correctly my gain would be 44704*0.000197*4=35.2268. Seem about right?

  7. #7
    Junior Member
    Join Date
    May 2006
    Posts
    3773

    Re: Kflop with Kanalog running step and direction drivers

    What Drives do you have? What is their interface specification? How are they wired?

    You are configuring open collector mode which is basically a switch to GND. This will not turn on an Opto unless it is wired to a source like +5V. Imagine trying to turn on a light bulb with a switch. Some power source is required such as a battery. Because Pins 13 and 14 have termination resistors they can't be used in open collector mode so they always operate in TTL mode. See here.

    Regarding calculation: Its not clear whether you need the factor of 4 or not. It depends on the definition of 0.005mm resolution. Is that per count or per cycle? If your off by a factor of 4 it will be easy to observe and correct.
    TK
    http://dynomotion.com

  8. #8
    Registered
    Join Date
    Aug 2006
    Posts
    654

    Re: Kflop with Kanalog running step and direction drivers

    Quote Originally Posted by TomKerekes View Post
    What Drives do you have? What is their interface specification? How are they wired?

    You are configuring open collector mode which is basically a switch to GND. This will not turn on an Opto unless it is wired to a source like +5V. Imagine trying to turn on a light bulb with a switch. Some power source is required such as a battery. Because Pins 13 and 14 have termination resistors they can't be used in open collector mode so they always operate in TTL mode. See here.

    Regarding calculation: Its not clear whether you need the factor of 4 or not. It depends on the definition of 0.005mm resolution. Is that per count or per cycle? If your off by a factor of 4 it will be easy to observe and correct.
    Ok, that little light bulb just went off in my head. All 3 drives are the DM556 stepper drivers, which are TTL compatible. I have them wired so that the step and direction signals (required to be 5V signals) are wired directly to JP4 and JP6 connectors, and the ground connections go directly to ground points on the kanalog.

    Channels 0 and 2 are forced to TTL mode due to mechanical design of the board which is why they work as-is on any driver I tried. What I overlooked is I should have channel 1, output 0 set to 9 to activate TTL mode.


    I'll take a look at the spec sheet tonight for the encoder, but I know if I don't have it in the calculation, the position recorded is significantly smaller than the commanded position on the step response graph.

    I'm super excited to start tuning my system! Thanks for your help Tom, I'll make that change tonight and I'll be amazed if it doesn't fix it.

  9. #9
    Registered
    Join Date
    Aug 2006
    Posts
    654

    Re: Kflop with Kanalog running step and direction drivers

    worked like a champ. Thanks again.

Similar Threads

  1. Kflop/kanalog combo
    By madmachinist77 in forum Dynomotion/Kflop/Kanalog
    Replies: 7
    Last Post: 06-02-2018, 09:49 PM
  2. Spindle Interference on Kanalog DAC ground causing Kflop Step issues?
    By slimneill in forum Dynomotion/Kflop/Kanalog
    Replies: 8
    Last Post: 01-06-2016, 01:41 AM
  3. Replies: 6
    Last Post: 06-06-2015, 10:30 PM
  4. KFlop with KAnalog Step and Dir for Yaskawa SGDH PULS/SIGN inputs
    By DeanW in forum Dynomotion/Kflop/Kanalog
    Replies: 1
    Last Post: 05-02-2013, 08:37 PM
  5. Step/Direction pins should be Step FWD and Step BACK
    By rayscott in forum Mach Software (ArtSoft software)
    Replies: 6
    Last Post: 02-10-2010, 12:57 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
  •