Page 1 of 1

Spindle DAC - no read out of spindle rate

Posted: Wed Jun 12, 2019 12:15 pm
by Mateusz
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

Re: Spindle DAC - no read out of spindle rate

Posted: Thu Jun 13, 2019 10:33 pm
by Mateusz
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

Re: Spindle DAC - no read out of spindle rate

Posted: Fri Jun 14, 2019 4:05 am
by TomKerekes
Hi Mateusz,

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

Re: Spindle DAC - no read out of spindle rate

Posted: Fri Jun 14, 2019 8:00 am
by Mateusz
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 !

Re: Spindle DAC - no read out of spindle rate

Posted: Fri Jun 14, 2019 8:40 pm
by Mateusz
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

Re: Spindle DAC - no read out of spindle rate

Posted: Sat Jun 15, 2019 2:46 am
by TomKerekes
Yes. Interface the signal to some KFLOP input. Then you might add C program code to your M3 program to wait for it.

Re: Spindle DAC - no read out of spindle rate

Posted: Sun Jun 16, 2019 6:53 pm
by Mateusz
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

Re: Spindle DAC - no read out of spindle rate

Posted: Mon Jun 17, 2019 4:22 am
by TomKerekes
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.