#linuxcnc Logs
Aug 27 2023
#linuxcnc Calendar
02:31 AM Deejay: moin
03:52 AM -!- #linuxcnc mode set to +v by ChanServ
04:09 AM travis_farmer: Morning :-)
04:57 AM rigid: ok, just built & booted the current linuxcnc rpi image to boot on pi4 and it's fairly unusable :-(
04:58 AM rigid: e.g. it's running kernel 4.x and doesn't seem optimized at all.
04:59 AM rigid: It has no USB support so I can't use the UI locally, but remotely EGL and parts of QT doesn't seem to work
04:59 AM rigid: *don't
05:00 AM rigid: what is the most lightweight way to toggle some HAL pins so I can see them on the scope? linuxcncrsh ?
05:04 AM jpa-: halcmd and setp?
05:05 AM rigid: jpa-: thanks, i'll try that
05:09 AM Tom_L: skunkworks, capacitors are the first thing to go on those
05:10 AM Tom_L: i clean ours out once a year due to the cottonwood trees around here
05:17 AM rigid: halcmd says "base-thread" not found. linuxcncsrv is running. do I need to launch something else first?
05:35 AM rigid: do I need to have a DISPLAY configured to run? When I comment out that section from my config (that launches successfully via ssh -Y ...), I get the same error
05:37 AM rigid: hm, nope... "DISPLAY=dummy" gives the same error
05:40 AM rigid: ahh, it is launched in the .hal file. nvm
05:43 AM rigid: oh dear... now I get "Pin 'hal_pi_gpio.pin-04-out' does not exist" :-(
06:08 AM rigid: phew, got dir and exclude masks sorted out. now halcmd works
07:20 AM rmu: rigid: 64bit bullseye with kernel 5.15.65-rt49 seems to work well enough
07:23 AM rigid: rmu: do you build it yourself or did you get it somewhere? https://github.com/remusmp/rpi-rt-kernel ?
07:43 AM rmu: IIRC it is stock debian rt preempt kernel
07:44 AM rmu: linux-image-5.15.65-rt59-v8+
07:44 AM rigid: oh, didn't know one is provided for arm64
07:45 AM rmu: hmm. let me check where i got that from
07:46 AM rmu: rt49 sorry
07:46 AM rmu: don't remember, maybe i cross-compiled that myself, it's been a while
07:47 AM rmu: no it seems i got it from here https://github.com/kdoren/linux/releases
07:48 AM rmu: maybe i did even start with that image https://forum.linuxcnc.org/9-installing-linuxcnc/45212-linuxcnc-on-raspberry-pi-4?start=70#261676
08:02 AM rigid: rmu: yeah, i looked for an official rt kernel for the pi4 and found none. I guess compiling it is the only option
08:03 AM rigid: but for now I'm struggling to even get the official image running as reference
08:04 AM rigid: i'm trying to get a minimal example for toggling one pin as fast as possible. Can anyone see what's wrong with my .hal file? https://gist.github.com/heeplr/ebbc0535d45dc3b9bbb1abe82344a9c9
08:06 AM rigid: i'm using siggen to send values between 0 and 10000 to stepgen.0.velocity-cmd which in theory should toggle stepgen.0.step which is connected to GPIO3 ... but nothing happens :(
08:11 AM rigid: show pin hal_pi_gpio.pin-03-out sometimes shows the value TRUE/FALSE, so it seems it's toggling the pin. But nothing to see on the hardware on no GPIO pin
08:22 AM rigid: rmu: are you using the hal_pi_gpio driver on the pi4? or the hal_gpio one?
08:22 AM rigid: oh, I suppose you don't use GPIO at all but some mesa card
08:38 AM rigid: did anyone ever use the GPIO on the Pi4 successfully?
08:50 AM rmu: rigid: 7c80 mesa card
08:51 AM rigid: ah... yeah wanted to get one but they don't seem available anymore.
08:51 AM rmu: i used to use a self-cooked stm32 based thingy similar to remora, but that was 5+ years ago
08:52 AM rigid: and since the GPIO can do MHz easily, I thought about trying to improve that
08:52 AM rmu: supply chain ripples from the pandemic
08:52 AM rigid: yeah, probably
08:52 AM rmu: gpio on the pi sucks
08:52 AM rigid: yeah, but it's mostly the hal driver implementation
08:53 AM rmu: the rpi3 is history, but that had many strange problems with limited bandwidth to SPI peripheral and uncontrollable changing of SPI peripherals
08:54 AM rigid: yeah, broadcom quirks are not fun. But fast GPIO has been solved by others.
08:54 AM rmu: then the real CPU on the PIs is the GPU, and if it decides to grab the bus the ARM core has to wait, which can introduce latencies, at least on the rpi3 such phenomena kept things "interesting"
08:54 AM rigid: when using DMA, it's quite speedy
08:55 AM rmu: the speed of the GPIO per se is not the problem
08:55 AM rigid: GPU (or VPU for that matter) should be turned off on a realtime system
08:55 AM rigid: ...or used to control hardware via DMA if you're fancy
08:55 AM rmu: you can't turn that off on the pi as it is the "main" thing, e.g. running the ram controller etc...
08:56 AM rigid: afaik you can prevent it from interfering, tho
08:56 AM rmu: the pi SOC is designed for set-top-boxes and "smart" TVs
08:57 AM rigid: it's powerful enough to rt control steppers, tho... i've done that before
08:57 AM rmu: you can make it work with external step generation, no problem, but i wouldn't bother doing it from the pi via GPIO
08:57 AM rmu: just not worth it
08:58 AM rigid: well, current GPIO driver doesn't seem to use DMA, which makes it prone to a lot of problems when timing matters
08:59 AM rigid: also it does some questionable stuff, like getting the port from linuxcnc, using a for-loop to remap each bit, then writing out the mapped port which is quite inefficient just to have real GPIO pin mappings
08:59 AM rmu: DMA to gpio: you would probably have to generate buffers with I/O values that are streamed out int a double-buffer-manner and hope that switchover can be realized with minimal jitter
09:00 AM rmu: as i said i wouldn't bother
09:00 AM rmu: the problem is not cpu or gpio too slow, the problem is unpredictable timing
09:01 AM rigid: you can just mmap into direct access DMA memory, so any write directly reflects to the GPIO port
09:02 AM rmu: yeah. do it. can't be much harder than getting an audio player to work without glitches.
09:02 AM rigid: yeah, I see. but i'd say the timing is not less predictable than any parport on a RT linux kernel
09:02 AM rmu: i wouldn't bother with parport step generation either
09:02 AM rigid: audio is another thing: it's enabled in the kernel of the linuxcnc rpi image
09:04 AM rigid: hm... yeah, maybe linuxCNC is just not suited for directly interfacing a motor driver. hence people did their own software.
09:04 AM pcw--home: The issue typically is not the actual GPIO/Parport access write timing but the generation of consistent rates when running a full OS
09:04 AM rmu: audio is somewhat similar, you want to stream out bytes to the DAC with ~40kHz, and ideally you want perfect switching between buffers, also those buffers should be small enough to not impose big latencies on sound-effects etc...
09:05 AM pcw--home: There are a number of people that have done the DMA streaming step generation scheme
09:06 AM rigid: pcw--home: it's solvable with sufficient tweaking. i.e. don't run X, adjust process nice/priorities, realtime scheduler etc. it's not that 1-2MHz is hard to get steady for a power CPU
09:06 AM pcw--home: but AFAIK none completely succeeded
09:07 AM rigid: rmu: it's not straight forward but it's a solved problem
09:07 AM rigid: pcw--home: no surprise, I attempted it and I'm still struggling to get the current driver output anything :)
09:07 AM rmu: rigid: usually to get somewhat stable and predictable timing, you use a complete cpu core, on the pi some people even "shut down" 3 cores
09:08 AM rmu: rigid: so usually one cpu core is reserved for all the realtime stuff
09:08 AM rigid: rmu: yeah, that's much smarter than put all cores into idle=poll mode like in the current image
09:09 AM rmu: there is an experimental branch that busy-waits for the deadline, that should be more exact, but i don't know if it works reliably or if it is immune to interference from the GPU side
09:09 AM rigid: another thing i'm not sure... halt instruction for idling _shouldnt_ affect latency a lot on modern systems
09:10 AM rigid: hm, at the point of polling the scheduler, you shouldn't use any kernel at all I guess
09:10 AM pcw--home: I do know you cannot have any CPU speed switching (generate ms latencies)
09:37 AM skunkworks: Tom_L: yes - I don't know if those caps were original.. this thing dates to the 80's
09:38 AM skunkworks: I am really torn - I don't want to spend money I don't have - but a 3 unit heat pump would be nice. For this old house..
09:39 AM skunkworks: rigid: I used the gpio on the pi once.. I think The best I got was about 10khz..
09:40 AM skunkworks: (with forceturbo = 1 and such..
09:44 AM rigid: skunkworks: yeah, and 10 MHz are easily possible. absolute max. people have achieved is 60MHz on the Pi3
09:45 AM rigid: (without PWM. With PWM much more is possible where people use it to modulate FM radio using harmonics)
09:45 AM Tom_L: skunkworks, last round i wound up replacing mine because alot of the fins were starting to fall apart
09:45 AM Tom_L: i did manage to get it wholesale
09:46 AM Tom_L: mine was from the early 80's
09:47 AM pcw--home: toggling bits is not the same as generating an accurate frequency without monopolizing the CPU (even the parport can toggle bits at 500 KHz or so) that does not mean you can generate frequencies at those rate independent of what other things the CPU is doing.
09:48 AM skunkworks: right - this is realtime control of the gpio - conistantly consistant..
09:50 AM skunkworks: Tom_L: This is a weird coil setup.. they look like they have tinsel sticking out of each coil.. I am sure it is pretty efficent at removing heat but sure gets plugged up..
09:50 AM Tom_L: right i know what you're talking about
09:51 AM Tom_L: probably miserable to clean
09:57 AM skunkworks: I sprayed it out with a garden hose.. It wasn't too bad.. but I think you really have to take the tin off to clean it effectivly..
09:58 AM skunkworks: (spraying from the inside - to the outside..) not something you can really do with the tin on.
09:59 AM skunkworks: Lol - I forgot the fan granaded last year.. I couldn't find one local so I found one at the shop that was too big and cut the blades shorter.. still running
10:07 AM skunkworks: Tom_L: https://electronicsam.com/images/house/PXL_20230827_145141327.MP.jpg
10:42 AM skunkworks: Tom_L: I unhooked the fan so I could hear the compressor. Pushed the contactor and the compressor would hum for about 2 seconds then it must trip something. So - suprisingly it didn't cook itself..
10:52 AM Tom_L: yeah i've had mine hum a while and i'm sure it got hot but still worked
10:53 AM Tom_L: those fins may be more efficient than the traditional style but i bet a real pita to clean
10:54 AM Tom_L: mine get stuffed full of cottonwood seeds
10:55 AM Tom_L: those would be real tough to get out of yours
11:01 AM skunkworks: we have cotten wood here too - but not near me.. There was a lot of 'hair' clumps on it.. No clue..
11:02 AM skunkworks: It was so packed that the picture I took - was flat that I didn't even know there were coils there.
11:03 AM skunkworks: (it was under where the electrical was - so i thought it was just a tin panel. (it was dark)
11:04 AM skunkworks: (that was when I thought it might be a good idea to clean it.. lol)
11:05 AM skunkworks: oh - there is a date.. 1/89
11:05 AM skunkworks: not as old as I thought
11:09 AM skunkworks: maybe my electic bill will go down a bit now.
11:13 AM Tom_L: should cool down quicker for sure
12:47 PM Unterhaus_: I'm told that FB is faster than the forum for getting wrong answers
12:47 PM Unterhaus_ is now known as Unterhausen
12:48 PM Unterhausen: okay, they didn't say wrong answers, I added that
12:51 PM Tom_L: but you didn't lie
12:53 PM Unterhausen: post was up on fb for hours accumulating wrong answers.
12:53 PM Tom_L: Unterhausen, is everybody an expert on FB?
12:53 PM Unterhausen: there may actually be some experts there, the noise level is awful though
12:54 PM Unterhausen: there are some very technical lcnc users that don't know how to help a newbie, which can be just as bad
12:54 PM Unterhausen: one person told him he was going to have to build fpga firmware himself
12:55 PM Unterhausen: the way fb threads things is incredibly confusing too
12:57 PM Unterhausen: on another note, I think I fixed the large leak problem my cpap was having, but I can't get the data without taking a nap
12:59 PM travis_farmer: silicon caulking cures most CPAP leaks ;-)
01:00 PM -!- #linuxcnc mode set to +v by ChanServ
01:36 PM -!- #linuxcnc mode set to +v by ChanServ
02:56 PM JT-Cave: yo
02:56 PM XXCoder: o/
03:05 PM skunkworks: Unterhausen: I think I know what fb thread you are talking about.
03:06 PM skunkworks: The guy made a haul from an estate sale. A bit of mesa stuff
03:44 PM Unterhausen: yeah, that's the thread
03:56 PM Tom_L: JT-Cave, how was the trip?
03:57 PM travis-farmer is now known as travis_farmer
03:57 PM JT-Shop: nice, 275 Corvettes from C1 through C8 were there and they raised $17k for the local veterans
04:01 PM travis_farmer: $17k is an impressive number
04:07 PM Tom_L: sounds like fun and a good cause
04:10 PM Tom_L: quite a few spectators?
04:10 PM JT-Shop: yeah they were pouring through all day
04:11 PM JT-Shop: I let a young German boy sit in the C8 and start it up... you should have seen his face
04:11 PM Tom_L: was gonna ask what was the furthest away
04:11 PM JT-Shop: I think he was visiting someone there
04:11 PM Tom_L: ahh
04:11 PM JT-Shop: him and his father
04:12 PM Tom_L: C1 in good shape?
04:13 PM JT-Shop: yep they looked like museum pieces so did the C2's
04:13 PM JT-Shop: and lot's of C3's not too many C4's
04:13 PM Tom_L: my inlaw's best friend used to go around with is 55 56 chebys to meets like that
04:15 PM Tom_L: well, i knew him too but not as well
04:16 PM JT-Shop: 75°F here
04:16 PM Tom_L: 88 but i'll take it
04:17 PM Tom_L: better than the 100s we've had
04:19 PM JT-Shop: yup
04:25 PM CaptHindsight: https://github.com/Expatria-Technologies/PicoBOB-DLX
04:25 PM CaptHindsight: https://expatria.myshopify.com/en-us/products/picobob-dlx
04:27 PM Tom_L: bit short on IO
04:28 PM CaptHindsight: https://raw.githubusercontent.com/Expatria-Technologies/PicoBOB-DLX/main/readme_images/IMG_20230304_1730163.jpg
04:29 PM CaptHindsight: LinuxCNC Ethernet to LPT adapter using Remora
04:30 PM CaptHindsight: uses the Servo thread, so no issues with latency on just about anything
04:31 PM CaptHindsight: and good ol LPT pinout for motor drives and switches
04:31 PM Tom_L: bit short on IO for pendant etc
04:31 PM Tom_L: barely enough for limits if even
04:32 PM Tom_L: enables, estop etc
04:32 PM CaptHindsight: hope there are cheap copies made right
04:34 PM CaptHindsight: looks like thy have this in mind for a pendant https://github.com/Expatria-Technologies/RT_Jog_Controller
04:35 PM CaptHindsight: maybe this as well https://forum.linuxcnc.org/18-computer/49156-remora-for-rp2040?start=30#272927
04:35 PM CaptHindsight: lots of USB options for pendants when they use LinuxCNC and we have an OSHW pendant that we're working on as well:
04:37 PM CaptHindsight: https://chicagodist.com/products/rp2040?src=raspberrypi $1ea
04:41 PM CaptHindsight: https://github.com/Expatria-Technologies/Flexi-HAL
06:05 PM fdarling: is anyone in the #linuxcnc channel familiar with the EtherCAT protocol? I would like an explanation of just how PDOs interact with the "sync managers" and the "logical datagrams"...
06:13 PM CaptHindsight: ask on the forums , https://forum.linuxcnc.org/ethercat fdarling
06:22 PM fdarling: CaptHindsight: I have some posts, but I was hoping to talk with someone in realtime so I could pick their brain on some topics.
06:23 PM JT-Shop: I've never seen anyone on here that knows what ethercat
06:23 PM JT-Shop: is
06:29 PM CaptHindsight: fdarling: for some reason, most devs tend to stay away from IRC, some new devs try on Discord then just stick to the forums and mail list
06:29 PM fdarling: the IRC channel is more of a hangout and discussion of cheap CNC builds rather than technical aspects of the LinuxCNC software
06:30 PM XXCoder: theres dev channel
06:31 PM fdarling: it is quite frustrating, because the #linuxcnc channel is flooded with chatter but not much actually about LinuxCNC usage, configuration, improvement, etc. and the #linuxcnc-devel channel is mostly "linuxcnc-build" bot messages, there is maybe 1 message per day from an actual person
06:31 PM JT-Shop: hmm we haven't talked about chickens yet today
06:31 PM fdarling: I really want to improve LinuxCNC but it's hard to get over the learning curve with certain aspects :(
06:32 PM XXCoder: its large scale software so not surpised
06:33 PM JT-Shop: fdarling, when you're talking about something advanced and obscure like ethercat you have to go to where they are and not expect them to come here to please you
06:33 PM pere: fdarling: I would love to see more linuxcnc development talk. :)
06:34 PM pere: fdarling: sadly my linuxcnc attention is rather spotty and in bursts, and my bursts of linuxcnc activity rarely overlap with others burst of activity. :/
06:34 PM fdarling: JT-Shop: I do have posts in several threads about EtherCAT, but no contact with any devs...
06:35 PM fdarling: I have gotten some help from Sebastian Kuzminsky and Peter Wallace, as well as a couple other people
06:35 PM JT-Shop: you might check the source to see who the devs are...
06:35 PM fdarling: I emailed the author of the EtherCAT driver, no response :( I also emailed the website contact of the EtherCAT Master library that it's based off, no response...
06:36 PM fdarling: I posted a job on Upwork/Freelancer/Guru, but most applicants knew very little, so I am just doing the modifications myself
06:36 PM JT-Shop: which is not unusual as people do move on with their life
06:37 PM pere: fdarling: are you involved with igh? I have been told they want to make debian packages for the ethercat linuxcnc integration to make it easier to get started.
06:37 PM fdarling: yes, people move onto other stuff, but the EtherCAT Master library is supposed to be somewhat commercial
06:37 PM fdarling: pere: I know there are unofficial packages for the EtherCAT Master that are used when following the how-to in the forums, but I am not aware of an effort to get them mainlined
06:39 PM fdarling: pere: hey, do you know if EtherLab.org is actually a Beckhoff project? Or is it some other company? I am bit fuzzy with the details
06:39 PM pere: no idea.
06:39 PM fdarling: pere: there is also SOEM, an alternate master library that was commercially backed then released as open source
06:40 PM pere: I do not have ethercat stuff myself, so I have not paid attention to its status. I got Mesa stuff.
06:40 PM JT-Shop: same here no ethercat hardware
06:41 PM fdarling: pere: I usually use Mesa cards, but I am getting tired of wiring so much stuff to drives to get all the functionality (encoder, analog, enable, alarm reset, alarm, servo ready, etc.)
06:41 PM CaptHindsight: Ethercat licensing isn't compatible with the GPL and LCNC
06:41 PM fdarling: I get really good performance with Yaskawa drives in analog velocity mode, however EtherCAT in theory would be more elegant and allow for monitoring more things
06:42 PM CaptHindsight: so that adds an extra layer of difficulty to how you share your work
06:42 PM fdarling: I think using the EtherCAT APIs to interact with the master running on the same PC doesn't have licensing issues, and the EtherCAT master itself is GPL too, however the issue is that EtherCAT is patent and trademark encumbered
06:42 PM fdarling: you are not allowed to make EtherCAT stuff without getting some form of permission (depending on what you are doing / claiming)
06:43 PM CaptHindsight: how wonderful
06:43 PM fdarling: the main issue is that there is not a fully open source EtherCAT slave implementation, for one thing because it requires proprietary ASIC hardware
06:43 PM CaptHindsight: just send money
06:44 PM fdarling: they used to have an FPGA core to implement the proprietary EtherCAT MAC stuff, but I think they stopped offering it in favor of the hardware solutions
06:44 PM fdarling: (I talked with them on the phone at one point)
06:44 PM fdarling: I was interested in making a fully open source EtherCAT FPGA implementation, but they said it would result in a lawsuit :(
06:44 PM fdarling: basically they would have to give permission, and they would refuse to do so
06:44 PM fdarling: they claim it's because they don't want to dilute the ecosystem with poor implementations
06:45 PM CaptHindsight: rodw does quite a bit with EtherCAT but he is in Australia and is never on IRC that I am aware of
06:45 PM fdarling: so the real question is... when do these pesky patents expire? EtherCAT came out in 2004 so I imagine the 20 year mark is coming up soon!
06:46 PM CaptHindsight: I'll ask him and tommylight why they avoid IRC
06:46 PM fdarling: CaptHindsight: I'd appreciate that
06:46 PM CaptHindsight: slow typing is no excuse
06:46 PM JT-Shop: my guess is tommy and rod are in a different time zone so they are usually asleep
06:47 PM CaptHindsight: tommy is somewhere in eastern Europe
06:47 PM JT-Shop: yup
06:47 PM CaptHindsight: so one is just going to bed and the other just got up
06:49 PM CaptHindsight: when was the last time Andy set foot in here?
07:07 PM Tom_L: generally if there are active builds or someone needing help we stick to the topic. however rather than 'dead air' we do tend to stray off with other interests here
08:12 PM CaptHindsight: https://infosys.beckhoff.com/english.php?content=../content/1033/ax2090_bw65/7762992651.html&id=5876641240022047795
08:17 PM CaptHindsight: https://github.com/OpenEtherCATsociety
09:19 PM Unterhausen: I could get $7.50 because my immersion blender isn't made in Austria
09:46 PM roycroft: i only have a few minutes in the shop today, but i was able to do my first semi-precision test cuts with the shaper origin
09:46 PM roycroft: they were successful
11:28 PM * roycroft wonders when fat blue sharpies will finally put the dykem folks out of business
11:30 PM XXCoder: never
11:36 PM roycroft: it may happen
11:36 PM roycroft: fat blue sharpies are the bee's knees
11:36 PM roycroft: all the cool kids use them now
11:37 PM roycroft: i just saw abom use one, so even the not cool old farts are using them now
11:37 PM XXCoder: lol I guess so
11:38 PM roycroft: that box of tools i got last week had a couple starrett 599s
11:38 PM XXCoder: I still have no idea why bees knees is so cool in its era
11:38 PM roycroft: i did not know what they were, and they seemed incomplete
11:38 PM roycroft: i just looked them up, and they are shaper parallels
11:38 PM XXCoder: just looked 9t up. interesting
11:38 PM roycroft: and i was able to locate the missing parts for them in another part of the tool box
11:39 PM XXCoder: 60 buck each
11:39 PM XXCoder: man that box must be secretlt a bag of holding ;)
11:39 PM roycroft: there were a lot of cool tools in it
11:40 PM roycroft: there's a short (4") vernier caliper that has "gift 1953" engraved on it
11:40 PM roycroft: i'm already using it, and it's pretty cool
11:40 PM roycroft: it has inside and outside scales
11:40 PM XXCoder: interesting.
11:41 PM roycroft: i'm just amazed i got the thing
11:41 PM roycroft: the listing was over 2 hours old when i saw it
11:42 PM roycroft: i figure the seller probably got it in an auction lot and did not know what it was
11:42 PM roycroft: if it was from a family estate they would probably have known what the relative did for a living, and would have some sort of sens of the value
11:42 PM XXCoder: yeah
11:42 PM XXCoder: box value must be in thousand+ usd new value
11:43 PM roycroft: but the guy said that people had contacted him and did not want it because the front cover of the kennedy box was missing
11:43 PM roycroft: they must not have looked at the pictures of the contents
11:43 PM XXCoder: yeah
11:43 PM fdarling: in the LinuxCNC framework, within a realtime module's "int rtapi_app_main(void)" function if you call "rtapi_print_msg(RTAPI_MSG_INFO, ...)" where is it supposed to show up?
11:43 PM XXCoder: even if box is rusted all over and fit only for recycle, you got way more value than ypu paid.
11:43 PM fdarling: I have DEBUG set to 3 in the ini
11:46 PM fdarling: (the documentation doesn't make it clear what DEBUG should be set to)
11:46 PM fdarling: https://linuxcnc.org/docs/html/config/ini-config.html#_emc_section