Back
[00:38:07] <skunkworks> another stupid question - how do you run hal commands when axis is running?
[00:39:05] <SWPadnos> halcmd <command>, from a terminal
[00:40:55] <skunkworks> samco@samco-desktop:~/emc2-pluto/bin$ halcmd show
[00:40:55] <skunkworks> RTAPI: ERROR: version mismatch 531 vs 530
[00:40:55] <skunkworks> HAL: ERROR: rtapi init failed
[00:40:55] <skunkworks> halcmd: hal_init() failed: -9
[00:40:55] <skunkworks> NOTE: 'rtapi' kernel module must be loaded
[00:40:55] <skunkworks> samco@samco-desktop:~/emc2-pluto/bin$
[00:41:24] <SWPadnos> do you have run-in-place and installed versions of EMC?
[00:41:28] <skunkworks> yes
[00:41:58] <SWPadnos> then run ". scripts/emc-environment" from the run-in-place version you're using before using halcmd
[00:42:16] <SWPadnos> it's a path problem, I'll bet
[00:43:14] <skunkworks> that worked :)
[00:43:21] <SWPadnos> cool
[00:43:44] <skunkworks> can I actually get into a command line then - so I don't have to keep typing halcmd?
[00:43:56] <skunkworks> man halcmd
[00:43:58] <SWPadnos> halcmd -kf
[00:44:01] <skunkworks> oops
[00:44:04] <skunkworks> ok
[00:44:18] <SWPadnos> k "keeps going" if you make a mistake, f means "use a file for input"
[00:44:21] <SWPadnos> no file means use the terminal
[00:44:24] <skunkworks> sweet
[00:44:48] <SWPadnos> and it even has completion, up-arrow command recall, and wildcards
[00:45:04] <SWPadnos> like show *scale*
[00:47:38] <skunkworks> I see that the auto tune is setup on the pid.. I was just going to see what it did. Althoug I don't seem to be able to make it work yet
[00:47:55] <skunkworks> halcmd: setp pid.0.tune-mode true
[00:48:05] <skunkworks> halcmd: setp pid.0.tune-start true
[00:48:22] <SWPadnos> you also need to set tune-effort, I think
[00:50:34] <skunkworks> 6 float RW 0.5 pid.0.tune-effort
[00:50:39] <skunkworks> set already it looks like
[00:51:06] <SWPadnos> I don't know much about it either ...
[00:51:50] <skunkworks> I know jepler was having problems with it at the fest on JonE's mill
[00:52:24] <skunkworks> When I set tune-mode to true the servo becomes unstalled
[00:52:27] <cradek> I had pretty good luck reading man at_pid
[00:52:52] <skunkworks> but setting the tune-start to true seems to do nothing.
[00:52:57] <skunkworks> Ok - I will look
[00:53:24] <SWPadnos> if it's "done", I think you need to set it false then true to start a new tuning cycle
[00:53:30] <cradek> did you see "If no oscillation occurs, or the oscillation is too small, slowly increase tune-effort."
[00:53:50] <skunkworks> ah - man at_pid doesn't seem to exist
[00:54:03] <SWPadnos> man -M dics/man at_pid
[00:54:08] <SWPadnos> s/dics/docs/
[00:54:14] <SWPadnos> from the emc dir
[00:54:32] <SWPadnos> or man man ;)
[00:55:12] <cradek> it exists for me...
[00:56:18] <cradek> do it in your shell with . emc-environment
[01:02:30] <skunkworks> that worked.
[01:02:59] <cradek> the manpage or the autotune?
[01:03:07] <skunkworks> sorry - man page.
[01:03:18] <skunkworks> It doesn't seem to do anything
[01:03:41] <skunkworks> as I increase the effort - then it just starts spinning no matter what I do.
[01:03:41] <cradek> it did work for me... maybe it has broken since then
[01:04:13] <cradek> strange - jepler reported something like that (axis moved on way forever)
[01:04:17] <cradek> one
[01:05:09] <cradek> when I tried it (quite a while ago) the motor buzzed for about a half second, then it gave me (totally unusable) values
[01:05:17] <skunkworks> :)
[01:05:29] <skunkworks> did you try to increase the effort?
[01:05:33] <SWPadnos> I wonder what happens if you put in a negative effort value?
[01:05:34] <skunkworks> did it change the numbers?
[01:05:51] <cradek> yes it sets the PID values
[01:06:15] <cradek> I think I did have to increase the effort a bit before it would buzz
[01:06:55] <skunkworks> same thing - any thing below -.7 and it just start turning
[01:08:19] <cradek> maybe it's broken
[01:08:49] <skunkworks> darn
[01:11:49] <skunkworks> is this something a bug report should be done for? I am not sure I am doing it right.
[01:11:53] <cradek> although I still think you're probably doing something different from what I did - I don't think it has changed at all
[01:12:10] <cradek> how are you running it?
[01:12:35] <cradek> I think I was using a full running emc with everything hooked up
[01:12:46] <skunkworks> I am just taking the lathe_pluto config and activating the tuning
[01:12:51] <cradek> a little extra allowed following error let it do the oscillation without erroring
[01:12:52] <skunkworks> with axis running
[01:13:00] <cradek> oh ok, I think that's what I did
[01:13:20] <skunkworks> Oh - I have following error set very high ;)
[01:13:55] <skunkworks> I just get into halcmd - set pid tuning mode to true and then the pid tuning start to true
[01:14:17] <cradek> ok I think that's what I did
[01:14:28] <cradek> I think I had to increase effort a few times though
[01:15:07] <skunkworks> the second I increase the effort above .7 - the thing spins whether I have the tune start set to true or false
[01:15:36] <SWPadnos> and feedback is correctly connected to the PID?
[01:15:56] <skunkworks> I assume so - I have tuned it manually
[01:16:01] <skunkworks> pretty decent
[01:16:04] <SWPadnos> hmm
[01:16:27] <SWPadnos> it appears that cvs.linuxcnc.org is down (or detached)
[01:16:39] <cradek> if you set up P only, can you get it to oscillate?
[01:16:40] <skunkworks> using the Ziegler-Nichols method
[01:16:44] <skunkworks> yes
[01:17:00] <SWPadnos> I wonder if it's a +0 / -0 thing
[01:17:27] <skunkworks> I raise p until it oscillates - then get the period of oscolation - then calculate the i and d
[01:17:39] <SWPadnos> it looks for crossings of the starting line, if it thinks it's on the + side at first, and it goes further +, it would never see a cross
[01:25:46] <cradek> SWPadnos: cvs is back
[01:26:07] <SWPadnos> great. thanks
[01:31:41] <skunkworks> yah - I can mess with it but I don't know what it is doing ;)
[01:33:41] <skunkworks> btw keeping the mdi history is really really nice also
[01:45:32] <skunkworks> * skunkworks is just jogging the motor back and forth - back and forth
[02:03:55] <skunkworks> Next time I see petev on I will ask him
[02:11:46] <SWPadnos> wow. concert tickets for Joan Jett, Foghat, and Blue Oyster Cult are $36.75 (one concert, all 3 bands)
[02:12:04] <cradek> whoah, where is it?
[02:12:13] <SWPadnos> about 1.2 miles from me - at the state fair
[02:12:16] <cradek> that sounds really fun
[02:12:18] <SWPadnos> yeah
[02:12:23] <SWPadnos> http://cvexpo.org/default.aspx
[02:12:34] <SWPadnos> Willie Nelson will be there too
[02:12:47] <SWPadnos> (not that I care much about country music)
[02:13:39] <SWPadnos> cool - that includes fair admission too, normally $8 or so per day
[02:14:06] <SWPadnos> ack - $10 this year
[02:14:24] <SWPadnos> well, for the extra $26.75, I may just have to go see the concert :)
[02:15:10] <cradek> heck I'd like to see willie nelson too
[02:15:24] <jepler> cradek: it's a bit far for you
[02:15:27] <SWPadnos> heh. he's enough of an icon that it could be a good show
[02:15:37] <SWPadnos> well, you don't have to drive - no lathe to carry ;)
[02:17:28] <cradek> hmm I sure haven't heard of the rest
[02:17:39] <SWPadnos> only $194 for airfare from Lincoln to Burlington (!)
[02:17:41] <SWPadnos> and back
[02:19:59] <skunkworks> oh yah - so a 440->110 volt 1kva transformer hooked to 110 - gives me 44 volts rectified. and lots of torque on these little servos.
[02:20:57] <skunkworks> * skunkworks was looking a micromills again today.
[02:21:28] <skunkworks> The one steve stallings had at the show was a cool little machine. only 299 from harbor freight,
[02:22:37] <cradek> I'm surprised, it seemed quite decent
[02:22:52] <SWPadnos> note that the 440->110 transformer is still a 9A supply at 110->27.5 VAC
[02:23:03] <cradek> it would be interesting to try to make the best (pcb) engraving machine possible
[02:23:18] <cradek> a 40-50krpm (air?) spindle maybe
[02:24:13] <jepler> yeah and then give it to me for my birthday or christmas or some such excuse
[02:24:17] <skunkworks> routing isolations at 50ipm :)
[02:24:27] <cradek> skunkworks: exactly
[02:24:34] <cradek> you'd need some serious acceleration to do that
[02:26:29] <SWPadnos> yeah - smallish motors, chosen for low inertiua (high accel) would be the best
[02:26:40] <SWPadnos> *inertia
[02:32:07] <skunkworks> http://www.harborfreight.com/cpi/ctaf/displayitem.taf?Itemnumber=47158
[02:34:56] <skunkworks> this motor goes from 0 to 600 virtual ipm in .5 seconds... granted - they have no load. :)
[02:35:53] <skunkworks> that is actually 3600rpm
[02:36:53] <jtr> spindle speeds look funny - you would think the bottom end rpm would be different between the high and low range
[02:37:33] <skunkworks> only 4 inches of travel one direction also - which is a but on the small side. but a nice size table
[02:38:06] <cradek> I'm surprised it can't reach all of its table in Y - seems silly
[02:38:17] <skunkworks> yes
[02:39:30] <skunkworks> that is why one of these is also tempting
http://www.use-enco.com/CGI/INSRIT?PMAKA=201-2536&PMPXNO=953096&PARTPG=INLMK3
[02:39:50] <jtr> that is a nice sized table. The shorter travel keeps you from milling off the clamps. ;-)
[02:41:34] <jtr> (speaking of the harbor freight unit)
[02:52:34] <jepler> "the backlash on those can be measured with a car odometer"
[02:56:16] <skunkworks> ah - it would have to be hit with a ball screw hammer
[03:07:31] <skunkworks> emc definatly need this formula
http://en.wikipedia.org/wiki/PID_controller#Ziegler-Nichols_method not this one PID:Gain=0.6GU, Reset=2/PU, Derivative=PU/8
[03:12:18] <skunkworks> Time for bed - night
[12:55:23] <skunkworks> logger_dev: bookmark
[12:55:23] <skunkworks> Just this once .. here's the log:
http://www.linuxcnc.org/irc/irc.freenode.net:6667/emcdevel/2007-06-21.txt
[13:27:08] <skunkworks> cradek:
http://www.pastebin.ca/581291
[13:27:32] <skunkworks> I thought I had just replied to an email a few days ago on the list.
[13:31:58] <skunkworks> I go to the link that they show in the email - enter our mail server IP address and is says not listed
[13:32:54] <cradek> I did the same thing
[13:33:34] <skunkworks> odd
[13:34:45] <cradek> maybe it's already off the blacklist
[13:36:55] <skunkworks> and hasn't made it back to sourceforge yet?
[13:37:23] <skunkworks> (tried to send this email this morning)
[13:37:32] <skunkworks> it is on the pid autotune.
[13:39:49] <skunkworks> nope - can't reply either. I will talk to our email service :)
[14:19:27] <skunkworks> jepler: had a dream about you last night.. The best I can tell is you where re-shingling a building - and thowing the old shingles at me.. I wonder what that means.
[14:21:02] <cradek> haha
[14:24:17] <jepler> skunkworks: how was my aim?
[14:25:29] <skunkworks> pretty good.
[14:25:31] <skunkworks> :)
[14:30:30] <SWPadnos> I could consult "Zolar's Book of Dreams" for the answer
[14:30:35] <SWPadnos> it has everything
[14:36:48] <skunkworks> I just got the pluto hooked up to a small servo to play with. Cool little board btw - nice work jepler. I hacked the lathe_pluto config as a starting point and did a quick ziegler-nichols tuning session (increase P until oscolates - measure period - calculate P, I and D) That worked great for a newbie like me. I was doing a halcmd show and noticed the auto tune pins. I thought I would give it a try.
[14:36:52] <skunkworks> oops
[14:36:53] <skunkworks> sorry
[14:37:00] <skunkworks> I ment
[14:37:03] <jepler> the board isn't mine, just the firmware :-P
[14:37:14] <skunkworks> http://www.cnczone.com/forums/showthread.php?t=39304
[14:37:29] <skunkworks> right :)
[14:37:32] <jepler> strange that after deciding to get rid of PDM because nobody would need it, I got e-mail this morning asking how to interface pluto to +-10V analog servo amps
[14:38:01] <skunkworks> I thought you decided not to get rid of pdm.
[14:38:41] <skunkworks> the drive and drive is very quiet. pretty cool.
[14:39:03] <skunkworks> god
[14:39:10] <skunkworks> The drive and pluto is very quiet
[14:39:37] <skunkworks> see jane run
[14:40:02] <jepler> I think jmkasunich_ answered this question on the emc-users list:
http://article.gmane.org/gmane.linux.distributions.emc.user/2183
[14:48:25] <skunkworks> There - yes - our mail service had problems
[15:03:14] <cradek> skunkworks: could you write some short instructions about how you did ZN, and which of the ZN formulas is right for emc?
[15:03:27] <cradek> that would make a great wiki page
[15:10:24] <skunkworks> I think alex_joni had wrote one up.. I could not find it. I think it is somewhere on linuxcnc.org/something.
[15:10:39] <skunkworks> not on the wiki for some reason
[15:10:46] <skunkworks> alex_joni: you around?
[15:14:10] <skunkworks> If not - yes I can do that.
[15:53:26] <skunkworks> AH ha
http://www.linuxcnc.org/docs/2.1/html/motion/pid_theory/index.html
[15:54:09] <skunkworks> That is the wrong formula I think - it is the one posted I posted last night. It makes for a very mushy servo
[15:55:40] <skunkworks> THis seems to work a lot better
http://en.wikipedia.org/wiki/PID_controller#Ziegler-Nichols_method
[15:56:26] <SWPadnos> it probably depends on what derivative of position the PID works on (velocity, torque, current, or voltage)
[15:59:35] <skunkworks> again - above my head. :) the last time I did it I used the formula like the one in the docs. I remember having issues with it just not working very well at all. I searched again this time and happened across the wikepedia entry and used that one. It seemed a lot better. - actually was more in line with what cradek had for setting on his lathe.
[16:00:26] <SWPadnos> heh - as long as you can find one that works for you :)
[16:12:24] <skunkworks> P=660 I=37714 D=2.88 vs p=660 I=.0275 D= .004375
[16:14:08] <cradek> yeah, I of .02 can't possibly be right
[16:14:44] <cradek> that's what you get when you follow the emc docs?
[16:15:04] <skunkworks> yes
[16:15:19] <cradek> hmm.
[16:16:00] <skunkworks> my P of oscolation was 1100 this last time and period of .035
[16:16:23] <jepler> I think the pid_theory document was taken from wikipedia .. maybe the formula was just typeset improperly or a mistake was made in transcription?
[16:17:48] <SWPadnos> I don't see how you could have a period of 1100 (or am I misreading that?)
[16:18:07] <SWPadnos> or you need P=1100 to get period = 0.035?
[16:18:13] <cradek> that's the lowest P gain that causes sustained oscillation
[16:18:19] <skunkworks> Yes
[16:18:23] <skunkworks> what cradek said
[16:18:32] <SWPadnos> ok. that sounds like a very high frequency to me
[16:18:34] <SWPadnos> 30 Hz
[16:18:41] <skunkworks> it is. Nothing is hooked to it.
[16:18:44] <cradek> low mass
[16:18:46] <SWPadnos> ok
[16:23:18] <jepler> if you wanted a board to turn a PWM signal into +-10V analog, what kind of power do you imagine you'd hook to the board (e.g., regulated +-V, unregulated +-V, line-voltage AC, or low-voltage AC)?
[16:24:04] <SWPadnos> reasonably well regulated +- 12-15V, if you're using a D/A converter
[16:25:06] <SWPadnos> if you want to make the 0-5V PWM signal into +- 10V, you obviously need some op-amps and other signal conditioning
[16:25:40] <jepler> yeah obviously you ultimately want well-regulated voltages on the board, but I'm asking what kind of supply will be available in the cabinet..
[16:25:42] <SWPadnos> if you want to use PWM+dir (harder, I think there are discontinuities around 0), you still need signal conditioning
[16:25:59] <SWPadnos> ah
[16:26:04] <jepler> I think I understand how to use op-amps to turn up/down PWM into an analog signal, that's not what my question's about
[16:26:10] <SWPadnos> maybe 24VDC
[16:26:38] <SWPadnos> there's +- 12 from a PC power supply, if you don't mind tapping into the motherboard connector
[16:26:45] <cradek> seems like our pid is parallel/non-interacting form, which is not like "standard form" (wikipedia)
[16:26:57] <cradek> I wonder which those ZN formulae assume
[16:28:19] <skunkworks> cradek: I was wondering that also.. But I have not found any info on it yet. Parallel vs series (serial) whatever
[16:30:00] <jepler> SWPadnos: hum, single-rail DC? that's far from ideal..
[16:30:15] <SWPadnos> dual-rail: +/-12V
[16:30:39] <SWPadnos> the 24V supply would need a DC:DC converter to get the -12
[16:30:57] <SWPadnos> (or some isolation - you of course don't want to just use 12V as ground on the board)
[16:31:06] <jepler> if you have +-10V servo amps there must be a negative rail in there somewhere
[16:31:59] <SWPadnos> servo controllers (and drives) can generate their own negative rails
[16:32:16] <SWPadnos> there are single chip isolated DC:DC converters for not too much $$
[16:33:00] <skunkworks> cradek: you should try to do it manaully with your lathe - see what numbers you come up with. (Ziegler-Nichols method and the wikipedia formula)
[16:33:27] <jepler> I think I'll make my board require well-regulated +-12-15 since that's easiest
[16:33:34] <SWPadnos> heh
[16:38:52] <skunkworks> cradek: it looks to me the block diagram on the wiki is the same as the emc pid block diagram .. So maybe that formula is correct.
[16:39:04] <skunkworks> wikipedia
[16:40:00] <cradek> skunkworks: I think the emc pid is "parallel/non-interacting" but I suspect ZN is for "standard form"
[16:40:05] <cradek> bbl, lunch
[17:27:46] <skunkworks> http://arri.uta.edu/acs/jyotirmay/EE4343/Labs_Projects/pidcontrollers.pdf
[17:27:50] <skunkworks> page 39
[17:32:03] <skunkworks> I have not come across the formula that is on the wiki yet.. (which seems to work for me)
[17:33:00] <SWPadnos> page 34 is interesting
[17:33:29] <SWPadnos> Z-N controls well, but tracks reference changes poorly ...
[17:37:55] <SWPadnos> "It is usually recommended that Ziegler-Nichols be used for parameter tuning if 2<KpKu<20"
[17:38:24] <SWPadnos> 0.035 * 1100 = 38.5, so Z-N wouldn't be appropriate for the unconnected motor
[17:40:08] <skunkworks> I saw that :)
[17:40:38] <jepler> mmm good lunch
[18:01:59] <jepler> someone re-wrote the ZN algorithm after we incorporated an older version into our docs:
http://en.wikipedia.org/w/index.php?title=PID_controller&diff=84989250&oldid=83987940
[18:03:25] <skunkworks> The thing is - so far.. I can only find that formula on the wiki. All the other ones are similar to the one in the emc dock.
[18:03:27] <skunkworks> doc
[18:03:42] <skunkworks> odd
[18:13:40] <jepler> this is interesting: If the valve saturates, you will not be able to get Ku. In this case use another method to get Kq ("q" stands for quarter). Adjust the P-only gain until you have quarter-cycle damping. This is a measurement for a second-order, underdamped system. On the response plot look at the first two humps ( the first hump is where the %OS is measured). Kq is the value of Kp that makes the height of the second hump 1/4 the height of t
[18:14:23] <jepler> http://www.calpoly.edu/~fowen/me422/ZieglerNichols.html
[18:15:00] <jepler> this page gives this formula: PID: K = 0.6 Ku; R = 2/Pu; T=Pu/8
[18:16:16] <cradek> I think that would be right for "standard form" pid
[18:17:17] <jepler> our old docs and old wikipedia have the middle term as Pc/2 instead
[18:17:52] <cradek> hm, that's not the same at all
[18:19:08] <skunkworks> there are at least 3 formulas that I have found.
[18:19:17] <cradek> Pc/2 ~ time, where I think we want dimension 1/time
[18:19:42] <cradek> it would be nice to find their original paper
[18:20:10] <jepler> so you think the difference between R=2/Pu and R=2 Kp/Pc is the difference between the series and parallel PID methods?
[18:20:31] <cradek> yes
[18:20:40] <jepler> I can see your point about Pc/2 == time, but I == 1/time
[18:21:25] <cradek> I saw somewhere that ZN did their work with a hydraulic system, and those tended to be series
[18:22:18] <skunkworks> http://arri.uta.edu/acs/jyotirmay/EE4343/Labs_Projects/pidcontrollers.pdf
[18:22:36] <skunkworks> what I posted before - has both parallel and series formulas
[18:23:42] <skunkworks> nothing like the formula on the wikipedia
[18:24:47] <jepler> page 39
[18:24:58] <skunkworks> sorry - page 39
[18:25:00] <skunkworks> ;)
[18:25:24] <jepler> yeah they have I term = .5Tu for parallel and 6/Tu for serial!
[18:26:41] <cradek> * cradek goes back to tuning by gut
[18:27:34] <skunkworks> ;
[18:27:36] <skunkworks> ;)
[18:27:45] <jepler> * jepler goes to eat his dessert
[18:28:11] <skunkworks> * skunkworks ummm goes back to working I guess
[18:49:31] <jepler> original paper:
http://www2.eie.ucr.ac.cr/~valfaro/docs/Ziegler&Nichols.pdf
[18:49:47] <jepler> (must have been typeset again since 1942)
[18:55:10] <SWPadnos> I wonder why all the graphs are curvy
[18:55:44] <jepler> me too
[18:55:55] <skunkworks> It is as artsy as scientist get I guess.
[18:56:17] <SWPadnos> maybe they're air pressure graphs and they wanted them to look like balloons
[18:56:55] <jepler> their parameters are apparently "Sensitivity", "Reset Rate", "Pre-Act Time"
[18:57:19] <jepler> Reset Rate = 2/Pu
[18:57:24] <jepler> (per minute)
[23:50:40] <skunkworks> looks like the little servo will take 11 amps :) poor thing. (that is at 20 volt - what the supply sags to.
[23:51:05] <skunkworks> stole dads clamp on dc amp meter