Newbie Slave stepper motor


Page 1 of 3 123 LastLast
Results 1 to 12 of 29

Thread: Slave stepper motor

  1. #1
    Registered
    Join Date
    May 2017
    Location
    United States
    Posts
    38
    Downloads
    0
    Uploads
    0

    Default Slave stepper motor

    Set up 4 motors on work bench to test it out, have channel 7 slaved to channel 0. X y z work in kmotion and slave for x works fine both motors turn the same.

    Set up a user button in kmotion with a move command Move(0,200) press button nothing happens and then x axis doesn't work. Changed program to do a Move(0,200) and a Move(7,200) and it works but why do I have to do two commands to move both if one is slaved?

    Also tried the same with a jog command had to enter two jog commands one for each x motor works but locks up if I do a Move command on x axis between jog commands.

    I could use some help in setting up my diy router, any one near Homer Glen Illinois?

    Similar Threads:


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

    Default Re: Slave stepper motor

    Hi mirocha,

    Is Axis 0 the master or slave of Axis 7?

    Post your Initialization C Program so we can see how things are configured.

    Regards

    TK
    http://dynomotion.com


  3. #3
    Registered
    Join Date
    May 2017
    Location
    United States
    Posts
    38
    Downloads
    0
    Uploads
    0

    Default Re: Slave stepper motor

    Worked on master slave problem and the more I attempted to solve the problem the worse it became with Windows 10 mouse becoming erratic. Dedicated computer just for the Kmotion. Reloaded Windows 10, reset PC, still a Windows problem. Found that the Logitech wireless optical mouse was using the windods generic driver was the problem. Installed the Logitech mouse driver fixed the windows problem and Kmotion seems to be working. The master slave of two stepper motors is working with the following ini file. Tested with a Jog(0,200) and Jog(0,0)command multiple times and both work.

    I am using 4 stepper motors all rated 1600-OZ, 3.5 amp, 5.7 volt with Gecko G210 drivers 10X microstepped, powered by 48 volts. All 4 motors are turning 5mm lead ballscrews.

    I do have the following questions regarding what the following settings should be, I am using the example file settings:

    1. Vel
    2. Accel
    3. Jerk
    4. MaxI
    5. invDistPerCycle
    6. StepperAmplitude
    7. Any other setting in the ini that should be adjusted.


    Any and all help will be appreciated.


    #include "KMotionDef.h"

    // Defines axis 0, 1, 2 as simple step dir outputs
    // enables them
    // sets them as an xyz coordinate system for GCode

    int main()
    {

    FPGA(STEP_PULSE_LENGTH_ADD)=63+0x80; //set pulse length to 4us
    //and pulse high for gecko drives

    ch0->InputMode=NO_INPUT_MODE;
    ch0->OutputMode=STEP_DIR_MODE;
    ch0->Vel=40000;
    ch0->Accel=400000;
    ch0->Jerk=4e+006;
    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=4;
    ch0->OutputChan1=0;
    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=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.000768788;
    ch0->iir[2].B1=0.00153758;
    ch0->iir[2].B2=0.000768788;
    ch0->iir[2].A1=1.92076;
    ch0->iir[2].A2=-0.923833;

    EnableAxisDest(0,0);


    ch1->InputMode=NO_INPUT_MODE;
    ch1->OutputMode=STEP_DIR_MODE;
    ch1->Vel=40000;
    ch1->Accel=400000;
    ch1->Jerk=4e+006;
    ch1->P=0;
    ch1->I=0.01;
    ch1->D=0;
    ch1->FFAccel=0;
    ch1->FFVel=0;
    ch1->MaxI=200;
    ch1->MaxErr=1e+006;
    ch1->MaxOutput=200;
    ch1->DeadBandGain=1;
    ch1->DeadBandRange=0;
    ch1->InputChan0=1;
    ch1->InputChan1=0;
    ch1->OutputChan0=6;
    ch1->OutputChan1=0;
    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=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;

    EnableAxisDest(1,0);

    ch2->InputMode=NO_INPUT_MODE;
    ch2->OutputMode=STEP_DIR_MODE;
    ch2->Vel=40000;
    ch2->Accel=400000;
    ch2->Jerk=4e+006;
    ch2->P=0;
    ch2->I=0.01;
    ch2->D=0;
    ch2->FFAccel=0;
    ch2->FFVel=0;
    ch2->MaxI=200;
    ch2->MaxErr=1e+006;
    ch2->MaxOutput=200;
    ch2->DeadBandGain=1;
    ch2->DeadBandRange=0;
    ch2->InputChan0=2;
    ch2->InputChan1=0;
    ch2->OutputChan0=7;
    ch2->OutputChan1=0;
    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=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;

    EnableAxisDest(2,0);

    ch7->InputMode=NO_INPUT_MODE;
    ch7->OutputMode=STEP_DIR_MODE;
    ch7->Vel=40000;
    ch7->Accel=400000;
    ch7->Jerk=4e+006;
    ch7->P=0.2;
    ch7->I=0;
    ch7->D=0;
    ch7->FFAccel=0;
    ch7->FFVel=0;
    ch7->MaxI=200;
    ch7->MaxErr=200;
    ch7->MaxOutput=200;
    ch7->DeadBandGain=1;
    ch7->DeadBandRange=0;
    ch7->InputChan0=5;
    ch7->InputChan1=1;
    ch7->OutputChan0=5;
    ch7->OutputChan1=1;
    ch7->MasterAxis=0;
    ch7->LimitSwitchOptions=0x100;
    ch7->LimitSwitchNegBit=0;
    ch7->LimitSwitchPosBit=0;
    ch7->SoftLimitPos=1e+009;
    ch7->SoftLimitNeg=-1e+009;
    ch7->InputGain0=1;
    ch7->InputGain1=1;
    ch7->InputOffset0=0;
    ch7->InputOffset1=0;
    ch7->OutputGain=1;
    ch7->OutputOffset=0;
    ch7->SlaveGain=1;
    ch7->BacklashMode=BACKLASH_OFF;
    ch7->BacklashAmount=0;
    ch7->BacklashRate=0;
    ch7->invDistPerCycle=1;
    ch7->Lead=0;
    ch7->MaxFollowingError=10000000;
    ch7->StepperAmplitude=250;

    ch7->iir[0].B0=1;
    ch7->iir[0].B1=0;
    ch7->iir[0].B2=0;
    ch7->iir[0].A1=0;
    ch7->iir[0].A2=0;

    ch7->iir[1].B0=1;
    ch7->iir[1].B1=0;
    ch7->iir[1].B2=0;
    ch7->iir[1].A1=0;
    ch7->iir[1].A2=0;

    ch7->iir[2].B0=1;
    ch7->iir[2].B1=0;
    ch7->iir[2].B2=0;
    ch7->iir[2].A1=0;
    ch7->iir[2].A2=0;

    EnableAxisDest(7,0);

    DefineCoordSystem(0,1,2,-1);

    return 0;
    }



  4. #4
    Gold Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    2379
    Downloads
    0
    Uploads
    0

    Default Re: Slave stepper motor

    Hi mirocha,

    The Init C File looks reasonable to me.

    I do have the following questions regarding what the following settings should be, I am using the example file settings:

    1. Vel
    2. Accel
    3. Jerk
    Please see this article:
    Dynomotion

    4. MaxI
    You have an open loop system. P I D and other Feedback related parameters are not used.

    5. invDistPerCycle
    6. StepperAmplitude
    These only apply to modes where current cycles are directly applied to a motor (SnapAmp). It doesn't apply to Step/Dir Drives.

    7. Any other setting in the ini that should be adjusted.
    Only those where you require that particular feature: Limits, Backlash, and OutputGain

    HTH
    Regards

    TK
    http://dynomotion.com


  5. #5
    Registered
    Join Date
    May 2017
    Location
    United States
    Posts
    38
    Downloads
    0
    Uploads
    0

    Default Re: Slave stepper motor

    I though I resolved the X axis master slave problem because the jog command worked. I set up two user buttons to run and stop the jog command to initiate the following two programs for jog. The first button runs following and both X motors in the X axis turn and the Kmotion display numbers advance. I can use the arrow buttons and the Y and Z axis work.


    #include "KMotionDef.h"

    main()
    {
    Jog(0,2000); // move X axis

    }

    Press the second button and both X axis motors stop and the Y and Z works from the Kmotion screen arrows.

    #include "KMotionDef.h"

    main()
    {
    Jog(0,0); // Stop X axis
    }


    I thought I resolved the X axis problem, I set up a third button but when I try a move command it will work only one time and then the X axis motors don’t work, the Kmotion screen display numbers advance for the X axis but the motors are not turning the Y and Z axis do work.

    #include "KMotionDef.h"

    main()
    {
    Move(0,500);


    }

    Thought may be I needed to de-slave the x axis so tried the following code but same thing, runs once, next time I try the Kmotion screen display numbers advance for the X axis but the motors are not turning the Y and Z axis do work.

    #include "KMotionDef.h"

    main()
    {
    // Home (X0 and X7 are slaved)
    //

    #define X0_AXIS 0
    #define X1_AXIS 7


    chan[X0_AXIS].MasterAxis = -1; // De-Slave both
    chan[X1_AXIS].MasterAxis = -1;

    Move(0,500); // move X axis
    Move(7,500); // move X axis

    chan[X1_AXIS].MasterAxis = X0_AXIS; // Slave X1 to X0
    chan[X1_AXIS].SlaveGain = 1;
    chan[X0_AXIS].MasterAxis = -1; // do not slave X0

    }

    Jog command works on X axis master and slave no matter how many time I try no problem,
    Move command on X axis master slave only works once, then I move the x axis with the Kmotion arrows on the screen, the numbers advance but the motors don’t turn. it's like the X axis is locked out.

    Is there something I’m missing about the move command on a master slave axis?



  6. #6
    Registered
    Join Date
    May 2017
    Location
    United States
    Posts
    38
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by mirocha View Post
    I though I resolved the X axis master slave problem because the jog command worked. I set up two user buttons to run and stop the jog command to initiate the following two programs for jog. The first button runs following and both X motors in the X axis turn and the Kmotion display numbers advance. I can use the arrow buttons and the Y and Z axis work.


    #include "KMotionDef.h"

    main()
    {
    Jog(0,2000); // move X axis

    }

    Press the second button and both X axis motors stop and the Y and Z works from the Kmotion screen arrows.

    #include "KMotionDef.h"

    main()
    {
    Jog(0,0); // Stop X axis
    }


    I thought I resolved the X axis problem, I set up a third button but when I try a move command it will work only one time and then the X axis motors don’t work, the Kmotion screen display numbers advance for the X axis but the motors are not turning the Y and Z axis do work.

    #include "KMotionDef.h"

    main()
    {
    Move(0,500);


    }

    Thought may be I needed to de-slave the x axis so tried the following code but same thing, runs once, next time I try the Kmotion screen display numbers advance for the X axis but the motors are not turning the Y and Z axis do work.

    #include "KMotionDef.h"

    main()
    {
    // Home (X0 and X7 are slaved)
    //

    #define X0_AXIS 0
    #define X1_AXIS 7


    chan[X0_AXIS].MasterAxis = -1; // De-Slave both
    chan[X1_AXIS].MasterAxis = -1;

    Move(0,500); // move X axis
    Move(7,500); // move X axis

    chan[X1_AXIS].MasterAxis = X0_AXIS; // Slave X1 to X0
    chan[X1_AXIS].SlaveGain = 1;
    chan[X0_AXIS].MasterAxis = -1; // do not slave X0

    }

    Jog command works on X axis master and slave no matter how many time I try no problem,
    Move command on X axis master slave only works once, then I move the x axis with the Kmotion arrows on the screen, the numbers advance but the motors don’t turn. it's like the X axis is locked out.

    Is there something I’m missing about the move command on a master slave axis?
    It's as if Kmotioncnc is losing communication with the two gecko drives for the x axis after it completes one move command. Kmotioncnc looks like the x axis is working with The screen numbers for The x axis changing but The motors don't turn. The y and z axis work after a Move command they are not master slave.



  7. #7
    Registered
    Join Date
    Jun 2004
    Location
    Scotland
    Posts
    254
    Downloads
    0
    Uploads
    0

    Default Re: Slave stepper motor

    If you run KMotion in the background with the Axis screen open, do both channels still show as being enabled, with the Dest column increasing when you press the button in KMotionCNC?

    It will also be worth having the Console window open in KMotion, to see if any messages get displayed.



  8. #8
    Registered
    Join Date
    May 2017
    Location
    United States
    Posts
    38
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by m_c View Post
    If you run KMotion in the background with the Axis screen open, do both channels still show as being enabled, with the Dest column increasing when you press the button in KMotionCNC?

    It will also be worth having the Console window open in KMotion, to see if any messages get displayed.

    Both channels remain enabled destination column increases when pressing button on Kmotioncnc there are no messages in console screen



  9. #9
    Registered
    Join Date
    Jun 2004
    Location
    Scotland
    Posts
    254
    Downloads
    0
    Uploads
    0

    Default Re: Slave stepper motor

    That would indicate a problem outwith the KFlop. I've just had a quick look over the G201x/210x manual, and see no mention of any kind of LED. Are there any LEDs on the drives to give status? I'm wondering if there's something causing them to fault.

    What happens if you issue the move/jog commands via the Console?



  10. #10
    Registered
    Join Date
    May 2017
    Location
    United States
    Posts
    38
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by m_c View Post
    That would indicate a problem outwith the KFlop. I've just had a quick look over the G201x/210x manual, and see no mention of any kind of LED. Are there any LEDs on the drives to give status? I'm wondering if there's something causing them to fault.

    What happens if you issue the move/jog commands via the
    Console?
    Gecko only has power on led. From console if I do a jog command I can do it as many times as I want and it works every time . If I do a Move command it moves the x axis two motors once and then the next time both x motors do not move from either console or Kmotioncnc. Tried move command for both Y and Z from console numerous times with no problem but they are single motors.



  11. #11
    Registered
    Join Date
    Jun 2004
    Location
    Scotland
    Posts
    254
    Downloads
    0
    Uploads
    0

    Default Re: Slave stepper motor

    Do you have anything available to measure frequency? I.e. multimeter with frequency (Hz) setting, or oscilloscope.
    If you do, set it up so it's measuring the step pulse rate at the gecko drive. Do a move and see what reading you get, then do a second move and see if you still get a similar reading.

    Alternatively, do the first move, then reset the drives (having looked at the manual, you'll need to power cycle them - just turn of the power supply, wait until all drive lights go off, and power it back on), then try another move.

    What we really need to establish, is whether the KFlop is still outputting steps/pulses once the axes stop moving. The fact the Axis screen still shows movement, should mean that pulses are still getting generated, unless something else is causing the axis channels to be reconfigured and stop outputting the required pulses.
    It could be something going into fault when both drives are ran simultaneously, such as the regeneration/energy dump from two motors/drives decelerating causing a voltage spike. You could try reducing the acceleration value for the two axes (try dropping a couple or maybe even 3 zeros of the end), as that should reduce any resultant spike.

    Is it a switched mode, or unregulated power supply?



  12. #12
    Registered
    Join Date
    May 2017
    Location
    United States
    Posts
    38
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by m_c View Post
    Do you have anything available to measure frequency? I.e. multimeter with frequency (Hz) setting, or oscilloscope.
    If you do, set it up so it's measuring the step pulse rate at the gecko drive. Do a move and see what reading you get, then do a second move and see if you still get a similar reading.

    Alternatively, do the first move, then reset the drives (having looked at the manual, you'll need to power cycle them - just turn of the power supply, wait until all drive lights go off, and power it back on), then try another move.

    What we really need to establish, is whether the KFlop is still outputting steps/pulses once the axes stop moving. The fact the Axis screen still shows movement, should mean that pulses are still getting generated, unless something else is causing the axis channels to be reconfigured and stop outputting the required pulses.
    It could be something going into fault when both drives are ran simultaneously, such as the regeneration/energy dump from two motors/drives decelerating causing a voltage spike. You could try reducing the acceleration value for the two axes (try dropping a couple or maybe even 3 zeros of the end), as that should reduce any resultant spike.

    Is it a switched mode, or unregulated power supply?
    Lowered the acceleration starting with 3 zeros then went down to just reducing the acceleration by 1 zero and it is working, tried it a bunch of times worked every time no problem. The mean well power supplies I believe are switching type regulated. Now my question is the motors are running with no mechanical load, when I install them on the machine will there be a problem with the power supplies i'm using. The two x motors are rated at 3.5 amps each and the power supply is rated 10 amps. The y and z are rated 3.5 amps each and each powered by a separate 5 amp supply. Also is the lower acceleration rate acceptable for a 3 axis router. Why do I not have the same problem with single motors on power supplies rated half the amps. Would it benefit me to put large capacitors on the output of the power supplies.

    Why did it happen with a move command not with a jog?

    Would it be better to replace the 10 amp power supply wth two 5 amp supplies and power each motor seperately?

    Last edited by mirocha; 06-02-2017 at 05:20 PM.


Page 1 of 3 123 LastLast

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

Slave stepper motor
Slave stepper motor