LED panel light for probe

More
5 years 6 months ago #206101 by russkinch
Hi. I have been using Axis for sometime now and know my way around a little. I had an LED panel light on the axis display for a tool probe. I have since moved over to gmoccapy as planning on using a touch screen only. I cannot for the life of me figure out how to make a panel LED light turn from red to green when to tool height probe works. I know it has to do with HAL pins but I am lost. My probe works in my hal config using probe-in =>motion.probe-input (copied from a auto tool script). But how do I link that to the LED panel light. my glade screen is labelled tool-probe.glade.

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

More
5 years 6 months ago #206110 by newbynobi
Replied by newbynobi on topic LED panel light for probe
You need to embed the glade panel in the INI file with the -H option naming a Hal file.
Within that Hal file you need to do the Hal connection, something like the following should do the work:

net probe-in gladevcp.led_probe

if you did not name the glade component different.
Best is to start without the Hal file and open halshow and look there for the exact name of the LED pin.

You may have a look at the Sim config of gmoccapy with tool probe simulation for more details.

Norbert
The following user(s) said Thank You: russkinch

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

More
5 years 6 months ago - 5 years 6 months ago #206956 by russkinch
Replied by russkinch on topic LED panel light for probe
Hi. I tried and it said the pin was not found (led_probe). I have embedded the panel in my .ini file. I have used the -H so it calls tool_sensor.hal and in this file it would link the probe to the led. In the glade file, the led is called HAL_LED id"led_tool_sensor". So I would assume in the tool_sensor.hal file I would put net probe-in gladevcp.led_tool_sensor? in my main hal file it has net probe-in => motion.probe-input.
Last edit: 5 years 6 months ago by russkinch.

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

More
5 years 6 months ago #206967 by newbynobi
Replied by newbynobi on topic LED panel light for probe
One question:

Why does it not find led_probe?
May be, because your one is called led_tool_sensor?

Why did I write, check the pin name?

If you need more help post your config,

Norbert
The following user(s) said Thank You: russkinch

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

More
5 years 6 months ago #207157 by russkinch
Replied by russkinch on topic LED panel light for probe
Hi,
Here is my code. This is my main .hal file
Code:
# Generated by stepconf 1.1 at Fri Jan 29 10:55:56 2021 # If you make changes to this file, they will be # overwritten when you run stepconf again loadrt [KINS]KINEMATICS loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS loadrt hal_parport cfg="0 out 1 out" loadrt stepgen step_type=0,0,0 loadrt pwmgen output_type=1 loadrt classicladder_rt numPhysInputs=15 numPhysOutputs=15 numS32in=10 numS32out=10 numFloatIn=10 numFloatOut=10 addf parport.0.read base-thread addf parport.1.read base-thread addf stepgen.make-pulses base-thread addf pwmgen.make-pulses base-thread addf parport.0.write base-thread addf parport.1.write base-thread addf stepgen.capture-position servo-thread addf motion-command-handler servo-thread addf motion-controller servo-thread addf classicladder.0.refresh servo-thread addf stepgen.update-freq servo-thread addf pwmgen.update servo-thread net spindle-cmd-rpm => pwmgen.0.value net spindle-on <= spindle.0.on => pwmgen.0.enable net spindle-pwm <= pwmgen.0.pwm setp pwmgen.0.pwm-freq 100.0 setp pwmgen.0.scale 24000.0 setp pwmgen.0.offset 0.0 setp pwmgen.0.dither-pwm true net spindle-cmd-rpm <= spindle.0.speed-out net spindle-cmd-rpm-abs <= spindle.0.speed-out-abs net spindle-cmd-rps <= spindle.0.speed-out-rps net spindle-cmd-rps-abs <= spindle.0.speed-out-rps-abs net spindle-at-speed => spindle.0.at-speed net probe-in => motion.probe-input setp parport.0.pin-01-out-invert 1 net spindle-pwm => parport.0.pin-01-out setp parport.0.pin-02-out-invert 1 net xstep => parport.0.pin-02-out net xdir => parport.0.pin-03-out setp parport.0.pin-04-out-invert 1 net ystep => parport.0.pin-04-out net ydir => parport.0.pin-05-out setp parport.0.pin-06-out-invert 1 net zstep => parport.0.pin-06-out net zdir => parport.0.pin-07-out net astep => parport.0.pin-08-out net adir => parport.0.pin-09-out net xenable => parport.0.pin-14-out net spindle-on => parport.0.pin-17-out setp parport.1.pin-14-out-invert 1 net flood <= iocontrol.0.coolant-flood => parport.1.pin-14-out net estop-ext <= parport.0.pin-10-in net home-x <= parport.1.pin-10-in net home-y <= parport.1.pin-11-in net home-z <= parport.1.pin-12-in net probe-in <= parport.1.pin-13-in-not setp stepgen.0.position-scale [JOINT_0]SCALE setp stepgen.0.steplen 5000 setp stepgen.0.stepspace 5000 setp stepgen.0.dirhold 20000 setp stepgen.0.dirsetup 20000 setp stepgen.0.maxaccel [JOINT_0]STEPGEN_MAXACCEL net xpos-cmd joint.0.motor-pos-cmd => stepgen.0.position-cmd net xpos-fb stepgen.0.position-fb => joint.0.motor-pos-fb net xstep <= stepgen.0.step net xdir <= stepgen.0.dir net xenable joint.0.amp-enable-out => stepgen.0.enable net home-x => joint.0.home-sw-in setp stepgen.1.position-scale [JOINT_1]SCALE setp stepgen.1.steplen 5000 setp stepgen.1.stepspace 5000 setp stepgen.1.dirhold 20000 setp stepgen.1.dirsetup 20000 setp stepgen.1.maxaccel [JOINT_1]STEPGEN_MAXACCEL net ypos-cmd joint.1.motor-pos-cmd => stepgen.1.position-cmd net ypos-fb stepgen.1.position-fb => joint.1.motor-pos-fb net ystep <= stepgen.1.step net ydir <= stepgen.1.dir net yenable joint.1.amp-enable-out => stepgen.1.enable net home-y => joint.1.home-sw-in setp stepgen.2.position-scale [JOINT_2]SCALE setp stepgen.2.steplen 5000 setp stepgen.2.stepspace 5000 setp stepgen.2.dirhold 20000 setp stepgen.2.dirsetup 20000 setp stepgen.2.maxaccel [JOINT_2]STEPGEN_MAXACCEL net zpos-cmd joint.2.motor-pos-cmd => stepgen.2.position-cmd net zpos-fb stepgen.2.position-fb => joint.2.motor-pos-fb net zstep <= stepgen.2.step net zdir <= stepgen.2.dir net zenable joint.2.amp-enable-out => stepgen.2.enable net home-z => joint.2.home-sw-in net estop-out <= iocontrol.0.user-enable-out net estop-ext => iocontrol.0.emc-enable-in # create signals for tool loading loopback net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed # Load Classicladder without GUI (can reload LADDER GUI in AXIS GUI loadusr classicladder --nogui custom.clp

