Electronic spindle gearbox

More
21 Jul 2014 03:47 #48982 by microsprintbuilder
I cannot find the file linuxcnc/src/hal/components. Is it hidden. What is the first location? Home, documents, etc. ?

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

More
21 Jul 2014 04:04 #48983 by andypugh
Replied by andypugh on topic Electronic spindle gearbox

I cannot find the file linuxcnc/src/hal/components.


Why are you looking for it? You can put ebox.comp anywhere convenient, and comp will compile it and move the executable file to the right place.

if
sudo comp --install ebox.comp
mentions programs like mm and mail then ignore it. You need to
sudo apt-get install linuxcnc-dev

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

More
21 Jul 2014 04:22 #48984 by microsprintbuilder
Ya, I can feel your frustration with me. I'm not real savy in ubuntu. I thought that was what you did but when I tried it it didn't work. I must have spelled something wrong. Worked this time. Now to try to get it working in hal

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

More
30 Jul 2014 00:40 #49268 by microsprintbuilder
upon further review I've found that I have a input from the spindle drive that's called slow which pulls to ground when the spindle is slow enough to change gears so the timer is not needed but instead it needs to wait until the slow signal come true. second item is I installed the dev package at the office and have to do a re install of the software at the shop and do not have internet there to just install off the internet. What is your suggestion on the best way to download the files and put them on a disc and install them that way? I know this is off topic but can the gscreen be installed offline as well? Thanks!

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

More
30 Jul 2014 01:26 #49270 by andypugh
Replied by andypugh on topic Electronic spindle gearbox

upon further review I've found that I have a input from the spindle drive that's called slow which pulls to ground when the spindle is slow enough to change gears so the timer is not needed but instead it needs to wait until the slow signal come true.

That sounds nice and easy. Can you figure out the changes needed yourself?

second item is I installed the dev package at the office and have to do a re install of the software at the shop and do not have internet there to just install off the internet. What is your suggestion on the best way to download the files and put them on a disc and install them that way? I know this is off topic but can the gscreen be installed offline as well? Thanks!

There are ways, but it might actually be easier to just move the PC nearer to the Internet for an evening.

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

More
26 Feb 2015 01:09 #56295 by microsprintbuilder
Hi Andy, I have not done anything with this yet. I struggled with the tool changer and had some other bugs which turned out to be bad OE wiring. There are a few bugs but I'm thinking when I do the update they should be gone. I have some time to work on this and could use your help. would I use a if statement or the spindle slow signal from the drive? Also how would I handle the spindle values in the In file? they are different for each speed range.

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

More
27 Feb 2015 04:12 #56319 by andypugh
Replied by andypugh on topic Electronic spindle gearbox

would I use a if statement or the spindle slow signal from the drive?


That's largely up to you, I think.

Also how would I handle the spindle values in the In file? they are different for each speed range.


You can add your own items to the INI. You can reference those items in the HAL. Or you can put numerical values directly in the HAL.

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

More
03 Mar 2015 04:12 #56413 by microsprintbuilder
This is what I came up with. do you think it will work?

component ebox "electronic gearbox component";
licence "GPL";

pin in bit spindle-slow
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;
pin out float spindle-gearbox-output-scale
pin out float spindle-gearbox-out-min-limit
pin out float spindle-gearbox-out-max-limit
pin in float spindle-gearbox-low-output-scale
pin in float spindle-gearbox-low-min-limit
pin in float spindle-gearbox-low-max-limit
pin in float spindle-gearbox-mid-output-scale
pin in float spindle-gearbox-mid-min-limit
pin in float spindle-gearbox-mid-max-limit
pin in float spindle-gearbox-hi-output-scale
pin in float spindle-gearbox-hi-min-limit
pin in float spindle-gearbox-hi-max-limit
function _;

;;

FUNCTION(_){

// Only do anything if the spindle speed has changed

if ( absf(spindle_speed - last_speed) < 50) {
spindle_on_out = spindle_on_in
} else {
spindle_on_out=0

if (spindle-slow=0){
wait
} else {


if (spindle_speed >= 2500){
relay1 = 0;
relay 2 = 0;
relay 3 = 1;
spindle-gearbox-output-scale = spindle-gearbox-hi-output-scale
spindle-gearbox-out-min-limit = spindle-gearbox-hi-min-limit
spindle-gearbox-out-max-limit = spindle-gearbox-hi-max-limit
} else if (spindle_speed < 1200) {
relay1 = 1;
relay 2 = 0;
relay 3 = 0;
spindle-gearbox-output-scale = spindle-gearbox-low-output-scale
spindle-gearbox-out-min-limit = spindle-gearbox-low-min-limit
spindle-gearbox-out-max-limit = spindle-gearbox-low-max-limit
} else {
relay1 = 0;
relay 2 = 1;
relay 3 = 0;
spindle-gearbox-output-scale = spindle-gearbox-mid-output-scale
spindle-gearbox-out-min-limit = spindle-gearbox-mid-min-limit
spindle-gearbox-out-max-limit = spindle-gearbox-mid-max-limit
}}}
}

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

More
08 Mar 2015 02:34 #56537 by andypugh
Replied by andypugh on topic Electronic spindle gearbox
You seem to have some surplus spaces in the relay output names, but you have probably found those by now.

The main problem with the comp is that you can't wait. Execution has to run right through every time or the thread will over-run.

Typically to wait you use the fperiod macro and a counter:
variable timeout;
...
;;
if (condition){ 
    if (timeout > 0){
        timeout -= fperiod;
    }
    else
    {
        timeout = 10
    }
}
...

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

More
09 Mar 2015 21:43 #56565 by microsprintbuilder
Haven't seen any of the issues you talk about I'm new to programming c. I was thinking that you would want to constantly monitor the commanded speed and if it changes ranges then interrupt the spindle command , wait until the spindle slow command, change the parameters then reengage the spindle command. I'm not real pontificate in programming so I'm taking some online courses. I'm thinking a while loop is what I should use. Does that sound right?

I've been writing and testing in classic ladder because that's what I know best and have wrote something like the following. if commanded speed is <=1200 its gear 1 if it's 1200> and < 2500 it's gear 2 and if its >=2500 it's gear 3 then if the commanded gear # different than set gear # stop spindle wait for spindle slow and then set the gear. then wait a second and turn the spindle back on. also somewhere in the mix needs to be if its this gear true these parameters are true. I wrote this in classic ladder to test my theory and it seams to work. I did't impalement it into my machine just ran in ladder changing the values thou.

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

Time to create page: 0.092 seconds
Powered by Kunena Forum