Temporarily Disable Signal to Servo Amp

More
3 years 9 months ago #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
3 years 9 months ago #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!

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

More
3 years 9 months ago #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
3 years 9 months ago #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.

More
3 years 9 months ago - 3 years 9 months ago #261591 by hunterlong
Currently I have a custom.hal file that contains


# Load Classicladder
loadrt classicladder_rt
addf classicladder.0.refresh servo-thread
loadusr classicladder --nogui ladder.clp

# Tool change button
net tool-release-btn <= hm2_5i25.0.7i77.0.0.input-05
net tool-release-btn => classicladder.0.in-00
net tool-release-sig-drop classicladder.0.out-00 => hm2_5i25.0.7i77.0.0.output-00
net tool-release-sig-lock classicladder.0.out-01 => hm2_5i25.0.7i77.0.0.output-01
net tool-release-sig-push classicladder.0.out-02 => hm2_5i25.0.7i77.0.0.output-02


Can I just add to this custom.hal file?

loadrt and2
addf and2.0 servo-thread
net z-enable-joint and2.0.in0 <= joint.2.amp-enable-out
net z-enable-ladder and2.0.in1 <= classicladder.0.out-03
net z-enable <= and2.0.out0
net z-enable => pid.z.enable

I doubt that is right. I also attached my custom.hal, my_LinuxCNC_machine.hal, and my_LinuxCNC_machine.ini.

Thanks!
-Hunter
Last edit: 3 years 9 months ago by hunterlong.

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

More
3 years 9 months ago #261594 by hunterlong
I just found this really helpful hal tutorial:http://linuxcnc.org/docs/2.5/html/hal/basic_hal.html

In my my_LinuxCNC_machine.hal I already have this section
Code:
#******************* #  AXIS Z JOINT 2 #******************* setp   pid.z.Pgain     [JOINT_2]P setp   pid.z.Igain     [JOINT_2]I setp   pid.z.Dgain     [JOINT_2]D setp   pid.z.bias      [JOINT_2]BIAS setp   pid.z.FF0       [JOINT_2]FF0 setp   pid.z.FF1       [JOINT_2]FF1 setp   pid.z.FF2       [JOINT_2]FF2 setp   pid.z.deadband  [JOINT_2]DEADBAND setp   pid.z.maxoutput [JOINT_2]MAX_OUTPUT setp   pid.z.error-previous-target true net z-index-enable  <=> pid.z.index-enable net z-enable        =>  pid.z.enable net z-pos-cmd       =>  pid.z.command net z-pos-fb        =>  pid.z.feedback net z-output        <=  pid.z.output # ---PWM Generator signals/setup--- setp   hm2_5i25.0.7i77.0.1.analogout2-scalemax  [JOINT_2]OUTPUT_SCALE setp   hm2_5i25.0.7i77.0.1.analogout2-minlim    [JOINT_2]OUTPUT_MIN_LIMIT setp   hm2_5i25.0.7i77.0.1.analogout2-maxlim    [JOINT_2]OUTPUT_MAX_LIMIT net z-output     => hm2_5i25.0.7i77.0.1.analogout2 net z-pos-cmd    <= joint.2.motor-pos-cmd net z-enable     <= joint.2.amp-enable-out

So I will need to unlink the joint.2.amp-enable-out and the pid.z.enable pin from the z-enable net before I connect my and2 gate.

so
Code:
loadrt and2 addf and2.0 servo-thread unlinkp joint.2.amp-enable-out unlinkp pid.z.enable net z-enable-joint and2.0.in0 <= joint.2.amp-enable-out net z-enable-ladder and2.0.in1 <= classicladder.0.out-03 net z-enable <= and2.0.out0 net z-enable => pid.z.enable

-Hunter

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

Time to create page: 0.155 seconds
Powered by Kunena Forum