Electronic spindle gearbox

More
08 Jul 2014 20:36 #48540 by microsprintbuilder
I'm retrofitting a Milltronics Partner1. It has a Custom servo motors spindle and drive with a electronic gearbox. low range is 0-1200 rpm, med range is 1201-2499 rpm, and high range is 2500-4200 rpm. the control has inputs to select the range and there is also 5 contact relays to change the wiring configuration based on the range. I'm struggling on how to configure this. I'm thinking I could do a ladder logic but not sure as the spindle control uses +/- 10 volts in each range. Anyone ever done this?

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

More
09 Jul 2014 05:43 #48550 by andypugh
Replied by andypugh on topic Electronic spindle gearbox
It might not need ladder.
One possibility might be to divide the spindle speed request by 3, then convert that to int, and use as the input to a mux_generic to select an int containing the required bit-pattern for the inputs and relays, then split that into bits with the bitslice comp.
(or, simply use a stack of bit-type muxes all connected to the same input).

The problem with this idea is that some hysteresis would be needed, somehow, or 2500rpm would probably dither between ranges. "deadzone" might be right, working on the float-type spindle speed before it gets interpreted as an int.

On reflection, I would probably write a custom component, as this is sounding like an untidy tangle of HAL.

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

More
11 Jul 2014 01:19 #48618 by microsprintbuilder
I've never used the custom component generator. I'll look into that. Got any tips on getting started?

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

More
11 Jul 2014 01:27 #48619 by andypugh
Replied by andypugh on topic Electronic spindle gearbox

I've never used the custom component generator. I'll look into that. Got any tips on getting started?


Well, reading the manpage first, I guess:
www.linuxcnc.org/docs/html/hal/comp.html
Or, if you are using 2.6 / Master:
www.linuxcnc.org/docs/devel/html/hal/comp.html
(The name of the program has changed to save confusion, and to prevent people installing the (unhelpful) suggestion from Ubuntu)

Can the gearbox change gear under load, or should the component only change range with the spindle off?

A general purpose component would need to allow for any number of gears with a max and min speed for each, but you can probably hard-code the behaviour.

Should the component wait after changing gear before allowing the motor to turn back on?

Do you have a table of required outputs for each spindle speed range?

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

More
11 Jul 2014 04:30 #48624 by microsprintbuilder
Yes, I read that and as normal with me it will take a wile for me to figure it out.
As far as the spindle goes if you change ranges the the spindle does needs to stop so the relays can change the wiring configuration. With the old control there was a tiny delay before turning on, Maybe two seconds. The drive has three 24 volt inputs to select range and then the rpm's are variable dependent on + or - 5 volt input

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

More
11 Jul 2014 05:01 - 11 Jul 2014 05:05 #48625 by andypugh
Replied by andypugh on topic Electronic spindle gearbox

Yes, I read that and as normal with me it will take a wile for me to figure it out.


Untested. Completely untested:
component ebox "electronic gearbox component";
licence "GPL";

pin in bit spindle-on-in;
pin out bit spindle-on-out;
pin in float spindle-speed;
pin out bit relay1;
pin out bit relay2;
pin out bit relay3;

function _;

;;

FUNCTION(_){
static int timer;
static double last_speed = -100;

if (timer > 0){
    timer -= 1;
    spindle_on_out = 0;
} else {
    spindle_on_out = spindle_on_in;
}

 // Only do anything if the spindle speed has changed

if ( absf(spindle_speed - last_speed) < 50) return;

if (spindle_speed >= 2500){
    relay1 = 0;
    relay 2 = 0;
    relay 3 = 1;
    spindle_on_out = 0;
    timer = 2000;
} else if (spindle_speed < 1200) {
    relay1 = 1;
    relay 2 = 0;
    relay 3 = 0;
    spindle_on_out = 0;
    timer = 2000;
} else {
    relay1 = 0;
    relay 2 = 1;
    relay 3 = 0;
    spindle_on_out = 0;
    timer = 2000;
}
}
Last edit: 11 Jul 2014 05:05 by andypugh.

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

More
18 Jul 2014 00:42 #48899 by microsprintbuilder
Sorry for the delay I've been gutting and installing the new PC and wiring the boards. I need to add that if you think you might hit the motherboard when drilling holes to mount the PC don't talk yourself out of removing it as I did or you will be replacing it. I'm hoping to get movement this weekend. I'm looking at this with a blank stare and have a few questions. I make a file with the above text in ( linuxcnc/src/hal/components ) and call it electronic gearbox. then in hal, I place loadrt electronic gearbox and then I define the relay 1,2 & 3 to my outputs?

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

More
18 Jul 2014 01:01 #48900 by andypugh
Replied by andypugh on topic Electronic spindle gearbox

I'm looking at this with a blank stare and have a few questions. I make a file with the above text in ( linuxcnc/src/hal/components ) and call it electronic gearbox. then in hal, I place loadrt electronic gearbox and then I define the relay 1,2 & 3 to my outputs?


Nearly. You would need to compile / install the new component using the "comp" tool.

www.linuxcnc.org/docs/html/hal/comp.html

Or, if you are using the development version, it has changed its name:

www.linuxcnc.org/docs/devel/html/hal/comp.html

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

More
18 Jul 2014 01:16 #48901 by microsprintbuilder
And this is done in a terminal window using sudo?

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

More
18 Jul 2014 03:26 #48903 by andypugh
Replied by andypugh on topic Electronic spindle gearbox
You can use gedit to create and edit the file, but then, yes, "sudo comp --install ebox.comp

And then the hal file can contain "loadrt ebox"

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

Time to create page: 0.095 seconds
Powered by Kunena Forum