physical start button + pause switch

More
9 years 10 months ago - 9 years 10 months ago #83774 by Todd Zuercher
Does the machine need to do any movements when the part is not in place?

If it does not, how about using motion.feed-hold or motion.feed-inhibit. This would prevent the machine from making any moves when a part is not in position.
If you also want it to wait to start moving until it receives some operator input, you could use some hal logic (or classicladder would probably be my choice) to make a "latching circuit" to make it wait for the appropriate user input.
Such as the user pressing a "stop/reset" button or a "go" button.

The hal logic would look something like this:
sensor-input=>or2.in0
or2.out=>xor2.in0
stop/reset=>and2.in0=>halui.program.abort
go-button=>and2.in1=>halui.mode.auto=>halui.program.run
and2.out=>xor2.1
xor2.out=>or2.in1=>motoin.feed-hold

(I think this would all make more sense and be easier to look at in a ladder diagram but I don't have an easy way to print that fast.)
Last edit: 9 years 10 months ago by Todd Zuercher.
The following user(s) said Thank You: SenorAguas

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

More
9 years 10 months ago #83783 by SenorAguas
I just checked the machine and how it is operating. I've been away from it for the last 2 weeks, so I got some of my details wrong in previous posts. I've had so many versions of this HAL file that I wasn't able to keep its behavior straight in my head!

It starts with the start button as it should.
It stops with the part unloaded switch like it should.
It won't start if a part is not loaded.
It restarts from the beginning of the program with the start button.
It occasionally has the ""can't do that (EMC_TRAJ_SET_TELEOP_ENABLE) in auto mode with the interpreter idle" error which apparently only happens on interpolated moves.
Basically, I'm happy with it. It could be better, but the colleague that I'm building it for is happy with it and I can't spend much more time on it.

Here's my HAL file:
Code:
loadrt and2 count=2 loadrt or2 count=1 addf and2.0 servo-thread addf and2.1 servo-thread addf or2.0 servo-thread # External Program Pause and Run Buttons # Run Section net run-step-btn or2.0.in0 and2.1.in0 <= parport.0.pin-13-in net pause-on and2.1.in1 <= halui.program.is-paused net my-or1 or2.0.in1 <= and2.1.out net run-sig halui.mode.auto halui.program.run <= or2.0.out # Pause Section net pause-resume-btn and2.0.in0 <= parport.0.pin-15-in-not net run-on and2.0.in1 <= halui.program.is-running net pause-sig halui.program.stop <= and2.0.out setp halui.mode.teleop 1

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

More
9 years 10 months ago #83784 by SenorAguas
When I have some free time, I may try this. Thanks for your help!

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

More
9 years 10 months ago #83791 by Todd Zuercher
I think I have a handle on what the problem might be (why you get the odd error messages), but you need to share your complete hal file(s)

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

More
9 years 10 months ago #83811 by SenorAguas
OK, here's my complete HAL file, also attached:
Code:
# Generated by stepconf 1.1 at Tue Nov 8 05:07:19 2016 # If you make changes to this file, they will be # overwritten when you run stepconf again loadrt trivkins loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES loadrt hal_parport cfg="0 out" setp parport.0.reset-time 1000 loadrt stepgen step_type=0,0,0 loadrt charge_pump net estop-out charge-pump.enable iocontrol.0.user-enable-out net charge-pump <= charge-pump.out loadrt minmax count=2 addf minmax.0 servo-thread addf minmax.1 servo-thread net xmaxferror axis.0.f-error minmax.0.in net ymaxferror axis.1.f-error minmax.1.in loadrt and2 count=2 loadrt or2 count=1 addf and2.0 servo-thread addf and2.1 servo-thread addf or2.0 servo-thread # External Program Pause and Run Buttons # Run Section net run-step-btn or2.0.in0 and2.1.in0 <= parport.0.pin-13-in net pause-on and2.1.in1 <= halui.program.is-paused net my-or1 or2.0.in1 <= and2.1.out net run-sig halui.mode.auto halui.program.run <= or2.0.out # Pause Section net pause-resume-btn and2.0.in0 <= parport.0.pin-15-in-not net run-on and2.0.in1 <= halui.program.is-running net pause-sig halui.program.stop <= and2.0.out setp halui.mode.teleop 1 addf parport.0.read base-thread addf stepgen.make-pulses base-thread addf charge-pump base-thread addf parport.0.write base-thread addf parport.0.reset base-thread addf stepgen.capture-position servo-thread addf motion-command-handler servo-thread addf motion-controller servo-thread addf stepgen.update-freq servo-thread net coolant-mist <= iocontrol.0.coolant-mist net coolant-flood <= iocontrol.0.coolant-flood net xstep => parport.0.pin-02-out setp parport.0.pin-02-out-reset 1 setp parport.0.pin-03-out-invert 1 net xdir => parport.0.pin-03-out net ystep => parport.0.pin-04-out setp parport.0.pin-04-out-reset 1 setp parport.0.pin-05-out-invert 1 net ydir => parport.0.pin-05-out net coolant-mist => parport.0.pin-06-out net coolant-flood => parport.0.pin-07-out setp parport.0.pin-08-out-invert 1 net xenable => parport.0.pin-08-out net xenable => parport.0.pin-16-out net charge-pump => parport.0.pin-17-out net home-y <= parport.0.pin-11-in net home-x <= parport.0.pin-12-in setp stepgen.0.position-scale [AXIS_0]SCALE setp stepgen.0.steplen 1 setp stepgen.0.stepspace 0 setp stepgen.0.dirhold 11200 setp stepgen.0.dirsetup 11200 setp stepgen.0.maxaccel [AXIS_0]STEPGEN_MAXACCEL net xpos-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd net xpos-fb stepgen.0.position-fb => axis.0.motor-pos-fb net xstep <= stepgen.0.step net xdir <= stepgen.0.dir net xenable axis.0.amp-enable-out => stepgen.0.enable net home-x => axis.0.home-sw-in setp stepgen.1.position-scale [AXIS_1]SCALE setp stepgen.1.steplen 1 setp stepgen.1.stepspace 0 setp stepgen.1.dirhold 11200 setp stepgen.1.dirsetup 11200 setp stepgen.1.maxaccel [AXIS_1]STEPGEN_MAXACCEL net ypos-cmd axis.1.motor-pos-cmd => stepgen.1.position-cmd net ypos-fb stepgen.1.position-fb => axis.1.motor-pos-fb net ystep <= stepgen.1.step net ydir <= stepgen.1.dir net yenable axis.1.amp-enable-out => stepgen.1.enable net home-y => axis.1.home-sw-in net estop-out <= iocontrol.0.user-enable-out net estop-out => iocontrol.0.emc-enable-in

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

More
9 years 10 months ago #83813 by Todd Zuercher
I'm still not sure where the error is coming from, I had an idea but it doesn't seem to be the problem. Tests I've been running in a simulation have not been reproducing it.
It sometimes matters the order that you add things to threads, so it is a good idea to have all of them in one place in the hal file.

I did a little tidying up, and removed a bunch of needless hal logic.

Give it a try and see if it works any better.

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

Time to create page: 0.221 seconds
Powered by Kunena Forum