Hi there,
I'm trying to send a negative speed value to my spindle to invert rotation direction, but I get an overflow error form the KRC (KUKA KR150-2 krc205 V5-6-11). I send the speed reference through Devicenet with a signal variable HSD_SPEED_SET $out[57] to $out[76]. Any suggestion on how to fix it?
Overflow
-
Marco -
December 3, 2015 at 7:59 PM -
Thread is marked as Resolved.
-
-
For any SIGNAL assignment less than 32 bits, KSS treats the signal as an unsigned integer. So trying to send a negative value isn't going to work. You're sending 20(?) bits.
How to resolve this depends on how your spindle control translates binary numbers. I've seen many different brands use very different methods.
One of the simplest is the "sign-magnitude" method -- the MSB is treated as a sign bit, and all the other bits are translated from binary to decimal as the signal's magnitude. So, you could, perhaps, change your SIGNAL assignment to use 57 through 75, and then use code to set $OUT[76] separately based on whether the speed you want is positive or negative:
CodeSIGNAL O_Speed $OUT[57] TO $OUT[75] SIGNAL O_Direction $OUT[76] O_Speed = ABS(DesiredSpeed) ; remove minus sign O_Direction = (DesiredSpeed < 0) ; set negative sign bit if speed is negative value
Of course, then there's Siemens analog, which (for a 16-bit example), treats 0-32767 as positive values, but then treats 32768 as the highest negative value, and ramps down as the binary value increases from 32768 to 65535.
-
Thanks! you gave me the right tip to find out that my drive actually has a digital input to control rotation direction...then it was a couple of hours to wire up things and edit the post-processor to get the clockwise or counter-clockwise rotation set via Sprutcam to control an output and send the signal to the driver.
Best,
Marco