Spindle DAC - no read out of spindle rate

Moderators: TomKerekes, dynomotion

Post Reply
Mateusz
Posts: 31
Joined: Thu Jun 06, 2019 8:36 pm

Spindle DAC - no read out of spindle rate

Post by Mateusz » Wed Jun 12, 2019 12:15 pm

Hello,

I've got running Spindle as a servo ADC, configured according to Dynomotion Documentation. Spidle is tuned roughly and responds on M3 ,M4 , M5 commands. Thing is I have no readout on KMotionCNC screen (ID_SpindleRateLabel), it is always zero. Is it because The Variable assigned on screeneditor is -1 rather 113 ?

Thanks
Mateusz

Mateusz
Posts: 31
Joined: Thu Jun 06, 2019 8:36 pm

Re: Spindle DAC - no read out of spindle rate

Post by Mateusz » Thu Jun 13, 2019 10:33 pm

I will add , that I'm using encoder feedback on spindle on axis 3

these are my definitions:

#define SPINDLEAXIS 3 // Axis Channel to Jog to rotate Spindle
#define FACTOR (3413.333333/60.0) // to convert RPM to counts/sec (counts/rev / 60.0sec)
#define SPINDLECW_BIT 147 // bit to activate to cause CW rotation
#define SPINDLECCW_BIT 147 // bit to activate to cause CCW rotation
#define SPEEDVAR 99 // global persistant variable to store latest speed
#define STATEVAR 98 // global persistant variable to store latest state (-1=CCW,0=off,1=CW)
#define KMVAR PC_COMM_CSS_S // variable KMotionCNC will pass speed parameter (113)
#define USE_POS_NEG_VOLTAGE 1 // 0 = output Magnitude, 1 = output positive and negative speed

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

Re: Spindle DAC - no read out of spindle rate

Post by TomKerekes » Fri Jun 14, 2019 4:05 am

Hi Mateusz,

Have you configured Threading in KMotionCNC | Too Setup | Trajectory Planner | Threading?
Regards,

Tom Kerekes
Dynomotion, Inc.

Mateusz
Posts: 31
Joined: Thu Jun 06, 2019 8:36 pm

Re: Spindle DAC - no read out of spindle rate

Post by Mateusz » Fri Jun 14, 2019 8:00 am

Hello Tom,

Good point ! I did configured but rather placing axis 3 I placed number 4, this should resolve an issue, Tomorrow I'm going to see my 11 tons beast.


Thank you !
Attachments
threading.png
threading.png (3.62 KiB) Viewed 4971 times

Mateusz
Posts: 31
Joined: Thu Jun 06, 2019 8:36 pm

Re: Spindle DAC - no read out of spindle rate

Post by Mateusz » Fri Jun 14, 2019 8:40 pm

Another thing, I've got extra signal from Spindle VFD which says "I'm reached set speed'' (Speed Coincidence Signal). May I use it with command M3 ? to make sure spindle has declared RPM.....

Thanks
Mateusz

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

Re: Spindle DAC - no read out of spindle rate

Post by TomKerekes » Sat Jun 15, 2019 2:46 am

Yes. Interface the signal to some KFLOP input. Then you might add C program code to your M3 program to wait for it.
Regards,

Tom Kerekes
Dynomotion, Inc.

Mateusz
Posts: 31
Joined: Thu Jun 06, 2019 8:36 pm

Re: Spindle DAC - no read out of spindle rate

Post by Mateusz » Sun Jun 16, 2019 6:53 pm

Hi Tom,

I sticked an input with "while(VFD_IN);" command just after SetBit(SPINDLECW_BIT), It is running, but I'm nut sure I've made it correctly :) My next step is to introduce Rigid Tap and I'm not sure this change will influence a TAP cycle...I've got few question on this but I'll rise them on different topic.
BTW. This time I did configured a spindle correctly in threading window - and RDO shows speed as it should.



Thanks
Mateusz
Attachments
OnCWJog.c
(1.2 KiB) Downloaded 216 times

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

Re: Spindle DAC - no read out of spindle rate

Post by TomKerekes » Mon Jun 17, 2019 4:22 am

Hi Mateusz,

You forgot to read the input with a call to ReadBit(). So the while loop is testing the bit number not the input bit.

The wait loop is in the wrong place. It should be after the speed is changed not before.

Also a KFLOP Jog only commands the speed to start changing. You should wait until the Axis is done changing to the new speed before waiting for the drive to be at that speed.
Regards,

Tom Kerekes
Dynomotion, Inc.

Post Reply