G95

Moderators: TomKerekes, dynomotion

Post Reply
cemoa9
Posts: 82
Joined: Mon Jun 01, 2020 11:01 am

G95

Post by cemoa9 » Thu Mar 31, 2022 1:30 pm

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
Attachments
Init_CSS.c
(17.17 KiB) Downloaded 40 times

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

Re: G95

Post by TomKerekes » Thu Mar 31, 2022 6:17 pm

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
Regards,

Tom Kerekes
Dynomotion, Inc.

cemoa9
Posts: 82
Joined: Mon Jun 01, 2020 11:01 am

Re: G95

Post by cemoa9 » Thu Mar 31, 2022 7:02 pm

Hello Tom,

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

Francois

cemoa9
Posts: 82
Joined: Mon Jun 01, 2020 11:01 am

Re: G95

Post by cemoa9 » Fri Apr 01, 2022 7:12 am

Hello Tom,

Works perfectly !

Thanks.

cemoa9
Posts: 82
Joined: Mon Jun 01, 2020 11:01 am

Re: G95

Post by cemoa9 » Thu Jun 30, 2022 2:41 pm

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
Attachments
Init_CSS_V7.c
(19.13 KiB) Downloaded 25 times

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

Re: G95

Post by TomKerekes » Fri Jul 01, 2022 2:57 am

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?
Regards,

Tom Kerekes
Dynomotion, Inc.

cemoa9
Posts: 82
Joined: Mon Jun 01, 2020 11:01 am

Re: G95

Post by cemoa9 » Fri Jul 01, 2022 12:00 pm

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

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

Re: G95

Post by TomKerekes » Fri Jul 01, 2022 5:45 pm

The encoder may be counting the wrong direction. Try reversing input and output gains.
Regards,

Tom Kerekes
Dynomotion, Inc.

cemoa9
Posts: 82
Joined: Mon Jun 01, 2020 11:01 am

Re: G95

Post by cemoa9 » Mon Jul 04, 2022 2:04 pm

Hello Tom,

Again your guess was correct, it now works properly.

Thanks for your help !

Francois

Post Reply