Need Help! KFLOP & Mach3: Configure STEP PER


Results 1 to 14 of 14

Thread: KFLOP & Mach3: Configure STEP PER

  1. #1
    Member
    Join Date
    Oct 2017
    Location
    Italy
    Posts
    18
    Downloads
    0
    Uploads
    0

    Default KFLOP & Mach3: Configure STEP PER

    Hello from Italy,
    i need to configure the "Step per" parameters (Menù: Config->Motor tuning ) on Mach3 software

    A simple CNC milling 3 axis

    Ball screw shaft are 1605 (5 mm stroke with one turn)

    Motors: Stepper NEMA23 1.8° - 200 pulse for 1 rev

    The stepper Drive (DM556) are setting with 25600 Pulse/rev (the maximum for smooth movements)

    In the "Step per" field on Mach3 i set (for successive approximations) 15000

    With this number (15000) i not have a good precision but seems to be the best value

    The question is: There is some parameters to setting in init file (the first called task) on Kflop?

    Thanks

    Similar Threads:
    Last edited by CNCtronic; 10-30-2019 at 06:35 PM.


  2. #2
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP & Mach3: Configure STEP PER

    Hi CNCtronic,

    i need to configure the "Step per" parameters (Menù: Config->Motor tuning ) on Match3 software

    A simple CNC milling 3 axis

    Ball screw shaft are 1605 (5 mm stroke with one turn)

    Motors: Stepper NEMA23 1.8° - 200 pulse for 1 rev

    The stepper Drive (DM556) are setting with 25600 Pulse/rev (the maximum for smooth movements)

    In the "Step per" field on Match3 i set (for successive approximations) 15000

    With this number (15000) i not have a good precision but seems to be the best value
    I would have expected the number to be:

    25600 steps/rev x (1rev / 5mm) = 5120 steps / mm

    Is the motor connected 1:1 to the Ball Screw?

    If you command KFLOP to move the motor 25600 steps does it make 1 revolution?




    The question is: There is some parameters to setting in init file (the first called task) on Kflop?
    Output Gain can be used to scale motion. But we recommend leaving Output Gain set at 1.0 (or -1.0) so KFLOP operates in raw steps.

    Regards
    TK http://dynomotion.com


  3. #3
    Member
    Join Date
    Oct 2017
    Location
    Italy
    Posts
    18
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP & Mach3: Configure STEP PER

    Thanks for quickly answer Tom

    Well...

    1) Yes, the motors are connect directly to shafts (1:1)

    2) More or less... yes, with a cycle:

    for(int i =0; i <25600; i++)
    {
    SetBit(8);
    Delay_sec(0.001);
    ClearBit(8);
    Delay_sec(0.001);
    }


    i got a complete turn, but i don't know with what kind of precision.

    On a millimeter metal line, with complete 4 turns, i measure 2cm of axis travel, but with 80 complete turns i measure a 42cm axis travel... (hence 1 turn is not precise 5mm...)

    Please explain me "Output Gain can be used to scale motion. But we recommend leaving Output Gain set at 1.0 (or -1.0) so KFLOP operates in raw steps" too



  4. #4
    Member
    Join Date
    Oct 2017
    Location
    Italy
    Posts
    18
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP & Mach3: Configure STEP PER

    My Init file:

    #include "KMotionDef.h"


    int main()
    {
    SetBitDirection(0,1); // Enable Axe 0
    SetBitDirection(1,1); // Enable Axe 1
    SetBitDirection(2,1); // Enable Axe 2
    //SetBit(0);
    //SetBit(1);
    //SetBit(2);

    FPGA(STEP_PULSE_LENGTH_ADD) = 32 + 0x80; // set polarity and pulse length to 4us

    ch0->InputMode=NO_INPUT_MODE;
    ch0->OutputMode=STEP_DIR_MODE;
    ch0->Vel=40000;
    ch0->Accel=1200000;
    ch0->Jerk=12e+06;
    ch0->P=0;
    ch0->I=0.01;
    ch0->D=0;
    ch0->FFAccel=0;
    ch0->FFVel=0;
    ch0->MaxI=200;
    ch0->MaxErr=1e+006;
    ch0->MaxOutput=200;
    ch0->DeadBandGain=1;
    ch0->DeadBandRange=0;
    ch0->InputChan0=0;
    ch0->InputChan1=0;
    ch0->OutputChan0=8;
    ch0->OutputChan1=0;
    ch0->MasterAxis=-1;
    ch0->LimitSwitchOptions=0x0;
    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=1000000000;
    ch0->StepperAmplitude=20;


    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=0.000769;
    ch0->iir[2].B1=0.001538;
    ch0->iir[2].B2=0.000769;
    ch0->iir[2].A1=1.92076;
    ch0->iir[2].A2=-0.923833;


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


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

    ch2->InputMode=NO_INPUT_MODE;
    ch2->OutputMode=STEP_DIR_MODE;
    ch2->Vel=40000;
    ch2->Accel=500000;
    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=0;
    ch2->InputChan1=0;
    ch2->OutputChan0=10;
    ch2->OutputChan1=0;
    ch2->MasterAxis=-1;
    ch2->LimitSwitchOptions=0x100;
    ch2->LimitSwitchNegBit=0;
    ch2->LimitSwitchPosBit=0;
    ch2->SoftLimitPos=1e+30;
    ch2->SoftLimitNeg=-1e+30;
    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.92076;
    ch2->iir[2].A2=-0.923833;


    EnableAxisDest(0,0);
    EnableAxisDest(1,0);
    EnableAxisDest(2,0);

    DefineCoordSystem(0, 1, 2,-1);
    //while(1);
    return 0;
    }



  5. #5
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP & Mach3: Configure STEP PER

    Maybe the lead screw is 0.2 inches pitch

    Regards
    TK http://dynomotion.com


  6. #6
    Member
    Join Date
    Oct 2017
    Location
    Italy
    Posts
    18
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP & Mach3: Configure STEP PER

    Quote Originally Posted by TomKerekes View Post
    Maybe the lead screw is 0.2 inches pitch
    This evening I will check this possibility.

    But why the 15000 value in "Step per"? How do you get to calculate this number?

    Thanks



  7. #7
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP & Mach3: Configure STEP PER

    But why the 15000 value in "Step per"? How do you get to calculate this number?
    I don't know. As I posted before based on your information I would have expected the number to be:

    25600 steps/rev x (1rev / 5mm) = 5120 steps / mm

    if Mach3 is in mm mode.


    You might verify Mach3 is working correctly using the KMotion.exe Axis Screen. For example with "Steps per" set to 5120 if you do a 100mm move in Mach3 does the Axis Screen Destination change 512000 steps?

    Maybe the drive is missing steps? Is the error a pure scaling issue or is the motion inconsistent or erratic?


    Your slow 1 millisecond for loop stepping pulses seemed to work correctly. Normal movement would perform 3.78us pulses. What happens if you do a "Move" of 25600 steps using the KMotion.exe Step Response Screen? Or the Console Screen?

    What Velocity and Acceleration are you testing?

    Normally Open Collector Output mode is used to provide 5V pulses to the Drive. I see your Program is configuring TTL Output mode. You didn't state your Drives specification or how you have it wired. You might try Open Collector Mode.

    Regards
    TK http://dynomotion.com


  8. #8
    Member
    Join Date
    Jun 2004
    Location
    Scotland
    Posts
    355
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP & Mach3: Configure STEP PER

    I would not run at 128 microstepping.
    Once you go above 8 or 16, there is no noticeable improvement to be had, and you're far more likely to have issues due to the high pulse steps involved.

    Are these genuine Leadshine drives?
    If they are, you'll need to change the pulse width.



  9. #9
    Member
    Join Date
    Oct 2017
    Location
    Italy
    Posts
    18
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP & Mach3: Configure STEP PER

    Ok, I spent a lot of time for fix it, but... i solved!

    Well...

    First: I found out that the chinese ballscrews are 16x4 and NOT 16x5 (damned Chinese)

    2nd: the KMotionCNC DRO's are setting for Inch, not mm, that's why there were differences between Mach3 and KMotionCNC measurements


    Fix Mach3:

    Setting DIP switch on DM556 drive to 20.000 (= X100) pulse/rev (NOT 25.600 = X128)

    Setting on Mach3 "Step per" to 5.000

    The Mach3 DRO's are perfect with real travel.

    I think that with 5.000 pulses the screw makes 1mm of travel, and with 20.000 pulses it makes 4mm, or a complete turn. Hence "Step per" it means Step per millimeter


    Fix KMotionCNC:

    Simple setting Tool setup -> Trajectory Planner

    Axis Parameters -> Cnts/inch

    X: 127000
    Y: 127000
    Z: 127000

    Why 127000? Because if 5.000 pulse are 1mm travel, 127.000 pulse are 25.4mm (= 1 Inch)


    I changed V, A and J also, for best performance.

    chx->Vel=150000;
    chx->Accel=1200000;
    chx->Jerk=12e+06;

    With these values the machine it moves with great rapidity and extreme fluidity. No strange rumors or missing step.

    To test missing step hazard, i moved the axis forward and rearward dozen of times with this GCODE:

    G0 X100
    G0 X0
    G0 X100
    G0 X0
    .... 20 times...
    M30
    %

    The end point must be the same starting point

    No need change the OutputGain Parameter (simple multiplier pulse per revs ratio)

    Thanks you all!



  10. #10
    Member
    Join Date
    Oct 2017
    Location
    Italy
    Posts
    18
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP & Mach3: Configure STEP PER

    Quote Originally Posted by m_c View Post
    I would not run at 128 microstepping.
    Once you go above 8 or 16, there is no noticeable improvement to be had, and you're far more likely to have issues due to the high pulse steps involved.

    Are these genuine Leadshine drives?
    If they are, you'll need to change the pulse width.
    No, no genuine Leadshine drives (the motors yes) but no problem.

    I do not agree. A high multiplier makes the system more fluid and without resonance

    Now the system work well with high ratio "Pulse/Rev"

    I bought the Kflop just to have controlled boards with a large number of pulses available for all Axis



  11. #11
    Member
    Join Date
    Jun 2004
    Location
    Scotland
    Posts
    355
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP & Mach3: Configure STEP PER

    Quote Originally Posted by CNCtronic View Post
    No, no genuine Leadshine drives (the motors yes) but no problem.

    I do not agree. A high multiplier makes the system more fluid and without resonance

    Now the system work well with high ratio "Pulse/Rev"

    I bought the Kflop just to have controlled boards with a large number of pulses available for all Axis
    The reason I asked about if they were genuine, is genuine DM drives (and I'd imagine direct copies) need increased pulse widths, so you have to add an extra line of code to the KFlop configuration, otherwise you'll lose steps on direction changes.


    Resonance has little to do with microstepping input.
    Pretty much all modern digital drives only use multistepping at low speed. As speed increases, they'll gradually reduce the number of microsteps being output to the motor, eventually reducing to half/full stepping.
    The anti-resonance of modern drives is essentially adjusting the points at which the microstepping output changes, to counteract the natural resonance frequencies of the motor/motion system.
    Leadshine DM drives make use of this (IIRC the DM was a rip-off of the first Gecko digital drives), and is what Gecko class as Morphing.

    Later AM/EM drives take it a step further, and monitor how the motor reacts to the output to determine resonance, and adjust the output microstepping on the fly, rather than at fixed speed points.

    It's also worth noting, microstepping does not increase accuracy either.
    When a stepper motor is held on a microstep, the rotor is essentially being balanced between two magnetic fields. External forces (be that load, friction, or stiction) can easily affect that balance and position. You can only guarantee a stepper motor position to within a full step. The only benefit to microstepping is smoother motion at low speed, however you get diminishing returns, which is why I said there is no noticeable improvement to be had above 8 or 16 microsteps.



  12. #12
    Member
    Join Date
    Oct 2017
    Location
    Italy
    Posts
    18
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP & Mach3: Configure STEP PER

    Thanks a lot for exhaustive explanation.



  13. #13
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP & Mach3: Configure STEP PER

    This line:
    FPGA(STEP_PULSE_LENGTH_ADD) = 32 + 0x80;

    is setting the step pulse width to 32 / 16.67 MHz = 1.92us

    At high speed (step rates) shorter pulses are needed in order to have some time between pulses. It seems you are using 150000 steps/sec which is a period 6.7us so the pulse width should probably be kept shorter than about half of that.

    Regards
    TK http://dynomotion.com


  14. #14
    Member
    Join Date
    Oct 2017
    Location
    Italy
    Posts
    18
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP & Mach3: Configure STEP PER

    Yes Tom, I forgot to write this change in the post.

    With FPGA(STEP_PULSE_LENGTH_ADD) = 32 + 0x80; the motors travel work, but sound a little strange.

    With FPGA(STEP_PULSE_LENGTH_ADD) = 63 + 0x80; all oK



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
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

KFLOP &amp; Mach3: Configure STEP PER

KFLOP &amp; Mach3: Configure STEP PER