-
Re: New screen
[QUOTE=bhurts;2042250]The question is do you have or know of how I can turn off and on soft limits in c code and attach it to a toggle button so I can turn them off without changing my initiate file. I tried to turn them off in my homing routine and it worked. At the end of the routine I tried to turn them back on and it didn't work. For me I think a button would be better to toggle them on and off and just leave them out of the homing program.
Any advice would be great.
[/QUOTE]
I'm not sure why you'd want to disable/enable softlimits regularly, but it is possible.
You would need to alter your init.c to contain code to continually monitor the switch and alter the soft limits depending on the state of the switch.
Something like this within an infinite loop-
[code]
if(ReadBit(xx)){ // if switch input high, set softlimits
ch1->SoftLimitPos=7000;
ch1->SoftLimitNeg=-278000;
} else { // else clear softlimits (set them really high)
ch1->SoftLimitPos=1e+09;
ch1->SoftLimitNeg=-1e+09;
}
[/code]
You might want to extend it to add some debounce.
-
Re: New screen
I really appreciate the help and I will play with the code you gave me. I really don't want to use it regularly but it would be very helpful when I do. If the machine losses connection or I shut down the control when it's not at home soft limits prevent making it to the switch after rebooting. I would just use the button to turn them off so I can jog the axis close enough to the switch to home. Then I would enable them again.
Thanks
Ben
Sent from my HTC6525LVW using Tapatalk
-
Re: New screen
Also I would only need to disable limits in the direction of home.
Ben
Sent from my HTC6525LVW using Tapatalk
-
Re: New screen
Personally, I would not set soft limits in the init.c.
I'd leave them at the default 1e+09, and then only set them as part of the homing routine once the machine has homed.