586,104 active members*
3,173 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > Dynomotion/Kflop/Kanalog > How i got my SX3 mill up and running with Kflop and Kstep.
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2013
    Posts
    159

    How i got my SX3 mill up and running with Kflop and Kstep.

    How i got my SX3 mill up and running with Kflop and Kstep.


    I bought a used SX3 mill on a whim, I just saw the add in a classified page one day and my impulse control could not keep up with my new idea.

    So after a lot of back and forth with the seller, i got it shipped up to the arctic where i live and i got it into my workshop with the help of a buddy.
    This is where my story really starts. because now i had do make a decision.. i had looked at CNC videos on YouTube for many years, and now that i was the proud owner of a mill myself, i thought i should have a go at it.. (and i had not run a mill before)

    Attachment 276532
    (A picture of my mill in its current state)


    Hardware

    And so i started prioritizing and making a list of things i needed and had thou build.
    my list was made on the basis, how to get maximum precision out of this mill.

    • A stand and enclosure (i really over engineered this one, my enclosure could probably house expensive high end machines and i wasted to much time and money on that one, should have keept it simple and modular)
    • Ball-screws, searched around and the best i could find was CNCfusion's deluxe kit.. so i ordered one and waited, for a long time :P and it is hard to get in touch with the company, but they are good and eventually they will get back to you, think they are a 2 man company and that is why. top notch service and parts!
    • Controller, i looked fare and wide. i was looking at everything from cheep china controllers to a bit more expensive ones that had USB.. and then i occurred to me, i ONLY want USB interface. i don't want to be stuck with some lagging legacy computer that uses a crusty LTP1 port that is limiting my machine in speed and accuracy.. so i found the Kflop! it said that you needed to understand the programming language C to use it, and i don't, but the specs was amazing! so i bought one.
    • Stepper motor driver, also looked far and wide with this one. looked at some really expensive Leedshine ones and some ****ty china ones.. for a long time i was looking at gecko G540, but it runs on a crusty old printer port and that is a NO-GO, and that is when i came across the KSTEP unit, here is a 4 channel stepper driver with specks far exceeding many of its competitors, and it is made to integrate to the KFLOP!! no brainier there, so i also ordered me one of those.
    • Power supply, i actually talked to Tom in Dynomotion about this, and he sent me a link to a thread on cnczone, where this topic was covered, so i found myself a nice 48V switch mode supply that had enough amps to run my steppers at max, even tho that is almost never going to happen, but now i am not limited by that.
    • Steppers, well i also got a tip on that, and ended up buying my steppers at max of what the nema range could offer, so i got 3 (one spare for a future A axis) Nema 23 steppers @ 5A and 4 NM torque and one Nema 34 @ 6.1A (no problem since the KSTEP automatically limits it to 5A) and 6,7 NM of torque.
    • Tooling, i decided to go for cheep end mills from china, so the first ones i brake don't brake my bank account :P when i get the knowledge and experience i can invest in expensive high quality stuff, the only thing i spent money on was the Thormac tooling system, i bought 6 ER20 holders with collets, just to make the tool changing business much easier.
    • 2,2KW BLDC motor, the original motor in the mill was 110V and i am NOT going to get a transformer (in my country we use 230V), so the option is to find another motor and driver, and i found one in china, and being me i could not go for the plug and play stock motor, no i had to upgrade! :P i don't know if it is worth it yet, but i suspect that cutting rates could increase, as long as the rigidity of the mill holds up. (i also had to make custom plates to mount the much lager motor)


    well.. now that you know a bit more about my setup, i am going to focus on the controller and stepper driver.. namely the KFLOP and the KSTEP...



    The controller and stepper driver

    When i first ordered the KFLOP and KSTEP i had no idea what i was getting into, i had read i needed to know the programming language C and that was it.
    In my line of work i am fairly familiar with industrial automation and PLC systems, and i thought that it would be a piece of cake.

    There are many aspects of electronics that differ from the general practice of automation, and the KFLOP is definitely a piece of electronic!

    First, these two pages describe the inputs and outputs in detail, you should bookmark and print them for reference.

    KFLOP Connectors <---- this is a real link
    KStep Connectors <---- this is a real link

    They are a valuable source in understanding how to wire up everything.





    If you look at the picture of the KFLOP, you find a connector labeled JP7, that is connected to the KSTEP with a ribbon cable to JP360 (on the KSTEP)
    this connection takes care of ALL the STEP/DIR commands and is basically what you need to do to get the steppers moving (you would need to connect steppers to J2/J3/J4/J5, every stepper you buy should have a paper describing witch cable should go where to wire it all up, but more on that later)

    Attachment 276520

    The connection between them also gives the KFLOP access to some nice Optically isolated Inputs (on JP33) that we can use for home switches, buttons, probes etc.. without the fear of damaging the inputs.


    And now something really important regarding inputs and outputs.

    Later when you are modifying a program and referencing a pin on ether the KFLOP or the KSTEP (and with that ribbon cable in place you don't have to setup anything more, the pins are there..

    You look at the manual from Dynomotion (the maker of the hardware) and you see this chart, and it is easy to think that the first row is the pin number, but that is the physical pin number on the connector you are working with, and not the program pin that the KFLOP sees.

    Attachment 276534

    Remember this until later, i did not understand this at first and it made a LOT of confusion and problems, i simply could not get anything to work, now i know why!



    Staring out with the programming and building a INIT (initialization) file.


    Always make sure you have the latest stable build of the software that Dynomotion offers.
    You can find it here on their web page

    Dynomotion Software Download <---- this is a real link

    And remember if you download a new version of the program, you have to flash the new firmware into the KFLOP using a tool inside their program, Kmotion.exe

    Note: after downloading a new version, Flash new firmware into KFLOP using the Config/Flash - New Version function.
    Also when upgrading copy the <InstallDir>\KMotion\Data directory to the New Installation to migrate your settings

    After installing the software, you can plug in the KFLOP, if you have plugged it in before installing the software you will need to upgrade the drivers for it manually, since windows just pics something it thinks is right the first time.

    The first program you must open is KMotion,exe (it has a black logo, not the blue one)

    Attachment 276512

    1. If you are connected to the Kflop, it will say so here.
    2. This is like a diagnostics console, and you can use that to get data in and out, if you know what you are doing.
    3. This is where you manage your C program
    4. This is where you setup your motor parameters
    5. This is where you will Verify that it is moving and you are connected.







    Attachment 276514
    Inside button nr 2 you can press this button to see that you are truly connected and what version of firmware you are running.
    when finished, close this window.





    Attachment 276516
    Inside button nr 3 you will find this window.

    1. Press open and find "InitKStep3Axis.c". Press open.
    2. THIS IS FOR LATER, When you have all your motor data ready you can push this to se if you have any errors in your code
    3. THIS IS FOR LATER If not then button nr 3 will, Save, Compile, Download and run your program (on the KFLOP)


    Now the InitKStep3Axis.c program is open in the editor and we are going to use it as a basis for our program (it fits for most 3 axis mills of this setup)
    Leave this window open and press button nr 4






    Attachment 276518

    This window lets you configure the steppers and how they will respond.

    1. This is the list of motor channels, one motor is one Chanel
    2. Input must be "no input" unless you are using feedback, and output MUST be Step/Dir when using the KSTEP
    3. Input channel must be the same as Nr 1 1=1 .. and when using KSTEP 1 = 9 (more on that under here)
    4. Should be set to stop movement, so you don't have to initialize again if you hit a limit.
    5. Here you can input values for Software defined limits, can be done later
    6. This button lets you copy all this information about the motors to the C file you have laying open.


    More on NR 3:

    KStep is effectively a Step/Dir driver, so it makes use of the Step/Dir Output mode in KFLOP The screen shown is the Output Channel selection for KStep Motor channel #1. Note that output channel 9 is selected instead of 1 as you might assume.
    KStep requires a LVTTL signal, Rather than using Output channels 0 through 4, Output channels 8 through 11 respectively should be used instead, as they provide a LVTTL signal.

    An output gain of -1 may be specified to reverse the direction of motion
    .
    This means:
    • CH0 = CH8 output
    • CH1 = CH9 output
    • CH2 = CH10 output
    • CH4 = CH11 output


    And if your motors are spinning in the wrong direction, you can change the gain value to MINUS 1 and it will be inverted


    Now that all the channels are configured and exported to the open C program, we are ready to go to the C program button in the main window (button nr 3)






    Attachment 276516

    Now you can try to compile (button 2) the program and see if it works, if it does that you can push button 3 and send the program to the KFLOP.
    This will be the start of your initialization file or INIT for short, this file must always run in the KFLOP and it takes care of everything related to motors, defining inputs and outputs and such..

    If you get no errors head over to button 5 in the main screen.






    Attachment 276528

    1. Here you can chose witch motor to test, an easy way to identify them.
    2. This sets how long the test should be and how many steps it should take
    3. This button lets you send the command to the KFLOP and test the stepper, it will draw a nice graph to the right and your stepper should move back and fourth on your table



    (more on this later) (some info can be found here)
    Calculate your resolution for all your axes in terms of uSteps per Inch (or mm). KSTEP has 16X microstepping so there are 3200 uSteps/rev. Then factor in your lead screw pitch (CncFusion has 5MM pitch) and any gearing you might have. Then set the Vel, Acceleration, and Jerk to what you think might be reasonable values for your system. The units are all in uSteps so relate to normal units by dividing by the uSteps/unit. So for example if your resolution is 1000 uSteps/mm then moving a velocity of 10000 would be 10000/1000 = 10mm/sec or 600mm/min

    in my case that is: 3200/5=640 steps/mm


    If all of your steppers are responding to this test, then you are in business, somewhat :P
    This means you have started to build a INIT file, and that file is holy and you should have a backup of it since it is the basis for your project from now on.









    Backup
    You should always have a recent backup of your data in case your computer is filled with coolant from your mill, falling onto floor, theft, etc.

    To do that, you simply copy so the contents of <Install dir>\KMotion\Data and any C programs you have created..

    And you copy and paste that onto the new system with a fresh install of kmotion on it (you should also store it on a memory stick, cloud etc.)








    You will need more C files and also more stuff in your INIT file later, but this is where my how to ends for today, i hope you could understand it and that it gave you the information you needed to get off to a start.


    I have stolen some quotes and pictures from Tom Kerekes of Dynomotion (and on this forum). without this man i would not be able to run my mill today thanks Tom!

    (if you see anything that is wrong, let us all know, this is just how i did it and i might not be the best way even if it worked for me)

  2. #2
    Join Date
    Dec 2013
    Posts
    159

    Re: How i got my SX3 mill up and running with Kflop and Kstep.

    basically what is going on here is what i was trying to explain..

    found it 5 minutes after posting... doh!

    https://www.youtube.com/watch?v=1jB8u_eD0XU

  3. #3
    Join Date
    May 2006
    Posts
    4045

    Re: How i got my SX3 mill up and running with Kflop and Kstep.

    Hi jossa,

    Wow you are a terrific documenter. Thanks for this. I'm sure this will be helpful to others. Very concise. The only minor change I might suggest would be to use:

    InitKStep3Axis.c

    instead of

    Init3Analog.c

    if your system has a KSTEP as that program has a couple extra lines of initialization. Also Importing that C Program to the Screens would preset most things correctly. The Input/Export Buttons actually transfers all motor axes identified in the C Program. So you actually only need to do that once. It isn't necessary (but doesn't hurt) to do that for every motor.

    I owe you a favor.
    Thanks
    TK
    http://dynomotion.com

  4. #4
    Join Date
    Dec 2013
    Posts
    159

    Re: How i got my SX3 mill up and running with Kflop and Kstep.

    Quote Originally Posted by TomKerekes View Post
    Hi jossa,

    Wow you are a terrific documenter. Thanks for this. I'm sure this will be helpful to others. Very concise. The only minor change I might suggest would be to use:

    InitKStep3Axis.c

    instead of

    Init3Analog.c

    if your system has a KSTEP as that program has a couple extra lines of initialization. Also Importing that C Program to the Screens would preset most things correctly. The Input/Export Buttons actually transfers all motor axes identified in the C Program. So you actually only need to do that once. It isn't necessary (but doesn't hurt) to do that for every motor.

    I owe you a favor.
    Thanks
    Thanks Tom
    I will write more later, it takes a long time to gather everything into a document, and i still have some things i need help explaining..



    yes you are 100% right, my bad, i am also using InitKStep3Axis.c for my project, but i must have taken the wrong file when i copy pasted the name.
    it is updated now



    ah ok, i though i needed to press it on every motor. i learn by writing this thing
    i will update the document

Similar Threads

  1. Resonance with Kflop + Kstep
    By Troy_O in forum Dynomotion/Kflop/Kanalog
    Replies: 13
    Last Post: 03-17-2015, 12:41 AM
  2. Is it possible to use RS232 with Kflop and Kstep
    By willeme1 in forum Dynomotion/Kflop/Kanalog
    Replies: 2
    Last Post: 03-26-2014, 12:00 AM
  3. KFlop + KStep integration
    By John Coloccia in forum Dynomotion/Kflop/Kanalog
    Replies: 19
    Last Post: 12-07-2012, 10:47 PM
  4. Kflop+kstep out of syn
    By ltran2000 in forum Dynomotion/Kflop/Kanalog
    Replies: 7
    Last Post: 11-09-2012, 04:41 AM
  5. Kflop+Kstep video
    By ltran2000 in forum Dynomotion/Kflop/Kanalog
    Replies: 6
    Last Post: 05-29-2012, 09:57 PM

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
  •