it's a pity that the kernel folks are actively hostile to the idea of C++ in kernel space.
are you serious?
I only ask because you sometimes seem to be hostile to C++ in any space :)
well that's true too
a class which overrides 'operator=' and 'operator double' would make it possible to write hal code using floats without sacrificing nice syntax like 'out = in * scale + gain'
er, "write hal code using doubles"
there's still the non-blocking atomicity to contend with
but I agree in principle - there are a lot of places where HAL would benefit from c++
sure, you have to *write* the code that goes inside 'operator=' and 'operator double'
it's already relatively strongly typed, and having the compiler help with checking that stuff would be a big bonus
there's supposed to be a "C++ in kernel space" option for RTAI - I don't know how well it works
yes -- I also see that option is present
I also found this but didn't get anywhere useful. http://linux.derkeiler.com/Mailing-Lists/Kernel/2005-09/4806.html
there's a bit of useful information in Sam Ravnbourg's reply
did you see this: http://netlab.ru.is/exception/LinuxCXX.shtml
dear god, it's a huge patch
it looks like it's very "feature-rich", and probably overkill
with RTTI and exceptions ...
it's twice the size of RTAI
er, the adeos patch, that is
whichever - still big
hmmm. when you built the kernel recently, do you recall if you had any of the "pseudo-RT" stuff turned on?
pseudo-RT being Ingo's patches, the "interruptible kernel" option, etc
(I managed to get the kernel build process to run g++, but then you encounter the fact that the linux headers use 'new' as an identifier, and other things that conflict with C++)
[03:08:52] <jepler> http://emergent.unpy.net/index.cgi-files/sandbox/config-2.6.24-12-rtai
yeah - looking at the "using LinuxCXX" page, they have headers to include before and after the kernel headers - I didn't download the patch to look at what magic is done there
looks like I ended up with
ok - I think that means no "kernel is preemptible" setting - I believe that would be the next one "CONFIG_PREEMPT"
voluntary == cooperative multitasking IMO :)
are there #variables that contain the current position?
there should be ;-)
this program moves about 5" to switch from drill to lathe tool
at startup, it doesn't know where it is, so it has to move in Z far enough out to make sure the drill is clear
then move in X to bring the lathe tool on center
then move back in Z to bring the lathe tool to the work
lots of wasted motion, especially since subsequent runs will be parked much closer to where the tool needs to be
so you could make it better if you'd remember to start in a safe spot
if could use if statements to avoid unneeded movement, but still do the moves if I left it in an unsafe spot, IFF I had access to the current position
'current position' is complex because of the various sytems and offsets
my idea of "current position" is the one that, if I issue G0<current_pos>, nothing moves
the definition is simple, computing it might not be
are the "analog inputs" available as parameters?
if so, you can loop positions back to those
(no offsets though)
jmkasunich: I bet you could get current position with a clever probing move
not gonna try that elaboration for this project, its just something that I thought of as I wrote the g-code
damn, its after midnight again
and tomorrow (later today) I'm going to visit family for easter - I may not get to run this until monday
hmm, I dunno what's worse - writing a peck drill loop with O-words, or figuring out how to use the peck drill cycle
"preliminary motion" is confusing
howso? it just goes to "above the hole"
if only the docs were that clear
I've already coded a G0 to "above the hole, at safe height" anyway
all I want is the pecking
G83F0.66 Z<final_depth> R<safe_depth> Q0.05 seems like a start
tiny tiny hole?
but in steel, and I don't have a feel for how it will cut
seems you should be able to go much further than 0.050 per peck (if that's what Q is)
I'll probably increase things on every part till I like it
yeah chips will come out of a drill that big, you shouldn't need to peck much
because I don't have variable spindle speed, my speed and thus my feed is quite slow
it's hard to know how to drill without feeling it cut
speed is set based on the facing
so I start gentle and get more aggressive as I go along
this isn't work hardening material, so I don't have to worry about that
to set up a program for so many, I'd cut one by hand with the tailstock and time it
"Y value unspecified in XY plane canned cycle"
you surely want g18
what is Y on a lathe?
I have G18
maybe I didn't copy the message verbatim
the question is what is the XY plane on a lathe...
you must not have G18 if you got that message
the message said XZ plane, sorry
Y unspecified in XZ cycle?
actually, I bet I can't use G83
if the cycle is in the ZX plane, depth is Y
yeah I'm seeing that now too
so you need to be in G17 to peck Z
as long as I don't to any arcs with the lathe tool (I don't), I bet I can (and need to) set G17
I wonder if it will require a (disallowed) Y word
yep I think it'll work
it loaded anyway
running it with no drill in the chuck first
well thats odd
the retract after the very first peck caused a following error
in which joint?
it started back really quick - but I'd need halscope to see how quick
it should be full rapid
I can do G0s on Z all day, this seemed faster than that
cycles are done in exact stop mode so you may be getting twice the accel you're used to (same as you get when jogging)
if it wasn't 12:39 I'd look into it
cycles on lathe might not be very well tested...
yeah I'm interested to hear what you find.
I have to be showered, dressed, breakfasted, and on the road at 11am tomorrow, so I'm gonna call it a night
(still have to walk the dog too)
jepler: I notice 3 messages while running emc2 TRUNK on sim:
shmctl: Invalid argument
(this is on shutdown, configs/sim/axis, on dapper, configured --enable-simulator)
any ideas what to debug?
EMC: 03alex_joni 07TRUNK * 10emc2/docs/src/config/ini_config.lyx: move RS274NGC_STARTUP_CODE to [RS274NGC], currently it's still valid in the old location aswell
EMC: 03alex_joni 07TRUNK * 10emc2/src/emc/usr_intf/axis/scripts/axis.py: move RS274NGC_STARTUP_CODE to [RS274NGC], currently it's still valid in the old location aswell.
EMC: 03alex_joni 07TRUNK * 10emc2/src/emc/task/emctaskmain.cc: move RS274NGC_STARTUP_CODE to [RS274NGC], currently it's still valid in the old location aswell.
EMC: 03alex_joni 07TRUNK * 10emc2/debian/changelog: note moving RS274NGC_STARTUP_CODE to [RS274NGC]
alex_joni: imo, only one place in the source would cause that exact message to be printed. src/libnml/os_intf/_shm.c:416: perror("shmctl");
alex_joni: you did something to make lyx unhappy
[13:16:48] <jepler> http://pastebin.ca/953878
by the way, I think you should do it the other way around -- prefer the new, documented setting; use the old, deprecated setting if it's not there
looks like your code prefers the old setting
jepler: just finished lunch, pastebin is down for me :(
jepler: I tried to send a emcOperatorMessage() if the [EMC] one is found, but for some reason nothing happened (might be too early in task init), so I left it like this for now
I'll move them the other way around, and add a comment
cradek: does pastebin work for you?
alex_joni: if BJT is seeing a velocity faster than a rapid, it's a bug
I don't think yet another configurable velocity is needed
if his machine can't safely handle a rapid, it's just misconfigured
BigJohnT: hi :)
is this the secret place for developers?
cradek: I think the "yet another configureable velocity" is indeed needed, at least it makes sense for me
poorly-kept secret if so
heh, not really secret .. it's described on the website..
LOL yea if you let me in...
BigJohnT: cradek is right, if your machine moves faster than rapid, we need to fix that
can you try (again) to grab a halscope snapshot when it happens?
I can't prove it but I can try again
ask in here for pointers on setting up halscope :)
ok, I'll have to do it in a little bit
I do know that at vel below about 300IPM it seems to move to home smoother
I have to step out for a bit but will try when I get back
BigJohnT: it's not in the code just yet, I still want to discuss it with JMK before even thinking about submitting it..
alex_joni: he didn't like the idea when I asked before...
maybe you can be more diplomatic than I can...
BigJohnT: well, depends on the reasons to do this
jepler: pastebin is up again, I'll see what that index's problem is
alex_joni: just popped back and I remember from some experiments that I could set the velocity high enough that it would stall the servo during a move to home
but it would still do a G0
EMC: 03alex_joni 07TRUNK * 10emc2/docs/src/config/ini_config.lyx: never ever use index names with _ in them, spaces work fine
BigJohnT_: see the patch above (pastebin.ca/953939)
gotta run for a while now
yes looking at it
I only tested that it still runs on configs/sim, without a special home_vel
me too bbl
alex_joni: you changed ini settings RS274NGC_STARTUP_CODE
I've searched source code to find where to put settings like RS274NGC_START_CODE and RS274NGC_STOP_CODE
and no success
little help ?
micges: you mean things that get executed before and after a program?
I'm not sure how to do that..
especially the after a program part is tricky
once you found M2/M30 or whatever, you can't send any more g-codes
you need to switch to MDI to do that
I think what you want is to wait until lerman allows overloading G and M codes
then redefine M2 to include you needed calls
any info about lerman works?
use a named subroutine, and change the program end to OM2
have a file called m2.ngc in your nc_files dir, with the needed codes, plus an M2
that should work in TRUNK now
ok this is on end of code
but what about after pressing escape ?
that's a different thing
and wouldn't work this way :)
micges: then the place you need to put it is in emctaskmain.cc
but I still can't see how exactly you can accomplish that..
micges: what kind of codes do you want to set?
for now one G0 and M50 or M52
hmm.. G0 will be tricky after an abort
and it seems M50 and M52 are unnecessary when the machine isn't running
though they do affect MDI as well
I think they do anywat
those are various overrides.. right?
* alex_joni is too lazy to look them up
yes, adaptive feed and FO
* SWPadnos just loked them up :)
and I didn't get a nice cheat sheet
I used the in-tar-web
point is that machine in program run in "quite complicate mode" and operator want to stop it and check result (which must be done by move machine manually and cant be done in "quite complicate mode") and after that restore executing program from stopped point in state before hitting escape
then auto->manual switching must have disabling some hal modules and so on
and some M codes too
well, it could be simple, but I don't think so
there is a function that runs when an abort or restart occurs - you could probably change that to run some G-codes when thoseevents occur
(different functions for abort and start, of course)
what function you talking ?
I don't know the name :)
but there are functions that get called to deal with any NML messages, and to issue commands to IO and motion (and the interp)
so somewhere there's a line like "case EMC_ABORT_TYPE:" (or similar), with the code to handle an abort
could be a longer/different name, like EMC_INTERP_ABORT_TYPE ...
they are in emctaskmain.cc
but.. I don't see how you can send g-codes at that state
the interp is stopped, aborted
so you'll have to trigger a MDI change
and send them through MDI
it shouldn't be yet - it should be "aborting" ...
yes that will be before abort
// clear out the pending command
emcTaskCommand = 0;
you *could* hack it with some commands after interp_list.clear()
I see this
you would need some way of letting those commands finish before setting the interp state idle though, I think
EMC_TASK_PLAN_RUN is the one sent when a user wants to run a program
(this is in src/emc/task/emctask.cc, in case you're looking for it :) )
ok I found important places
I saw that RS274NGC_STARTUP_CODE is executed by interp.execute command
can I use it after abort and before reset emc state ?
just got back
how do I use the patch you did for me?
patch -p1 < file.patch
me too (using alex idea for hacking emc task)
you need to be in src/ for that
I searched and only found info on submitting a patch
and adjust p1 to some other number if it doesn't work (like p0)
after I patch just run emc?
you need to compile first
I kinda thought so
src in my emc2-trunk directory?
do I need to copy the patch file to src and name it something special?
you need to be in src/ and use patch -p1 < /path/to/file.patch
that makes sense
* BigJohnT reading man patch to understand -p
alex_joni: putting interp.execute() in fubction emcTaskAbort()
after clearing interp list working, but only for Gcode that is executed immadietly (all moving gcodes not working)
micges: that's what I would have expected
alex_joni: I think that this is very usable , what you thinking ?
dunno, you said you want G0 in there..
yes but working M52 is half of my success
fenn said that G0 can be done somehow in HAL
yes, but it's a Bad Idea
no, it's really a *BAD IDEA*
ok I get It :)
alex_joni: I managed to get the patch done
and made notes on how to do it...
BigJohnT: cool, if it even compiles it's even better
fenn: hackish G0 moves in HAL is a bad idea imo
I checked each file to be sure the patch was applied
how do I compile it?
BigJohnT: it would have said if something failed
BigJohnT: go to src/ and type make? like usually?
ok, I haven't compiled a program in many years...
hmm.. I thought you have emc2 compile set up already
you need to run configure first
go to src/ and type: ./configure --enable-run-in-place
then sudo make setuid
(but ./configure will probably fail ..)
alex_joni: yep, keep motion commands coming from one source
BigJohnT: what's the last few lines?
did it say everything is ok, and you should run make?
configure: error: version.h not found - Is the kernel headers package installed ?
well.. as long as you have error's in there, it didn't work :P
try: sudo apt-get build-dep emc2
checking /usr/src/linux-headers-2.6.15-magma/include/linux/version.h usability... no
that should load a couple of needed things.. might take a while though
EMC: 03alex_joni 07joints_axes * 10emc2/src/emc/ini/iniaxis.cc: test branch creation
EMC: 03alex_joni 07joints_axes * 10emc2/configs/scara/ (scara.ini scara_sim_4.hal): scara config - doesn't run atm, but eventually the code should support such a config
BigJohnT: configure works ?