this is my tool_senor.glade file
Code:
<?xml version="1.0"?> <interface> <requires lib="gtk+" version="2.16"/> <!-- interface-requires gladevcp 0.0 --> <!-- interface-naming-policy project-wide --> <object class="GtkWindow" id="window1"> <child> <object class="GtkFrame" id="frm_tool_sensor"> <property name="visible">True</property> <property name="label_xalign">0.5</property> <child> <object class="GtkAlignment" id="ali_tool_sensor"> <property name="visible">True</property> <property name="top_padding">5</property> <property name="bottom_padding">5</property> <property name="left_padding">5</property> <property name="right_padding">5</property> <child> <object class="GtkVBox" id="vbox_tool_sensor"> <property name="visible">True</property> <child> <object class="GtkHBox" id="hbox_tool_sensor"> <property name="visible">True</property> <child> <object class="GtkLabel" id="lbl_tool_sensor"> <property name="visible">True</property> <property name="label" translatable="yes">Probe:</property> </object> <packing> <property name="expand">False</property> <property name="fill">False</property> <property name="position">0</property> </packing> </child> <child> <object class="HAL_LED" id="led_tool_sensor"> <property name="visible">True</property> <property name="pick_color_on">#0000ffff0000</property> <property name="pick_color_off">#ffff00000000</property> </object> <packing> <property name="position">1</property> </packing> </child> </object> <packing> <property name="expand">False</property> <property name="fill">False</property> <property name="position">0</property> </packing> </child> </object> </child> </object> </child> <child type="label"> <object class="GtkLabel" id="lbl_frm_tool_sensor"> <property name="visible">True</property> <property name="label" translatable="yes">&lt;b&gt;Tool Probe&lt;/b&gt;</property> <property name="use_markup">True</property> </object> </child> </object> </child> </object> </interface>

I hope this makes sense? I have a file also called tool-sensor.hal which is where I need the code to turn the LED light to green once the tool probe touches (shorts) and then back to red when its off the tool probe.

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

More
5 years 6 months ago #207158 by newbynobi
Replied by newbynobi on topic LED panel light for probe
Please poat also the INI file and the tool-sensor.hal file, the file you posted looks good so far, as it does not contain any connection to the LED.

Norbert

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

Moderators: newbynobi, HansU
Time to create page: 0.396 seconds
Powered by Kunena Forum