Wiring and configuration SERVO DRIVES

Moderators: TomKerekes, dynomotion

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

Re: Wiring and configuration SERVO DRIVES

Post by TomKerekes » Mon Nov 16, 2020 7:07 pm

Hi Gabriel,

You might read this and this.

The Kanalog Relay Drivers switch to GND they can't source +24V. The opto outputs can be wired to source 24V but they are limited to 25ma.

NP
Regards,

Tom Kerekes
Dynomotion, Inc.

GabrielR922
Posts: 79
Joined: Thu Aug 13, 2020 10:07 pm

Re: Wiring and configuration SERVO DRIVES

Post by GabrielR922 » Mon Nov 16, 2020 8:02 pm

Tom, the problem that I'm having is that SWE is always connected to ground. (assuming no cable connected)

When i stop the motion in Kmotioncnc or disable drives in step response, the SWE is grounded and when I enable the axis, it's also grounded.

Am I doing something wrong in config maybe?

Thanks.

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

Re: Wiring and configuration SERVO DRIVES

Post by TomKerekes » Mon Nov 16, 2020 8:49 pm

Hi Gabriel,

Did you read the links I sent? The SWE remains off until KFLOP/Kanalog boots up and all the IO is initialized, then SWE turns on and remains on thereafter. As described you can then use a C Program like the example watchenable.c to continuously monitor the axis enables and then do whatever you want such as disable/enable your drives. You will need to use another output or outputs to be able to enable/disable your drives at will.

HTH
Regards,

Tom Kerekes
Dynomotion, Inc.

GabrielR922
Posts: 79
Joined: Thu Aug 13, 2020 10:07 pm

Re: Wiring and configuration SERVO DRIVES

Post by GabrielR922 » Mon Nov 16, 2020 8:53 pm

Dear Tom.

Sorry, didn't understood the part about being always on.

Will take a look at the watchenable.c and adapt it to my machine.

Thanks for the support!

GabrielR922
Posts: 79
Joined: Thu Aug 13, 2020 10:07 pm

Re: Wiring and configuration SERVO DRIVES

Post by GabrielR922 » Tue Nov 17, 2020 12:10 pm

Hi tom. Wired the SWE and Opto as the wiki and all went together, added the watchenable in the INIT program and all works fine.

Back to servo tuning, can you give me some more help fine tuning?

Attached are configs and plots.

Sorry for too many questions, but I'm already 3 days in this machine, with almost 30 hours and now it's starting to work.

You made me proud of chosing Dynomotion, your support is awesome.

Thanks!
Attachments
p1.rar
(389.38 KiB) Downloaded 105 times
1mb.PNG
p1i5.PNG
p1.PNG
p1.2.PNG

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

Re: Wiring and configuration SERVO DRIVES

Post by TomKerekes » Tue Nov 17, 2020 4:59 pm

Hi Gabriel,

Could you tell us what you tried and what happened?

Have you found the D Limit?

Your move is relatively small so you are only testing 24000 counts/sec even though your limit is 120000.
Regards,

Tom Kerekes
Dynomotion, Inc.

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

Re: Wiring and configuration SERVO DRIVES

Post by TomKerekes » Tue Nov 17, 2020 5:00 pm

Testing Upload. Strange uploads larger than 1MB are allowed for me. Anything unusual you are doing?
Attachments
p1 - Copy.txt
(1.46 MiB) Downloaded 105 times
p1.txt
(1.46 MiB) Downloaded 120 times
Regards,

Tom Kerekes
Dynomotion, Inc.

GabrielR922
Posts: 79
Joined: Thu Aug 13, 2020 10:07 pm

Re: Wiring and configuration SERVO DRIVES

Post by GabrielR922 » Wed Nov 18, 2020 3:58 am

Hi Tom. Maybe you level in the forum is higher ?
Just went to attachments and selected the files.

So, changed some configurations on the drive and could give more P gain.

Tried more D gain also and it give a lot of noise in the output.

Check more reasonable values.
About the blue line, is it normal to go against the output ?

Lowering the input gain gave better results

Thanks for your attention.

ch1->InputMode=ENCODER_MODE;
ch1->OutputMode=DAC_SERVO_MODE;
ch1->Vel=120000;
ch1->Accel=160000;
ch1->Jerk=650000;
ch1->P=2.4;
ch1->I=-1e-05;
ch1->D=30;
ch1->FFAccel=0;
ch1->FFVel=0;
ch1->MaxI=200;
ch1->MaxErr=2000;
ch1->MaxOutput=2047;
ch1->DeadBandGain=0;
ch1->DeadBandRange=0;
ch1->InputChan0=1;
ch1->InputChan1=0;
ch1->OutputChan0=1;
ch1->OutputChan1=1;
ch1->MasterAxis=-1;
ch1->LimitSwitchOptions=0x10f;
ch1->LimitSwitchNegBit=136;
ch1->LimitSwitchPosBit=136;
ch1->SoftLimitPos=1e+30;
ch1->SoftLimitNeg=-1e+30;
ch1->InputGain0=0.6;
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=1000;
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.010799;
ch1->iir[2].B1=0.0215981;
ch1->iir[2].B2=0.010799;
ch1->iir[2].A1=1.65256;
ch1->iir[2].A2=-0.695754;
Attachments
p2.5.PNG
best.rar
(385.43 KiB) Downloaded 110 times

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

Re: Wiring and configuration SERVO DRIVES

Post by TomKerekes » Wed Nov 18, 2020 1:41 pm

Hi Gabriel,

The values in your C Program don't match the Screen.
About the blue line, is it normal to go against the output ?
As you are basically operating with only P gain the output will be proportional to to the error. The more the system lags behind the more output there will be.
Tried more D gain also and it give a lot of noise in the output.
Probably not noise. Rather instability. Instability is like a bad driver making over corrections too quickly and weaving worse and worse down the road.
Lowering the input gain gave better results
I would put that back to 1. You can achieve the exact same result reducing the PID gains.

Don't use negative I gains.

The next step would be to increase I gain to see if you can reduce errors and determine how much it can be increased before becoming unstable.
Regards,

Tom Kerekes
Dynomotion, Inc.

GabrielR922
Posts: 79
Joined: Thu Aug 13, 2020 10:07 pm

Re: Wiring and configuration SERVO DRIVES

Post by GabrielR922 » Wed Nov 18, 2020 1:49 pm

Tom, using a positive I make the middle line goes away from the center line (in the middle plot line). I'm away from the machine but will test and report as soon as possible.


Also, I could higher the P gain because there is a P gain I the drive. With older control it was 316, I lowered to 216 and got 1 P, now it's on 116 and I can go to +/-2.5 P, should I lower (like 10) the P in the drive and raise in kanalog?

Thanks

Post Reply