Secondary spindle on 7i76e
- tommylight
- Away
- Moderator
- Posts: 19198
- Thank you received: 6436
That is the easiest way to use them, but getting old so i forgot about that.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
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.
- Mike_Eitel
- Offline
- Platinum Member
- Posts: 1150
- Thank you received: 184
Please Log in or Create an account to join the conversation.
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.
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
Please Log in or Create an account to join the conversation.
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
Please Log in or Create an account to join the conversation.
Maybe not, you could try using tool-prep-number.Interesting this with having tool-number to control spindles.
All I can find as regards tool is in postgui.hal = is something missing?
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.
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.
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.
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.
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.