Help needed to get my 7i76E + 7i85S + 7i73 on my mill going.

More
8 years 2 months ago #116533 by tecno
Oboy that´s a typo from my part as I did copy and paste.

No I have not seen any updated version.

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

More
8 years 2 months ago #116534 by tecno
Hope this part is more OK
Code:
FUNCTION(_){ int i; int gear; if (spindle_speed_in == 0) return; switch (gear_AH + gear_BH * 2 + gear_B * 4 + gear_C * 8 + gear_D * 16 + gear_E *32) { case 1: // Gear AH gear = (high_gear != 0) ? 1 : 7; break; case 2: // Gear BH gear = (high_gear != 0) ? 2 : 8; break; case 3: // Gear B gear = (high_gear != 0) ? 3 : 9; break; case 4: // Gear C gear = (high_gear != 0) ? 4 : 10; break; case 5: // Gear D gear = (high_gear != 0) ? 5 : 11; break; case 6: // Gear E gear = (high_gear != 0) ? 6 : 12; break; case else: // gear selection is bitmasked to be able to spot double-engagement gear = 0; } if (spindle_speed_in >= min_speed(gear) && spindle_speed_in <= max_speed(gear)) { motor_speed_out = spindle_speed_ * gear_ratio(gear); spindle_enable_out = spindle_enable_in; } else { motor_speed_out = 0; spindle_enable_out = 0; } }

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

More
8 years 2 months ago #116535 by andypugh
The version here:
forum.linuxcnc.org/39-pncconf/33069-help...ing?start=460#116030

Should work better.

But doesn't actually disallow high speed in low gears.

But the other component does a better job of suggesting which gear should be used.

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

More
8 years 2 months ago #116537 by tecno
Same same but different mine is.

I have yours as a base but now motor speeds HI and LO needs to be implemented.

Have a closer look at
forum.linuxcnc.org/39-pncconf/33069-help...ing?start=560#116477

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

More
8 years 2 months ago #116645 by tecno
This compiles, but I would like to know what following lines actually does (as I think it is wrong).

pin in float gear.#.ratio[12];
motor_speed_out = spindle_speed_in * gear_ratio(gear);

As the spindle should go max at HI/LO motorspeed on each gear max and only adjust to min speed of that gear via VFD.



Code:
component GB_2speed; 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 in float gear.#.min-speed[12]; pin in float gear.#.max-speed[12]; pin in float gear.#.ratio[12]; pin in bit high-gear; pin in bit gear-AH; pin in bit gear-BH; pin in bit gear-B; pin in bit gear-C; pin in bit gear-D; pin in bit gear-E; license "gpl"; function _; ;; FUNCTION(_){ int gear; if (spindle_speed_in == 0) return; switch (gear_AH + gear_BH * 2 + gear_B * 4 + gear_C * 8 + gear_D * 16 + gear_E *32) { case 1: // Gear AH gear = (high_gear != 0) ? 1 : 7; break; case 2: // Gear BH gear = (high_gear != 0) ? 2 : 8; break; case 3: // Gear B gear = (high_gear != 0) ? 3 : 9; break; case 4: // Gear C gear = (high_gear != 0) ? 4 : 10; break; case 5: // Gear D gear = (high_gear != 0) ? 5 : 11; break; case 6: // Gear E gear = (high_gear != 0) ? 6 : 12; break; default: // gear selection is bitmasked to be able to spot double-engagement gear = 0; } if (gear >= 0 && spindle_speed_in >= gear_min_speed(gear) && spindle_speed_in <= gear_max_speed(gear)) { motor_speed_out = spindle_speed_in * gear_ratio(gear); spindle_enable_out = spindle_enable_in; } else { motor_speed_out = 0; spindle_enable_out = 0; } }

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

More
8 years 2 months ago #116704 by andypugh
The cases need to be 1, 2, 4, 8, 16 etc.
(Like the updated version that I posted, and gave you a link to).

Are you saying that you want to always run the VFD at 50 Hz?

The code that you have highlighted is intended to calculate the motor speed for the current spindle speed. as input it has a HAL pin where you need to set the ratio for each gear.

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

Moderators: cmorley
Time to create page: 0.119 seconds
Powered by Kunena Forum