SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT

Moderators: TomKerekes, dynomotion

NOELNOG
Posts: 177
Joined: Wed Nov 10, 2021 3:54 pm

Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT

Post by NOELNOG » Wed Feb 26, 2025 12:22 am

Hi Tom

I am dealing with a master/slave configuration, i have two servo motors on my gantry, the ch1 is the master and the ch3 would be the salved, but it does not move when jog Y axis, is a slaved motor an other axis? or it works both on one single axis? this is the motor configuration.

regards


// Channel 0, X axis set up

ch0->InputMode = NO_INPUT_MODE;
ch0->OutputMode = DAC_SERVO_MODE;
ch0->Vel = 1600;
ch0->Accel = 10000;
ch0->Jerk = 4e+06;
ch0->P = 0;
ch0->I = 0.01;
ch0->D = 0;
ch0->FFAccel = 0;
ch0->FFVel = 0;
ch0->MaxI = 100;
ch0->MaxErr = 1e+06;
ch0->MaxOutput = 400;
ch0->DeadBandGain = 10;
ch0->DeadBandRange = 0;
ch0->InputChan0 = 0;
ch0->InputChan1 = 0;
ch0->OutputChan0 = 0;
ch0->OutputChan1 = 0;
ch0->MasterAxis = -1;
ch0->LimitSwitchOptions = 0x120;
ch0->LimitSwitchNegBit = 1024;
ch0->LimitSwitchPosBit = 1024;
ch0->SoftLimitPos = 1e+30;
ch0->SoftLimitNeg = -1e+30;
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;

EnableAxisDest(0, ch0->Dest);

// Channel 1, Y axis set up

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

EnableAxisDest(1, ch1->Dest);

// Channel 2, Z axis set up

ch2->InputMode = NO_INPUT_MODE;
ch2->OutputMode = DAC_SERVO_MODE;
ch2->Vel = 40000;
ch2->Accel = 200000;
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+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 = 1;
ch2->iir[2].B1 = 0;
ch2->iir[2].B2 = 0;
ch2->iir[2].A1 = 0;
ch2->iir[2].A2 = 0;

EnableAxisDest(2, ch2->Dest);


// Channel 3

ch3->InputMode = NO_INPUT_MODE;
ch3->OutputMode = DAC_SERVO_MODE;
ch3->Vel = 40000;
ch3->Accel = 200000;
ch3->Jerk = 4e+06;
ch3->P = 0;
ch3->I = 0.01;
ch3->D = 0;
ch3->FFAccel = 0;
ch3->FFVel = 0;
ch3->MaxI = 100;
ch3->MaxErr = 1e+06;
ch3->MaxOutput = 400;
ch3->DeadBandGain = 1;
ch3->DeadBandRange = 0;
ch3->InputChan0 = 3;
ch3->InputChan1 = 0;
ch3->OutputChan0 = 3;
ch3->OutputChan1 = 0;
ch3->MasterAxis = 1;
ch3->LimitSwitchOptions = 0x120;
ch3->LimitSwitchNegBit = 0;
ch3->LimitSwitchPosBit = 0;
ch3->SoftLimitPos = 1e+30;
ch3->SoftLimitNeg = -1e+30;
ch3->InputGain0 = 1;
ch3->InputGain1 = 1;
ch3->InputOffset0 = 0;
ch3->InputOffset1 = 0;
ch3->OutputGain = 1;
ch3->OutputOffset = 0;
ch3->SlaveGain = 1.03;
ch3->BacklashMode = BACKLASH_OFF;
ch3->BacklashAmount = 0;
ch3->BacklashRate = 0;
ch3->invDistPerCycle = 1;
ch3->Lead = 0;
ch3->MaxFollowingError = 1000000000;
ch3->StepperAmplitude = 20;

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

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

ch3->iir[2].B0 = 0.000769;
ch3->iir[2].B1 = 0.001538;
ch3->iir[2].B2 = 0.000769;
ch3->iir[2].A1 = 1.92076;
ch3->iir[2].A2 = -0.923833;

EnableAxisDest(3, ch3->Dest);


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

User avatar
TomKerekes
Posts: 2741
Joined: Mon Dec 04, 2017 1:49 am

Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT

Post by TomKerekes » Wed Feb 26, 2025 5:31 am

Hi Noel,

That looks right to me. Except InputMode=NO_INPUT_MODE. How can you have a DAC Servo with no feedback?

The Slave should not be included in the Coordinate System as you have it.
Regards,

Tom Kerekes
Dynomotion, Inc.

NOELNOG
Posts: 177
Joined: Wed Nov 10, 2021 3:54 pm

Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT

Post by NOELNOG » Wed Feb 26, 2025 3:23 pm

TomKerekes wrote:
Wed Feb 26, 2025 5:31 am
That looks right to me. Except InputMode=NO_INPUT_MODE. How can you have a DAC Servo with no feedback?
This is a copy from my workbench pc, i have no motors connected and set NO_INPUT_MODE to be able to watch the readouts but the machine's pc is ENCODER_INPUT_MODE.

I have discovered that the original slaved drive connection on this machine, the encoder signal from the drive was not connected to the original controller, it only close the loop between motor and drive, the rest of the drives they are feeding back to controller, so can i leave the same configuration for kflop? leave the encoder signals from the slaved drive disconnected and set ch3= NO_INPUT_MODE ? otherwise i have to soldering the wires from the drives connector, they left the wires lose :roll:

Thanks

User avatar
TomKerekes
Posts: 2741
Joined: Mon Dec 04, 2017 1:49 am

Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT

Post by TomKerekes » Wed Feb 26, 2025 4:22 pm

It’s not clear to me what you are saying. Are you saying the original control just output the same drive command to both motors hoping that the Slave would move the same as the Master without any feedback? You could do that with a C Program. But it seems that wouldn’t work well if there was different friction, cutting forces, binding, etc. I think it would be better to have closed loop servo on both sides.
Regards,

Tom Kerekes
Dynomotion, Inc.

NOELNOG
Posts: 177
Joined: Wed Nov 10, 2021 3:54 pm

Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT

Post by NOELNOG » Wed Feb 26, 2025 4:32 pm

Yes the drives master and slave was connected step and dir in parallel both from the same controllers output, buy only the master was feeding back to controller, but yes i will wire both to close loop on master and slave.

Regards

Post Reply