#linuxcnc Logs

Feb 01 2024

#linuxcnc Calendar

01:05 AM XXCoder: the @ spam is now stripped so we will only see nicks without @_discord. awesome.
01:19 AM lcnc-relay: <TurBoss> thanks for the report XXCoder! and sorry for the noise 🙂
01:19 AM XXCoder: 🎉
03:09 AM -!- #linuxcnc mode set to +v by ChanServ
03:09 AM -!- #linuxcnc mode set to +v by ChanServ
04:37 AM Tom_L: morning
05:08 AM JT-Cave: morning
06:36 AM Tom_L: jet works on RTAI now
06:49 AM Tom_L: JT-Cave, in your touchoff code, where does g5x_index come from?
06:49 AM Tom_L: i'm looking at the lcnc python interface
06:50 AM Tom_L: oh i found it
06:52 AM JT-Cave: I just fixed the mdi to work with pressing enter if in the text box
06:53 AM JT-Cave: now for a mdi keyboard popup thingy
06:53 AM Tom_L: nice
06:53 AM Tom_L: i got the tool lenth offset code working in axis
06:53 AM Tom_L: G10 L1 P#<_current_tool> Z#<_z>
06:54 AM Tom_L: now to translate that to python
06:54 AM Tom_L: i did add a button and think i know where the connection is made
06:55 AM Tom_L: in connections.py you add the button name to the python funcition right?
06:55 AM Tom_L: or is that done in the qt screen?
06:55 AM Tom_L: designer
06:56 AM JT-Cave: the connections are done in connection.py
06:57 AM Tom_L: i've been looking at the touchoff code as it looks quite similar to what i want
06:57 AM JT-Cave: so I make a dictionary of the widget name and the function like this button_list = {'my_button': 'button_action'}
06:58 AM Tom_L: unless you wanna add it :)
06:58 AM JT-Cave: then I check to see if the object exists
06:58 AM JT-Cave: maybe you need to try first and see if you can decipher it
06:58 AM Tom_L: i just realized this morning where the lcnc connection was
06:59 AM JT-Cave: I'll make a small sample with comments
07:01 AM Tom_L: things like 'parent' 'self' etc confuse me
07:02 AM Tom_L: not sure at what level i'm dealing with
07:04 AM JT-Cave: self is referring to the class jet_gui
07:04 AM JT-Cave: when passing self to another program you call it parent
07:05 AM bjorkintosh: Tom_L, welcome to the world of OO. a lot of the terms originated from smalltalk where the idea was communication between objects.
07:05 AM bjorkintosh: but since you're "talking" you can refer to yourself.
07:05 AM JT-Cave: if you look in jet you see that everything is using self.
07:05 AM bjorkintosh: and not to another object, in keeping up with the communication between objects idea.
07:06 AM JT-Cave: there's no OOP in my program :) just straight coding
07:06 AM bjorkintosh: python and qt are Object based, unfortunaaately.
07:07 AM Tom_L: i never could figure out oops
07:07 AM Tom_L: i've tried with another project
07:07 AM bjorkintosh: yeah. Pure OOP is just that. POOP.
07:07 AM bjorkintosh: but it's a necessary evil in some cases.
07:07 AM bjorkintosh: tk is very much object based (not necessarily object oriented)
07:08 AM Tom_L: see i would have thought 'parent' would be the calls from linuxcnc
07:14 AM bjorkintosh: Tom_L, the core idea of OOP is not that strange in our world. Imagine a program for a widget, complete with all the G54s and work instructions to go with it and all the drawings, fixtures and instructions for which machine to run it on.
07:14 AM bjorkintosh: as opposed to just the code.
07:15 AM Tom_L: i'm afk i 5.. bak later
07:15 AM Tom_L: in
07:16 AM bjorkintosh: hahahah. damn I knew it was a boring topic but NOT that boring!!
07:16 AM bjorkintosh: just teasing.
07:16 AM Tom_L: i was happy to get that mdi command to work
07:18 AM Tom_L: oh, JT-Cave i also figured out the problem with that Z offset value i kept complaining about
07:18 AM Tom_L: (tool offset)
07:35 AM JT-Cave: paste.debian.net thinks I'm spam
07:43 AM JT-Cave: going to the Midway Bar & Grill in St Genevieve for lunch today
09:07 AM JT-Cave: Tom_L, g code pad is working
10:22 AM Roguish: good morning...... cloudy, possible showers, mid 40's
10:45 AM JT-Shop: hmm someone just funded the forum for $160 :)
10:55 AM Roguish: outstanding
10:55 AM Roguish: how'd they do it?
10:55 AM Roguish: just pay the bill?
10:55 AM Roguish: I'll donate...
11:09 AM CloudEvil: :)
12:43 PM lcnc-relay: <JT (@jt-shop:matrix.org)> I assume someone gave a cc to one of the owners of the forum
01:44 PM Tom_L: JT-Shop, MDI command, enter works now but the Run MDI Command doesn't
01:45 PM Tom_L: (the button)
01:50 PM Tom_L: Gcode pad _could_ use an 'F'
02:16 PM t4nk_fn: pffffff I got these screws and nuts on my couplers that can only be just as long as they are to keep out of the way
02:16 PM t4nk_fn: but it's always a tremendous fight to get them on :|
02:16 PM t4nk_fn: driving me.. well.. nuts :|
02:17 PM Rab: Maybe you can countersink the holes slightly to help start them.
02:18 PM t4nk_fn: there's too little flesh available for that I guess, they're printed ones
02:19 PM t4nk_fn: they're pretty good if you treat them well
02:19 PM Rab: For coupling motors/
02:20 PM t4nk_fn: got it on my z-axis, coupling a stepper to a threaded rod
02:22 PM t4nk_fn: been working on my new diy machine, it's coming along nicely but I think I had some unpredictable backlash on the z-axis when I was using metal couplers
02:22 PM Rab: Any pics of the coupler?
02:22 PM t4nk_fn: they're the flexible kind and I'm afraid the 'spring' is the cause
02:22 PM t4nk_fn: the printed one you mean?
02:23 PM Rab: yep
02:23 PM t4nk_fn: https://www.thingiverse.com/thing:1329750 like this
02:24 PM Rab: Thanks!
02:24 PM t4nk_fn: ;)
02:25 PM t4nk_fn: I think mine are 30mm high though
02:40 PM t4nk_fn: might not be a bad idea to add some more holes in the middle to be able to tighten it more evenly
02:42 PM t4nk_fn: and if you want to print them, it's best to cut them in half and print 'em horizontally
03:51 PM roycroft: my er40 collet block has been stuck in new jersey, allegedly due to bad weather, for days now
03:51 PM roycroft: and there's no sign that it's leaving new jersey any time soon, so i just ordered another one from california
03:51 PM roycroft: i can send the first one back if it ever arrives
03:52 PM JT-Shop: Tom_L, testing
03:52 PM * roycroft remembers that back in the before times deliveries did not get stuffed up like this due to a little weather
03:54 PM JT-Shop: our deliveries are pretty consistent, if there is snow or ice on the ground you're not getting anything from UPS
03:55 PM JT-Shop: otherwise if it's a sunday delivery from amazon it's not coming to rugby lane it's going to ruby lane which is in the opposite part of the county
04:00 PM roycroft: it seems that for the past couple years, anything that gets sent from the east coast gets an exception flag and does not arrive nearly on time
04:01 PM roycroft: the tool from california costs a bit more, but it will be here sooner than the one from new jersey, which i ordered a week ago
04:03 PM XXCoder: weird
04:03 PM XXCoder: only time I had uncertainity in time of arrival was when I ordered from japan
04:06 PM roycroft: that got really messed up at the beginning of the pandemic
04:07 PM roycroft: i had ordered a bunch of tools, mostly clamps, from a supplier in japan
04:07 PM roycroft: the supplier shipped them, but the day they were to be put on the plane to fly to the us, japan shut down all international shipping
04:08 PM roycroft: i ended up getting refunded for all those items, and had to spend a lot of time looking for new suppliers
04:08 PM XXCoder: ouch. well my orders was before the plague
04:08 PM XXCoder: it just took quite a bit of time
04:09 PM XXCoder: my second order was in late 2021 and took couple months
04:10 PM roycroft: i was ok
04:10 PM roycroft: the vendor not so much
04:10 PM roycroft: the parcel was stuck in a warehouse for over a year
04:11 PM roycroft: japan post would not send it to the destination and would not return it to the shipper
04:15 PM XXCoder: ouch lol
04:16 PM XXCoder: well first one was in earlier half of 2019, and shipping was quite a bit longer, at 4 months something
04:16 PM XXCoder: so 2021 one was quite a bit faster
04:22 PM Tom_L: how do you read/write a value from/to a tuple?
04:22 PM Tom_L: to me a tuple is just an array
04:23 PM Tom_L: which i would array[2] for the 2nd item
04:24 PM Tom_L: you gotta be careful since some things start with 0 and others 1
04:24 PM XXCoder: I used to know the answer
04:25 PM Tom_L: the command i came up with yesterday for z with the python interface is different
04:25 PM Tom_L: i haven't really had a chance to sit down and look at it much
04:28 PM JT-Shop: Tuples are immutable
04:28 PM JT-Shop: immutable
04:28 PM JT-Shop: An object with a fixed value. Immutable objects include numbers, strings and tuples. Such an object cannot be altered. A new object has to be created if a different value has to be stored. They play an important role in places where a constant hash value is needed, for example as a key in a dictionary.
04:40 PM Tom_L: what a pita
04:40 PM JT-Shop: only use a tuple when you need one
04:41 PM JT-Shop: lists are mutable and indexable
04:41 PM Tom_L: actual_position
04:41 PM Tom_L: (returns tuple of floats) - current trajectory position, (x y z a b c u v w) in machine units.
04:41 PM Tom_L: i think i need that for Z
04:42 PM Tom_L: but i think i can just read that and put it into the tool table
04:43 PM Tom_L: tool_table
04:43 PM Tom_L: (returns tuple of tool_results)
04:43 PM Tom_L: that's not helpful either
04:43 PM Tom_L: tool_offset
04:43 PM Tom_L: (returns tuple of floats)
04:43 PM Tom_L: so where the hell you supposed to set it?
04:45 PM JT-Shop: set the tool table?
04:45 PM Tom_L: i'm not seeing it
04:45 PM JT-Shop: what are you trying to do?
04:45 PM Tom_L: G10 L1 P#<_current_tool> Z#<_z>
04:45 PM Tom_L: that worked great
04:46 PM Tom_L: but i can't use that in python aparently
04:46 PM Tom_L: i want to set the tool length offset for the current tool and write it to the tool table
04:48 PM JT-Shop: you use a mdi command to execute g code
04:48 PM Tom_L: i looked at the axis code but that didn't help me much
04:49 PM JT-Shop: http://linuxcnc.org/docs/stable/html/config/python-interface.html#_code_linuxcnc_command_code_methods
04:49 PM JT-Shop: mdi(string) send an MDI command. Maximum 254 chars.
04:49 PM Tom_L: so ^^^ would work as 'string'?
04:50 PM Tom_L: are those #<_current_tool> & #<_z> visible to python?
04:50 PM JT-Shop: no, you would need to create the string by obtaining the current tool and z
04:51 PM JT-Shop: I don't know but assume not
04:51 PM Tom_L: that's why i was looking at the python commands
04:54 PM Tom_L: c.tool_offset(toolno, z_offset, x_offset, diameter, frontangle, backangle, orientation)
04:54 PM Tom_L: would that read those into those variables?
04:55 PM Tom_L: then build the MDI command from that?
04:56 PM Tom_L: # to find the loaded tool information it is in tool table index 0
04:56 PM Tom_L: if s.tool_table[0].id != 0: # a tool is loaded
04:56 PM Tom_L: print(s.tool_table[0].zoffset)
04:58 PM JT-Shop: in commands.py parent.status.somestatus will return that status
04:58 PM Tom_L: just gets me more confused
04:58 PM JT-Shop: and parent.command.somecommand will execute a command if the right mode is set
04:59 PM JT-Shop: I print(something) a lot to see the return of say a stat
04:59 PM Tom_L: where does the print show up?
04:59 PM Tom_L: in the terminal?
04:59 PM JT-Shop: terminal
05:29 PM * JT-Shop calls it a night
05:29 PM JT-Shop: I fixed F and mdi button
05:30 PM Tom_L: thanks, i'll take a look after supper\
06:26 PM Tom_L: JT-Shop, enter G1X-1 and see what happens
06:27 PM Tom_L: in the Gcode Pad
07:33 PM -!- #linuxcnc mode set to +v by ChanServ
07:33 PM Tom_dev: so what's wrong with this?
07:34 PM Tom_dev: G10 L1 P45 Z 0.009999986000359059
07:34 PM Tom_dev: emc/task/emctask.cc 69: interp_error: bad number format (conversion failed) parsing ''
07:34 PM Tom_L: P is int, Z is float
07:36 PM CloudEvil: https://www.youtube.com/watch?v=awkhVmcxgR0
07:43 PM Tom_L: cute
07:45 PM Tom_L: yay i figured it ou
07:45 PM Tom_L: t
07:46 PM XXCoder: cloud yep that was interesting.
07:59 PM CloudEvil: A number of good points made in the comments to fix the issues.
07:59 PM CloudEvil: One which i thought of while watching was just to ignore the swelling in the middle, and connect the real fence to the edges only.
08:00 PM CloudEvil: But someone else also brought up the possibly better idea of leaving the screw enclosed, and driving the wedge from the end, which is a bit more annoying to make, but a whole lot more rigid
08:03 PM Tom_L: does python allow end of line comments?
08:06 PM Tom_L: appears so
08:09 PM -!- #linuxcnc mode set to +v by ChanServ
08:13 PM roycroft: yes
08:14 PM Tom_L: probably discouraged
08:14 PM XXCoder: why?
08:14 PM Tom_L: i dunno, i never see comments there
08:14 PM XXCoder: line comment is great for specific line comment
08:15 PM Tom_L: i used to comment the sh** out of my code because i knew i'd be looking at it 10 yrs later
08:15 PM XXCoder: I do use comment quite a lot
08:16 PM Tom_L: anyway i got this button/code working
08:16 PM XXCoder: like you said, maybe I would need to read it in future
09:26 PM lcnc-relay: <satiowadahc#0> Pep8 states two spaces, # one space then comment for inline comments