Secondary spindle on 7i76e

More
23 Apr 2019 00:53 #131583 by tommylight

I created two shortcuts that point to different .ini and .hal files. Both spindles are never powered up at the same time. So far it is working great.

John

That is the easiest way to use them, but getting old so i forgot about that.
Thank you. You might need to remind me later on if and when i do get 2 spindles. :)

Please Log in or Create an account to join the conversation.

More
23 Apr 2019 05:22 #131600 by Mike_Eitel
Additional I see the advantage that I could adjust all positions like xyz, home, tool changer etc positions to that spindle...

Please Log in or Create an account to join the conversation.

More
23 Apr 2019 06:50 #131605 by pl7i92
Replied by pl7i92 on topic Secondary spindle on 7i76e
as he got pins left he shoudt try the conventional mode
by giving the signals of the spndles to relay divider
He can also use M8 M9 to get the second spindle a go

but better to User Mcode >110 take the first spindel down and second up in one NGC as well as the repositioning with G92
and a othere NGC called by another Mcode >111 sets the system and ofsets back to the first spindle
so M3 is still to be used and also the 0-10V RPM can be the same only one Dual relay needed one signal claims all

Please Log in or Create an account to join the conversation.

More
23 Apr 2019 22:34 - 23 Apr 2019 22:35 #131705 by andypugh
Replied by andypugh on topic Secondary spindle on 7i76e
A user M-code to switch the control pins of some mux components would be one way to do this.
Alternatively, you could use the output of a "comp" HAL component based on spindle speed.

But, a better way might be to switch on tool-number. For example decide that tools > 50 are in the high-speed spindle. That way the tool XY offsets can account for the different tool positions of the two spindles.

You would pass the spindle speed command to both pwm generators, but only enable one at a time based on tool number.

It's slightly complicated by the fact that tool number is S32, and the comp / wcomp components want a floating point.
loadrt conv_s32_float
loadrt wcomp
addf conv_s32_float.0  servo-thread
addf wcomp.0 servo thread
setp wcomp.0.min 49.5
setp wcomp.0.max 49.6
# You probably already have a HAL pin that holds the tool number, use that here.
net tool-number conv_s32_float.0.in 
net tool-number-float conv_s32_float.0.out wcomp.0.in
net spindle-slow wcomp.0.under  => pwmgen.0.enable
net spindle-fast wcomp.0.over -> pwmgen.1.enable
net spindle-speed-rpm pwmgen.0.value pwmgen.1.value
Last edit: 23 Apr 2019 22:35 by andypugh.

Please Log in or Create an account to join the conversation.

More
24 Apr 2019 10:26 - 24 Apr 2019 10:28 #131758 by tecno
Replied by tecno on topic Secondary spindle on 7i76e

A user M-code to switch the control pins of some mux components would be one way to do this.
Alternatively, you could use the output of a "comp" HAL component based on spindle speed.

But, a better way might be to switch on tool-number. For example decide that tools > 50 are in the high-speed spindle. That way the tool XY offsets can account for the different tool positions of the two spindles.

You would pass the spindle speed command to both pwm generators, but only enable one at a time based on tool number.

It's slightly complicated by the fact that tool number is S32, and the comp / wcomp components want a floating point.
loadrt conv_s32_float
loadrt wcomp
addf conv_s32_float.0  servo-thread
addf wcomp.0 servo thread
setp wcomp.0.min 49.5
setp wcomp.0.max 49.6
# You probably already have a HAL pin that holds the tool number, use that here.
net tool-number conv_s32_float.0.in 
net tool-number-float conv_s32_float.0.out wcomp.0.in
net spindle-slow wcomp.0.under  => pwmgen.0.enable
net spindle-fast wcomp.0.over -> pwmgen.1.enable
net spindle-speed-rpm pwmgen.0.value pwmgen.1.value


Hi Andy,

Interesting this with having tool-number to control spindles.
All I can find as regards tool is in postgui.hal = is something missing?
# You probably already have a HAL pin that holds the tool number, use that here.
net tool-number conv_s32_float.0.in


net spindle-speed-rpm pwmgen.0.value pwmgen.1.value

How is this added to my config? Assuming that the spindle setup I have now will be intact with all whistles and bells.
The new HS spindle only needs on/off and speed setting = no feedback or other whistles and bells.

How is this pwmgen.0. implemented now in my current setup. Trying to understand what is going on.

Cheers
Bengt

File Attachment:

File Name: GB_2speed_...-24.comp
File Size:1 KB

File Attachment:

File Name: GB_2speed.ini
File Size:5 KB

File Attachment:

File Name: GB_2speed_...4-24.hal
File Size:19 KB

File Attachment:

