#linuxcnc Logs
Sep 21 2023
#linuxcnc Calendar
01:29 AM Deejay: moin
03:43 AM travis_farmer: Morning :-)
03:58 AM rigid: i suppose those cheap GRBL controllers that come with china CNCs don't integrate with linuxcnc easily, right?
03:59 AM travis_farmer: not at all
03:59 AM rigid: travis_farmer: tnx
03:59 AM travis_farmer: np
04:00 AM rigid: would be cool if they could be combined tho... if i'm not wrong, linuxcnc could flash another firmware and just use them as something like cheapo "USB attached mesa cards"
04:01 AM rigid: (if the controller supports dfu)
04:01 AM Tom_L: if pigs could fly
04:02 AM rigid: well, not with THAT attitude ;)
04:02 AM Tom_L: just saying... something that likely will never happen
04:03 AM rigid: Tom_L: why? am I missing something here?
04:03 AM rigid: the stuff i've seen is usually some low-end 32-bit or beefier 8-bit MCU + drivers + power supply. nothing special
04:04 AM Tom_L: machine kit was an effort for imbedded... do you hear much about it now?
04:05 AM rigid: why did it fail?
04:06 AM rigid: i was thinking more about adding another driver. didn't think about a fork.
04:07 AM jpa-: rigid: https://github.com/scottalford75/Remora this stuff works on some of the higher end cards, but not for the cheapest grbl boards
04:08 AM rigid: jpa-: aah, someone posted that here already. I didn't make the connection to use it as firmware for those boards. thanks.
04:09 AM jpa-: AFAIK linuxcnc doesn't support the mesa cards through USB either - realtime USB is tricky
04:09 AM XXCoder: if you want really cheap you can always go for BOB and drivers to run a cnc
04:10 AM XXCoder: honestly MESA barely costs more.
04:10 AM jpa-: it will also depend a lot on what you are aiming for - there are many ways to hack together an open-loop stepper machine, but once you want to have actual benefit from linuxcnc realtime functionality it gets a lot harder
04:11 AM rigid: XXCoder: i didn't mind about the price aspect but more about combining existing hardware. like those things are abundant and it'd be nice to integrate them in a linuxcnc driven environment.
04:12 AM XXCoder: looks like no for now. dunno on future
04:13 AM jpa-: because a stepper machine doesn't really care whether there is some delay in outputting the pulses, as long as the correct amount gets eventually sent; one could send e.g. the klipper protocol from userspace HAL component through USB to the klipper firmware (which does run on those cheap grbl boards)
04:13 AM jpa-: this would work fine as long as you don't need closed loop behavior, but even probing would already need some hack or to run slowly
04:14 AM CloudEvil: Surely only in the case that you're at all times running the machine below its maximum step-in/out rate, otherwise it'll lose steps on pauses.
04:14 AM CloudEvil: And almost no useful machines are operated this way
04:15 AM rigid: i see... but it WOULD be nice to get those cheap open-loop devices up-and-running with a new toolchain
04:15 AM jpa-: CloudEvil: klipper buffers a bit to avoid those pauses
04:16 AM jpa-: which is why there will be latency that messes up probing
04:16 AM rigid: CloudEvil: yeah... there seems to be a gradient spectrum between "cheap hobby stuff" and "high end industrial stuff"
04:16 AM CloudEvil: ah
04:16 AM zyp: jpa-, I'm not sure realtime USB is all that much harder than realtime ethernet
04:17 AM jpa-: zyp: i'm not sure either, but i think it hasn't been done in linuxcnc yet, so hard to know
04:17 AM rigid: iirc ISO modes are used for realtime USB. never touched them tho. I believe there is no aspect in low-level USB development that isn't annoying af :)
04:17 AM jpa-: zyp: how does the realtime ethernet currently work, does it need reserving the whole NIC for realtime stuff or does it co-operate with other uses?
04:18 AM zyp: pray and hope for the best, I believe, at least that's what my stuff does
04:18 AM jpa-: :)
04:19 AM rigid: i recently saw tham ethernet hardware packet timestamping thing in the linux kernel.
04:19 AM rigid: *that
04:20 AM zyp: realtime USB should work pretty well if you could sync the processing loop to the usb framerate, but I'm not sure there's any APIs for that
04:21 AM jpa-: even the 1ms unpredictability wouldn't be a showstopper for low demand purposes, but that still requires being able to communicate directly in kernel space instead of going through userland
04:22 AM rigid: zyp: "Isochronous transfers occur continuously and periodically. They typically contain time sensitive information, such as an audio or video stream." https://www.beyondlogic.org/usbnutshell/usb4.shtml#Isochronous
04:22 AM jpa-: but indeed for running a servo loop, you'd want to sync up linuxcnc threads to USB frames, or USB frames to linuxcnc threads
04:22 AM zyp: rigid, isochronous is fixed rate, which is not the same as low latency
04:22 AM rmu: "realtime USB" should be possible given that a bunch of USB audio stuff exists that also is somewhat "realtime" sensitive. the thing is nobody did it and it is questionable how reliable it will be. USB host controllers allegedly all have weird bugs
04:22 AM rigid: zyp: it's bounded latency
04:23 AM rigid: what rmu says. it's probably a nightmare to implement it
04:23 AM jpa-: rigid: the main problem is not the USB protocol itself, but getting access to USB from linuxcnc realtime threads in linux kernel
04:23 AM rmu: preempt-rt with usb should work just like ethernet, but somebody has to dive into it
04:23 AM rigid: ah
04:23 AM jpa-: especially as modern USB host chips do a lot of scheduling stuff by themselves
04:24 AM rmu: you would just use userspace usb APIs, that is probably not really the nightmare
04:24 AM zyp: I should try it some time, I have all the building blocks already
04:24 AM rigid: rmu: the nightmare is on the firmware side
04:24 AM rmu: but i guess one would need an usb analyzer and experience how stuff on USB looks like
04:25 AM rigid: but I could imagine there are decent reference implementations by now
04:27 AM rmu: when finished somebody has to deal with all kinds of weird user support where a wireless usb mouse plugged in on another port on the same usb controller wakes up and causes the machine to stop and stuff like that. nightmare.
04:28 AM zyp: I've already got other stuff doing USB on FPGA, and I've got FPGA stuff talking ethernet to linuxcnc, so it wouldn't be hard to put the two things together
04:28 AM zyp: and then it's just a matter of replacing the raw socket calls on the host side with a couple libusb calls
04:29 AM rmu: latency / buffering for isochronous audio applications can't be that high or you would notice.
04:30 AM zyp: I figure since it's impractical to sync to the USB framerate, the most reasonable solution is just a pair of bulk pipes
04:30 AM CloudEvil: USB2/3 can have much greater transaction rate than 1KHz IIRC
04:31 AM CloudEvil: But it's complex
04:31 AM zyp: transaction rate is something other than framerate
04:31 AM sensille: 125us?
04:31 AM zyp: yes, USB2 has a 8kHz microframe rate
04:31 AM CloudEvil: And it needs all of the bits in the stack to be working together to not get bigger jitter than that
04:32 AM zyp: I figure it's easier to just use bulk transactions, they'll be delivered ASAP
04:32 AM CloudEvil: Probably on an idle bus
04:32 AM zyp: that's the P in ASAP
04:32 AM * CloudEvil wishes USB3 transaction translators were a thing again
04:33 AM zyp: no, you don't, that'll just give you two layers of impredictable latency instead of one
04:33 AM CloudEvil: I don't specifically mean for this app
04:34 AM rmu: do those cheap grbl things support high speed? don't think so
04:34 AM jpa-: having a dedicated USB host controller for realtime stuff doesn't sound too limiting, at least on desktop systems
04:34 AM jpa-: that should ensure free-enough bus
04:35 AM jpa-: rmu: those simple grbl boards are limited enough that klipper-style buffering can deliver pretty much all value they have to offer anyway.. one is not going to do servo loops or spindle sync or anything like that with those
04:36 AM rmu: but then why bother with USB at all
04:36 AM rmu: (for linuxcnc)
04:36 AM jpa-: indeed
04:37 AM rmu: ethernet is much nicer, gets you galvanic isolation "for free", and distance between control-PC and hardware is practically unlimited
04:37 AM jpa-: quite a lot of work for little benefit if there is a slow atmega board in the middle.. but mesa or other fpga board with usb could make sense, though it still has little benefit over ethernet
04:38 AM jpa-: (only benefit i can think of is cost difference, but ethernet hardware is just a few dollars more than usb hardware)
04:39 AM rmu: a few $ don't make any difference on a "real" CNC machine IMO
04:39 AM jpa-: i agree
04:39 AM rigid: jpa-: yeah, the only advantage would be that USB stuff is ubiqutously available. a lot of people already have it sitting around somewhere
04:39 AM jpa-: once the endmills start flying, a 100 USD mesa card is a trivial cost ;)
04:40 AM rmu: hehe.. not to speak of a crashed spindle....
04:40 AM jpa-: rigid: i do think that for really low-end stuff, having linuxcnc component to interface with klipper firmware would be useful and not hard to do
04:42 AM rmu: it could be possible to sync on USB framerate of 1kHz and achieve update period of 500Hz assuming one frame PC -> controller and one frame controller -> PC, 500 Hz should be enough for low-end machines.
04:43 AM zyp: rmu, with bulk transport, both would likely fit in a single frame without issue
04:43 AM rmu: can you talk bidirectional on USB?
04:44 AM jpa-: sure, you can transfer a bunch of packets per frame
04:44 AM zyp: frames != transactions
04:44 AM jpa-: frames are just the polling interval for asking the device "do you have anything to send"
04:44 AM zyp: nope
04:44 AM zyp: bulk endpoints are polled much faster than the framerate
04:44 AM jpa-: or do FS bulk endpoints get polled faster than that?
04:44 AM jpa-: ok
04:45 AM zyp: basically whenever the host controller isn't doing anything else, it's filling the idle time with polling outstanding bulk transfers as long as it's got any
04:46 AM JT-Cave: morning
04:46 AM rmu: ok. my superficial knowledge of USB needs improvement ;)
04:48 AM zyp: we've got a MPCNC running klipper at the workshop I'm sharing with friends, I've considered trying linuxcnc on it, and it'd be kinda convenient if I could do so without replacing hardware
04:57 AM Scopeuk: Klipper is odd, essentially it reduces the controler to a super dumb endpoint that is given a queue of time stamps and assert/deassert pin instructions (there is hardware pwm support also iirc). Someone has a bare endpoint for host/target example, possibly annex?
04:58 AM Scopeuk: https://github.com/Annex-Engineering/windlass
04:58 AM Scopeuk: All the klipper usb Comms is emulated uart anyway from what I remember
05:32 AM rmu: a useful starting point would be remora IMHO
05:33 AM rmu: replace SPI comms with USB and see where that leads to
06:33 AM pere: any volunteers around able to bring more documentation languages up to 2% translated on <URL: https://hosted.weblate.org/projects/linuxcnc/linuxcnc-docs/#translations >? Once <URL: https://github.com/LinuxCNC/linuxcnc/pull/2649 > is merged, this will allow the translations to show up on the web again.
06:47 AM JT-Cave: rooster just crowed
08:43 AM Scopeuk: Remora has a bunch of 3d printer boards as targets already by the looks of it
08:46 AM Scopeuk: Looks to already have uart integrated but only for debugging
08:54 AM Scopeuk: Thernet control branch tool, very intersting
11:21 AM travis_farmer: ...had to send a message to my med doc... been having little to no energy for days, with greater irritability. not a good setup when i want to work on my machine...
11:27 AM * roycroft has a new primary care physician, and has his first appointment with her next month
11:27 AM roycroft: i'm looking forward to that
11:28 AM travis_farmer: looking forward?
11:29 AM roycroft: yes, there are some things i need taken care of so i'm healthier
11:29 AM roycroft: some of which require a doctor
11:29 AM travis_farmer: ahh, i see. couldn't tell if it was sarchasm
11:30 AM roycroft: no, i seriously am looking forward to it
11:31 AM travis_farmer: these IRC disconnects are annoying...
11:33 AM travis_farmer: i had one a while back... she took me off a med, and now i have no energy. had to message her and let her know
11:34 AM roycroft: tonight is opening night for the eugene symphony
11:35 AM * roycroft can use a nice, relaxing concert after what he's gone through recently
11:35 AM travis_farmer: if i thought my truck would make it, i would join you
11:56 AM roycroft: today is the deadline to register to vote for our board election, and so far i've received no membership applications
11:56 AM roycroft: yesterday i got a dozen late at night - i wonder if folks somehow thought the deadline was yesterday
11:58 AM * roycroft needs to reboot his imac, which will take a while, and thinks it's a good time for a coffee break
03:17 PM Tom_L: is a joint following on a stepper system (mesa) typically a velocity or acceleration problem? or a combination of both?
03:18 PM Tom_L: s/joint following/joint following error
03:26 PM rmu: misconfiguration. joint speed/acceleration larger than step speed/acceleration.
03:27 PM Tom_L: stepgen_maxaccel is 2x max_acceleration
03:28 PM Tom_L: stepgen_maxvel isn't used (set to 0)
03:38 PM travis_farmer: my ini says:
03:38 PM travis_farmer: # The values below should be 25% larger than MAX_VELOCITY and MAX_ACCELERATION
03:38 PM travis_farmer: # If using BACKLASH compensation STEPGEN_MAXACCEL should be 100% larger.
03:38 PM travis_farmer: STEPGEN_MAXVEL = 4.379921
03:38 PM travis_farmer: STEPGEN_MAXACCEL = 20
03:39 PM Tom_L: iirc peter told me to set stepgen_maxvel to 0
03:40 PM travis_farmer: i don't know, just going by the notes in my ini...
03:40 PM rmu: stepgen_maxvel set to zero probably means unlimited
03:40 PM Tom_L: just every now and then i get a following error. not often
03:41 PM Tom_L: just trying to pinpoint it
03:41 PM rmu: (limited only by mesa fpga frequ or base thread)
03:41 PM Tom_L: servo thread
03:41 PM rmu: the fast thread in case you are software stepping
03:41 PM travis_farmer: i also have: FERROR = 0.5 (related to following errors)
03:42 PM Tom_L: my ferror is 0.050 per axis
03:42 PM Tom_L: min_ferror is 0.005
03:56 PM Tom_L: travis_farmer, FERROR is the maximum allowable following error, in machine units. if machine units are inch would yours be 1/2" ferror?
03:57 PM Tom_L: that's how i read it anyway
03:57 PM Tom_L: unless your mm
04:03 PM travis_farmer: it was mm, then i changed to inch... perhaps i better change that...
04:03 PM Tom_L: well, i doubt you'd get following errors :)
04:03 PM travis_farmer: no, i don't :-)
04:04 PM Tom_L: wasn't picking on you, just trying to figure the docs out on all this
04:04 PM travis_farmer: i know
04:05 PM Tom_L: it's not critical for me.. it rarely happens but it's irritating when it does
04:06 PM travis_farmer: any error is irritating, when running something. :-)
04:07 PM roycroft: well today's good news is that a service i've been managing for the past 15 years is shutting down at the end of the month
04:07 PM roycroft: that means no more after-hours work for it
04:08 PM roycroft: the bad news is that i'm used to 6-8 hours ot/month doing that after-hours work, so my paycheck is going to be smaller
04:08 PM roycroft: but the days of regularly-scheduled 5am maintenance windows for that service are over
04:08 PM travis_farmer: smaller like my paycheck? ;-)
04:09 PM roycroft: it will be about $300/month smaller :(
04:09 PM Tom_L: you're loaded anyway :)
04:09 PM * roycroft needs it to be about $1k/month bigger
04:09 PM roycroft: no
04:09 PM roycroft: t
04:09 PM travis_farmer: :-(
04:10 PM XXCoder: my monthly income is 3 digits. fun!
04:10 PM travis_farmer: loaded with wisdom
04:10 PM XXCoder: my monthly cost is 4 digits. even more fun lol
04:11 PM travis_farmer: i make barely enough to pay "some" bills
04:13 PM XXCoder: im been living on savings for couple years now, most of it just the difference
04:14 PM XXCoder: just so damn glad I had 300 hours of vacation
04:16 PM Tom_L: i make 6 figures.... if decimal places count :)
04:16 PM XXCoder: my income is infinite figures ;)
04:17 PM travis_farmer: on my last taxes, it said i made 11K, with very part-time work
04:20 PM rmu: Tom_L: https://forum.linuxcnc.org/38-general-linuxcnc-questions/36464-joint-following-error-on-stepper-system
04:24 PM Tom_L: i was looking at that.. thanks
04:33 PM roycroft: my income is 8 figures, in yen
04:36 PM XXCoder: my income is 5 figures, in ruble
04:36 PM XXCoder: nothing like other currancies to make income look big
04:37 PM Tom_L: won
04:38 PM Tom_L: $100 = 133,967.00 won
04:38 PM XXCoder: my income is 7 figures in won. fancy
07:44 PM XXCoder: roycroft: got email from patreon for clicksporing?
08:05 PM roycroft: no, but i got one for uri tuchmann today
08:05 PM roycroft: i haven't had time to watch it
08:05 PM roycroft: and i won't until much later
08:05 PM XXCoder: its long form video, and excellent one
08:06 PM roycroft: oh, wait
08:06 PM roycroft: i just got it from clickspring
08:06 PM roycroft: more time i don't have :)
08:06 PM XXCoder: :)
08:06 PM XXCoder: time, money or energy, choose one ;)
08:33 PM roycroft: tonight is opening night for the eugene symphony
08:33 PM roycroft: i'm choosing to go there vs watch youtube videos
08:33 PM roycroft: i'm comfortable with my choice