Page 1 of 1

G95

Posted: Thu Mar 31, 2022 1:30 pm
by cemoa9
Hello Tom,

On my lathe I encountered an issue with G95, at the G1 after the axis would not move

Here is the code :

G43 H1007
G95
G96 M3 S80 D500
G0 X14 Z0
G1 X-1 F0.1

I am using 4.35f version and CSS works very well when jogging. I also tried to use M4 instead of M3 did not work neither. No encoder on the spindle and it is in step/dir mode. (init file attached)

Do you see something incorrect in my code?

Cordially,

Francois

Re: G95

Posted: Thu Mar 31, 2022 6:17 pm
by TomKerekes
Hi Francois,

Well to do G95 motion synchronized to the Spindle you are expected to have an encoder on the spindle. Since you don't there is no measured Spindle motion and therefore no feed.

To cause the motion to be based on the commanded motion rather than the measured Position you might add this to your forever loop to overwrite the configuration to use Destination.

Code: Select all

Spindle.pEncoderPos = &chan[2].Dest;
HTH

Re: G95

Posted: Thu Mar 31, 2022 7:02 pm
by cemoa9
Hello Tom,

Thank you for your help ! I will set this tomorrow morning.

Francois

Re: G95

Posted: Fri Apr 01, 2022 7:12 am
by cemoa9
Hello Tom,

Works perfectly !

Thanks.

Re: G95

Posted: Thu Jun 30, 2022 2:41 pm
by cemoa9
Hello Tom,

I have been working on the machine, added an encoder on the spindle and some more stuff (also changed the VFD using now analog output from Konnect following the manual) but now G95 doesn't want to work again.

I tried with and without this code in the forever loop Spindle.pEncoderPos = &chan[2].Dest;

I guessed I messed something up in the init file, but I could not figure out what...

Any idea what can be wrong in my code?

Cordially,

Francois

Re: G95

Posted: Fri Jul 01, 2022 2:57 am
by TomKerekes
Francois,

I'd initially leave this:

Spindle.pEncoderPos = &chan[2].Dest;

in to ignore the encoder and work based on commanded destination as before.

You say doesn't work? What happens?

Is Axis #2 Destination advancing on the Axis Screen?

How is the spindle being controlled?

Re: G95

Posted: Fri Jul 01, 2022 12:00 pm
by cemoa9
Hello Tom,

With and without the code :

Spindle.pEncoderPos = &chan[2].Dest;

The axis 2 is moving on the Axis screen (Dest and position).

Then I tried by rotating the spindle manually (without the code), and then after 2-3 seconds of delay the X axis starts moving according to the G-code.

The spindle is controlled through in 0-10V using konnect as analog output (an axis is defined and used for encoder feedback), spindle rotation is visible on the Axis screen and in KmotionCNC.

Cordially,

Francois

Re: G95

Posted: Fri Jul 01, 2022 5:45 pm
by TomKerekes
The encoder may be counting the wrong direction. Try reversing input and output gains.

Re: G95

Posted: Mon Jul 04, 2022 2:04 pm
by cemoa9
Hello Tom,

Again your guess was correct, it now works properly.

Thanks for your help !

Francois