File Name: postgui.hal
File Size:1 KB
Attachments:
Last edit: 24 Apr 2019 10:28 by tecno.

Please Log in or Create an account to join the conversation.

More
24 Apr 2019 14:52 #131771 by andypugh
Replied by andypugh on topic Secondary spindle on 7i76e

Interesting this with having tool-number to control spindles.
All I can find as regards tool is in postgui.hal = is something missing?

Maybe not, you could try using tool-prep-number.
Or maybe create a new signal and use iocontrol.0.tool−number

How is this added to my config? Assuming that the spindle setup I have now will be intact with all whistles and bells.
The new HS spindle only needs on/off and speed setting = no feedback or other whistles and bells


re-wire your pwmgen enable as suggested, but don't bother with a secondary pwmgen for the high speed spindle, just net the "over" output direct to the secondary spindle control output.

On further reflection you probably want the wcomp min to be 1 rpm, then use the wcomp.0.out for the normal spindle pwmgen enable.

Please Log in or Create an account to join the conversation.

More
24 Apr 2019 16:36 #131776 by tecno
Replied by tecno on topic Secondary spindle on 7i76e

re-wire your pwmgen enable as suggested


I am lost here, rewire what to be more exact?

Please Log in or Create an account to join the conversation.

More
24 Apr 2019 17:20 #131778 by andypugh
Replied by andypugh on topic Secondary spindle on 7i76e
Well, as you don't have any pwmgens I can see your confusion.

How about adding an extra output to your GB-2speed.comp that sets a second output pin high if speed > (some number) and sets the current spindle enable pin to false in that situation?
...
pin out bit high-speed-spindle-enable-out;
...
if (spindle_speed_in == 0){
    spindle-enable-out = 0;
    high-speed-spindle-enable-out = 0;
    return;
}
if (spindle_speed_in > 20000){
    spindle-enable-out = 0;
    high-speed-spindle-enable-out = 1;
    return;
}
...

Please Log in or Create an account to join the conversation.

More
24 Apr 2019 18:08 #131781 by tecno
Replied by tecno on topic Secondary spindle on 7i76e
Looks to be a simple solution to modify the COMP
component GB_2speed HS;

pin in bit spindle-enable-in;
pin out bit spindle-enable-out;
pin in float spindle-speed-in;
pin out float motor-speed-out;
pin out bit high-speed-spindle-enable-out;

pin in bit gear-high;
pin in bit motor-high;
pin in bit gear-A;
pin in bit gear-B;
pin in bit gear-C;
pin in bit gear-D;
pin in bit gear-E;

pin out unsigned gear-required;
pin out bit message-##[14];

license "gpl";
function _;

;;

FUNCTION(_){
	int actual, message;
	int i;
	// These need to be edited to suit the gearbox
	int speeds[15]    = {0,     80,  125,  160,  215,  270,  360,  450,  595,  750, 1000, 1191, 1500, 2500, 0x1P30};
	int reqd_gear[15] = {0x0, 0x01, 0x21, 0x02, 0x22, 0x04, 0x24, 0x08, 0x28, 0x10, 0x48, 0x68, 0x50, 0x70, 0x0};

	if (spindle_speed_in == 0){
    spindle-enable-out = 0;
    high-speed-spindle-enable-out = 0;
    return;
	}
	if (spindle_speed_in > 12000){
    spindle-enable-out = 0;
    high-speed-spindle-enable-out = 1;
    return;
	}
	
	actual = (gear_high * 0x40 + motor_high * 0x20  + gear_A * 0x10 + gear_B * 0x08  + gear_C * 0x04 + gear_D * 0x02 + gear_E * 0x01);
	for (i = 0; spindle_speed_in > speeds[i] && i < 14; i++);
	gear_required = reqd_gear[i];
	if (gear_required == actual && gear_required != 0x0){ // We are in the right gear
		spindle_enable_out = spindle_enable_in;
		motor_speed_out = speeds[13] * (spindle_speed_in / speeds[i]);
		message = 0;
	} else {
                int j;
		motor_speed_out = 0;
		spindle_enable_out = 0;
		for (j = 0; j < 13; j++) { message(j) = 0; }
                message(i) = 1;
	}
}

From where do I get the 0-10V to the HS inverter? 7i76e P2 pin 1 IO34?

Please Log in or Create an account to join the conversation.

More
24 Apr 2019 19:00 #131783 by andypugh
Replied by andypugh on topic Secondary spindle on 7i76e
I seem to be confusing my threads. I was under the impression that this was a simple on/off spindle, but reading back it isn't.

Your BoB on the second connector needs a PWM. Does your current firmware put that on the right pin?

Please Log in or Create an account to join the conversation.

Moderators: PCWjmelson
Time to create page: 0.093 seconds
Powered by Kunena Forum