Temporarily Disable Signal to Servo Amp

More
10 Jan 2023 01:45 #261401 by hunterlong
I was wondering how to temporarily disable the analog output of the pid for the z axis? During a tool change I believe I'm making the amp overcurrent fault when the drawbar is pushed down. It moves the z axis about 0.05" down.

I would like to disable the analog out for the z axis, do the tool change, then re-enable it.

If it was at a position of say 0.3" before I disabled it, and it got pushed down to 0.25", when re-enabled could it just move back to the original position of 0.3"?

Thanks,
Hunter

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

More
10 Jan 2023 02:21 #261408 by tommylight
Read about this in the other topic, thinking about it, i am sure LinuxCNC does this for tandem axis/joints, but i am not sure if it will work for a single axis, although i see no reason why it should not.
No idea how to implement it for now, need sleep, 3AM here.
The following user(s) said Thank You: hunterlong

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

More
10 Jan 2023 02:36 #261410 by hunterlong
I see the pid component has a pin:

pid.N.enable bit in

When true, enables the PID calculations. When false, output is zero, and all internal integrators, etc, are reset.

Maybe I could wire up to this in classic ladder?

-Hunter

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

More
10 Jan 2023 02:49 #261412 by tommylight
I would not use classic ladder for that, keep it in hal.
Hal has "and" "or" "xor" logic components included.

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

More
10 Jan 2023 13:25 - 10 Jan 2023 13:28 #261443 by hunterlong
Cool, well just correct me if anything I say is nonsensical. I'm a noob :)

The way my tool change works now is I have in my *.ini file
[EMCIO]
EMCIO = io
CYCLE_TIME = 0.100
TOOL_TABLE = tool.tbl
TOOL_CHANGE_QUILL_UP = 1
TOOL_CHANGE_POSITION = 0 0 0.300

So when I get an M6T1 command the z-axis moves up to 0.300". Then there is a button on the machine I push wired up to classic logic. Q2 is the z-axis lock bar, Q1 lowers the pin to the drawbar, and Q0 extends the pin that releases the drawbar/tool.

I was thinking I would could just wire Q1 to pid.N.enable bit in as well so that while the drawbar is being pushed down the pid for the z axis is disabled as well.

-Hunter

 
Attachments:
Last edit: 10 Jan 2023 13:28 by hunterlong. Reason: Image didn't work

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

More
10 Jan 2023 18:55 - 10 Jan 2023 18:57 #261480 by Todd Zuercher
Maybe, instead of disabling the PID it might be better to use one or more mux components to soften the PID's settings so that it doesn't push back so hard as to overload the servo. Simply turning off/on the PID will likely cause it to correct the error with a harsh bang movement when it is enabled. Especially if the error is significant. Also you may have problems with following error alarms and might need to figure out a way to subvert them or set them loose enough to not interfere.
Last edit: 10 Jan 2023 18:57 by Todd Zuercher.
The following user(s) said Thank You: tommylight, hunterlong

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

More
11 Jan 2023 00:35 #261517 by andypugh
If you are using Classic Ladder to sequence the tool change then, yes, use it to disable the PID too.
I would suggest a HAL AND2 function so that the PID is active if amp-enable AND the CL output are both true. You need the CL output to default to true and be set false during tool change.

If the Z moves down a bit (onto the plate) then the PID will simply jump back to the commanded position when it is re-enabled. The jump might even help shake the plate free :-)
The following user(s) said Thank You: hunterlong

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

More
11 Jan 2023 01:13 #261518 by hunterlong
Awesome! Now I just need to figure out the details. I have a vague notion of how to wire these things up in HAL. Off to read some tutorials!I included an oscilloscope display during a tool change that didn't fault the amp. The pid is definitely fighting that drawbar pushing down with 2klbs of force!
Attachments:

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

More
11 Jan 2023 10:24 #261548 by andypugh
If I am understanding the earlier movies properly, I think that the big sliding plate exists to react the release force, so the amp should maybe be disabled based on the position sensor of that plate.

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

More
11 Jan 2023 13:13 #261557 by hunterlong
Yeah, you are exactly right. Right now I don't have any sensor to indicate that the lock plate is in position, I just fire the air solenoid and assume it is. There is a switch I could wire up that is activated when the plate locks.

Here is a video of the lockbar working, and me accidentally dropping my edge finder because I was videoing and not paying attention :)

photos.app.goo.gl/AH9BLkDeBQpQepMd8

-Hunter

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

Time to create page: 0.118 seconds
Powered by Kunena Forum