#emc-devel | Logs for 2006-04-28

[00:24:31] <jmkasunich> rayh, alex_joni you guys still around?
[00:30:35] <rayh> I'm here.
[00:30:42] <rayh> Good to see you.
[00:30:48] <jmkasunich> saw your discussion about halui
[00:31:05] <jmkasunich> (debate whether it should be in [IO] or [HAL]
[00:31:16] <rayh> What do you think?
[00:31:23] <jmkasunich> got a question, then I'll tell you what I think
[00:31:31] <rayh> okay
[00:31:43] <jmkasunich> EMC1 supported multiple GUIs at the same time, right (multiple operator stations)?
[00:31:55] <rayh> Yes it does.
[00:32:08] <jmkasunich> how do you specify that in the ini?
[00:32:10] <rayh> I've mixed AXIS with others and they almost play nice.
[00:32:32] <rayh> Oh. You just start emc with one and then add the other by terminal.
[00:32:38] <jmkasunich> oh....
[00:32:50] <rayh> NML has the ability to find it's soul mates
[00:32:58] <jmkasunich> IMO, running halui is just like running a second GUI
[00:33:17] <jmkasunich> you got your graphucal UI, and you got your pushbotton UI
[00:33:57] <rayh> Right.
[00:34:00] <jmkasunich> so I don't think it halui should be in the hal section or the io section....
[00:34:40] <jmkasunich> it should be in the display section (which should support the general concept of multiple UIs, not just TkEMC+halui, but also TkEMC + mini, or any other combination
[00:34:42] <rayh> Okay. We've got a three way flip.
[00:35:28] <rayh> Somewhere in the graphical section reader we'd have to expand to allow multiple.
[00:35:35] <rayh> But that shouldn't be all that bad.
[00:35:54] <jmkasunich> smop, as cradek would say (simple matter of programming)
[00:36:06] <jmkasunich> IF we agree that's the right approach
[00:36:10] <rayh> No doubt somebody can do it.
[00:36:57] <rayh> One thought though. As I was playing with halui i found it maddeningly like tickle.
[00:37:18] <rayh> Not that that is bad but suppose you want to toggle machine on.
[00:37:58] <rayh> You would have to connect the variables through classic ladder.
[00:38:14] <jmkasunich> halui is very much a work in progress
[00:38:22] <rayh> No different in nature from emcsh.
[00:38:26] <jmkasunich> one that has no real spec for what its supposed to do
[00:38:32] <rayh> so there are real similarities.
[00:38:54] <jmkasunich> well, emcsh is basically tcl<->NML
[00:39:02] <rayh> Right.
[00:39:03] <jmkasunich> halui is hal<->NML
[00:40:17] <rayh> I guess I assumed IO because it has estop similar to iocontrol
[00:40:27] <rayh> and it makes pins that can be connected to real world.
[00:40:43] <jmkasunich> no, it has estop that is like the button on tkemc/mini/axis
[00:41:01] <jmkasunich> estop was probably not the best choice as the first thing to implement
[00:41:19] <rayh> I guess I was afraid that if it was in HAL, I'd have trouble explaining it to integrators.
[00:41:28] <rayh> It's already in there.
[00:41:40] <jmkasunich> like I said, halui is evolving
[00:41:58] <rayh> Yep.
[00:42:16] <jmkasunich> if it was up to me, the first function I would have implemented would probably have been jog
[00:42:42] <rayh> cycle start for me. emc_run.
[00:42:58] <jmkasunich> ok, that works
[00:43:07] <rayh> only because I have one of those buttons on the mazak.
[00:43:35] <rayh> But like alex said, most all of the NML connector is already in there.
[00:43:35] <jmkasunich> I haven't looked at halui at all
[00:43:43] <jmkasunich> is it based on emcsh?
[00:43:51] <jmkasunich> (that would have been my approach)
[00:44:02] <rayh> You can start it if you add [HAL] HALUI = halui
[00:44:11] <jmkasunich> I don't want to start it
[00:44:15] <jmkasunich> I want to understand it
[00:44:15] <rayh> and update the run script.
[00:44:33] <rayh> Oh. That's the way that I prefer to discover what stuff looks like.
[00:44:34] <jmkasunich> ie. "can I add cycle start to it in less than two hours" ?
[00:44:45] <jmkasunich> I need to see the source to know if I can change it
[00:44:48] <jmkasunich> looking now
[00:44:54] <rayh> I understand our different approaches.
[00:45:24] <jmkasunich> alex did base it on emcsh
[00:45:34] <jmkasunich> let me see what would be involved in adding cycle start
[00:45:56] <rayh> Yes I think he had planned the same sets of commands.
[00:46:02] <jmkasunich> cycle start is _not_ the F2 machine on, right?
[00:46:18] <jmkasunich> its more like "run g-code program"?
[00:46:22] <rayh> No it only works in auto mode and is emc_run
[00:46:51] <jmkasunich> ok. looks like alex was going to call that hal pin halui.program.run
[00:46:54] <rayh> Some machine tools use it for some manual operations as well.
[00:48:00] <rayh> I really can't say that I like the names with the dotted last elements.
[00:48:01] <jmkasunich> is "sendProgramRun" the NML message?
[00:48:17] <rayh> I don't know.
[00:48:37] <jmkasunich> what does tkemc send to emcsh when you want to start a cycle?
[00:49:59] <jmkasunich> "emc_run"?
[00:51:49] <rayh> yes and the line number to start on.
[00:51:57] <rayh> it assumes 0
[00:52:00] <jmkasunich> ok, theres the first design issue
[00:52:08] <jmkasunich> a cycle start button can't generate a line
[00:52:20] <rayh> right
[00:52:56] <rayh> This panel you gave me has cycle start and cycle stop.
[01:35:19] <cradek> hi guys
[01:35:26] <jmkasunich> hi
[01:35:44] <rayh> hey.
[01:36:18] <cradek> rayh: do you know if I need an optoisolator or something between that speed control and whatever I rig up on my parallel port?
[01:36:42] <jmkasunich> going for variable speed spindle?
[01:36:49] <cradek> yeah I want to work on constant surface speed
[01:37:03] <jmkasunich> thats non-trivial ;-)
[01:37:18] <rayh> You'll need to replace the pot with that interface card.
[01:37:21] <cradek> you mean the hardware or software?
[01:37:27] <jmkasunich> the software
[01:37:29] <cradek> rayh: that's already done
[01:37:37] <rayh> Then you will need some way to integrate pwm from the parport into 0-7 volt.
[01:37:42] <jmkasunich> making a hal variable control the motor speed is a smoh
[01:37:45] <cradek> jmkasunich: afaict, spindle speed ~ r ~ x
[01:38:02] <jmkasunich> but r = x + c
[01:38:11] <jmkasunich> where c is a tool offset, and is unknown
[01:38:14] <cradek> sure
[01:38:33] <jmkasunich> and in fact varies depending on tool shape and feed direction
[01:38:36] <cradek> so i could call it absolute 0, or use an offset, or something
[01:38:50] <jmkasunich> 2D tool offsetting is the other major issue for lathe
[01:38:55] <rayh> Is there a number or model name on that extra spindle drive card, cradek?
[01:39:02] <jmkasunich> once that works, CSS itself is almost trivial
[01:39:13] <cradek> I'll go downstairs, back soon
[01:39:33] <cradek> jmkasunich: yeah I'm on the "almost trivial" bandwagon, just like threading was
[01:39:37] <cradek> brb
[01:42:00] <rayh> KBSI-240D or SI-5 Barrier Terminal board are the ones listed for that speed control.
[01:42:42] <jmkasunich> cradek: just attach a small stepper to the pot
[01:42:44] <jmkasunich> ;-)
[01:43:19] <rayh> I've done that.
[01:43:29] <rayh> ripped the knob right off.
[01:43:39] <jmkasunich> your stepper was too big
[01:43:43] <jmkasunich> _small_ stepper
[01:43:59] <rayh> I had it geared down for resolution.
[01:44:03] <jmkasunich> such that you can command 1 full turn ccw to "home" it
[01:44:13] <rayh> dumb...
[01:44:34] <cradek> haha what a simple/smart/dumb idea
[01:44:35] <rayh> was trying for a 20 turn pot.
[01:45:06] <jmkasunich> you mean the actual pot you had was 20 turns?
[01:45:17] <jmkasunich> seems like plenty of resolution there
[01:45:31] <rayh> not I had a 20 to 1 ratio between the pot and the stepper.
[01:45:35] <jmkasunich> oh
[01:45:36] <cradek> SI-5 KBIC\KBLC [sic]
[01:46:29] <cradek> rummaging for a little stepper...
[01:46:45] <jmkasunich> simple unipolar drive, nema17 stepper from an old floppy drive (or tincan stepper from a printer, or....)
[01:47:06] <cradek> I have two more drivers here, and some old keyboard cables, so that's a reasonable thing to do
[01:47:28] <rayh> Okay. There is a pdf on that board on the kb web site. About a meg. I started a download but it borked.
[01:47:42] <cradek> cool, url?
[01:47:53] <rayh> let me look.
[01:48:58] <rayh> not a very friendly web site.
[01:49:52] <cradek> seems there are a lot of those around.
[01:51:41] <cradek> so briefly, how are tool shape offsets supposed to work? in a mill you have r and length offsets. in a lathe do you just have x and z offsets, or does it know about the entire tool shape?
[01:51:56] <rayh> http://www.kbelectronics.com/manuals/si5_si6.pdf
[01:52:01] <jmkasunich> ideally it knows the whole shape
[01:52:13] <jmkasunich> suppose you have a square insert, turned at 45 degrees
[01:52:19] <jmkasunich> if you are facing, it cuts on the left corner
[01:52:25] <jmkasunich> if you are turning, it cuts on the nose
[01:52:41] <jmkasunich> if you are turning a taper, it cuts on one or the other depending on the taper angle
[01:53:02] <cradek> I have a tool like that, but it uses a triangle
[01:53:14] <cradek> of course it's not a triangle/square, because of the rounded corners
[01:53:18] <jmkasunich> right
[01:53:28] <jmkasunich> that just makes it more compilcated
[01:53:38] <cradek> rayh: thanks, got it
[01:53:53] <rayh> lucky dog!
[01:54:07] <cradek> 100%[====================================>] 1,043,431 551.16K/s
[01:54:17] <rayh> Gotta get out of here guys. See you tomorrow.
[01:54:22] <cradek> goodnight
[01:54:32] <rayh> * rayh waves a finger at cradek
[01:54:32] <jmkasunich> unless you have a QC toolpost or toolchanger, you'll never be able to program the part shape and let EMC do the rest
[01:54:37] <cradek> haha
[01:54:37] <jmkasunich> lol
[01:54:38] <rayh> not saying which one though.]
[01:54:40] <jmkasunich> goodnight ray
[01:54:54] <rayh> someday I'll have a fast line.
[01:54:57] <cradek> jmkasunich: we need to come up with a simpler goal then.
[01:55:06] <cradek> rayh: maybe soon I hear
[01:55:56] <jmkasunich> cradek: do you actually have one of those isolator boards?
[01:56:12] <cradek> yes
[01:56:24] <jmkasunich> that simplifies things a lot
[01:56:40] <cradek> great
[01:56:42] <jmkasunich> freqgen mode 1 + resistors + cap + isolator board = done
[01:56:54] <cradek> I was hoping for that
[01:58:15] <jmkasunich> you can set a jumper to make it accept 0-5V
[01:58:28] <cradek> hey slick
[01:58:42] <cradek> I have +5 available from the mightydrive (already running the encoder)
[01:58:44] <jmkasunich> if you have a proper driver on the parport (none of this 3.3v laptop crap) you can just rc filter it
[01:59:00] <cradek> it's a laptop
[01:59:13] <jmkasunich> ok, then you can buffer the 3.3v laptop crap with a gate powered from the +5V
[01:59:21] <cradek> yeah
[01:59:32] <jmkasunich> HCT or something like that
[01:59:39] <cradek> ok
[01:59:50] <cradek> then what? can you draw it for me?
[02:00:05] <jmkasunich> I thought you did electronics?
[02:00:32] <jmkasunich> cool, they actually include a schematic of the board
[02:01:23] <jmkasunich> wow, not exactly a precision circuit
[02:01:23] <cradek> sure, I do, but I'm nervous because it's my laptop
[02:01:34] <cradek> you think the rc on the output or input of the hct?
[02:01:40] <cradek> oh duh, output
[02:01:41] <jmkasunich> output
[02:01:48] <cradek> duh duh
[02:01:53] <jmkasunich> lol
[02:02:23] <cradek> cool, you can see from this it is isolated
[02:02:31] <jmkasunich> yep
[02:02:44] <jmkasunich> running an optocoupler in linear mode, with no feedback around it
[02:02:57] <cradek> look there's rc on the input already
[02:02:57] <jmkasunich> accuracy +/- 20% on a good day
[02:03:05] <cradek> yeah it's not going to be perfect
[02:03:25] <jmkasunich> 240K 0.1uF
[02:03:32] <jmkasunich> 24mS?
[02:04:30] <jmkasunich> oh, its not running the opto linear
[02:04:35] <jmkasunich> duh, duh
[02:04:38] <jmkasunich> ;-)
[02:04:44] <jmkasunich> IC1 is a comparator not an opamp
[02:04:52] <jmkasunich> they're pwming the opto
[02:05:03] <cradek> if you say so
[02:05:12] <jmkasunich> ;-P
[02:05:18] <cradek> oh! up a page is the values
[02:05:21] <cradek> I wondered where you found the rc
[02:05:27] <jmkasunich> come on, you should be able to figure out that ckt
[02:06:20] <cradek> that time constant seems a little low, do you think it'll be ok?
[02:06:37] <jmkasunich> do you have a scope?
[02:06:43] <cradek> of course
[02:06:47] <jmkasunich> heh
[02:06:58] <cradek> heh how many do I need?
[02:07:20] <jmkasunich> I'm 99.9% sure that circuit is a simple integrator/comparator oscillator
[02:07:50] <jmkasunich> not sure whether it is more-or-less constant frequency with duty cycle that changes with input voltage
[02:07:59] <jmkasunich> or variable frequency
[02:08:16] <jmkasunich> I could try to noodle it out
[02:08:22] <jmkasunich> or you could scope it
[02:08:32] <jmkasunich> (without the laptop, just use a pot
[02:08:49] <jmkasunich> and scope only on the input side of the opto
[02:09:37] <cradek> but it doesn't matter as long as the tc is (much) longer than my base period right?
[02:09:50] <jmkasunich> pretty much
[02:10:11] <jmkasunich> there will be some ripple though
[02:10:30] <jmkasunich> I'm a little concerned about the ripple beating with the free-running oscillator frequency
[02:10:45] <jmkasunich> you might get some instability at certain settings
[02:11:02] <cradek> oh I see what you mean
[02:11:18] <cradek> I could just solder another cap over the one that's there
[02:11:35] <cradek> make a 200-400ms tc
[02:11:55] <jmkasunich> yeah
[02:11:57] <cradek> not finding hct... tons of 74xx and 74ls
[02:12:04] <jmkasunich> you'll need a couple uF
[02:12:41] <jmkasunich> 7406 by any chance?
[02:12:47] <jmkasunich> IIRC that is an open collector part
[02:13:10] <jmkasunich> put a pullup on it and it will swing to +5
[02:13:30] <cradek> 00 05 07 08
[02:13:39] <jmkasunich> but normal TTL or LS doesn't go all the way to the + rail, so you won't get full output
[02:13:54] <cradek> 05 is oc
[02:14:11] <jmkasunich> there you go
[02:14:21] <cradek> I don't need full 5v, I'll never go at full speed
[02:14:52] <cradek> talk about vintage parts most of this ttl junk here is pre-ls
[02:15:05] <jmkasunich> the simplest thing would be to connect com to PC ground and SIG to a parport pin and call it done
[02:15:33] <jmkasunich> R6 is 240K, theres no way enough energy can backflow thru that to hurt your parport
[02:15:48] <jmkasunich> the load on the parport is pure passive resistance
[02:16:09] <cradek> you think that's enough? a buffer is not much more trouble
[02:16:28] <jmkasunich> Zin = R2+R5+R4
[02:16:31] <cradek> the reliable 5v might be nice, since I could move to another parport without recalibrating
[02:16:56] <jmkasunich> Zin is 20K
[02:17:00] <jmkasunich> you don't need a buffer
[02:17:19] <cradek> I mean 3v vs 5v
[02:17:20] <jmkasunich> and farting around with +5 probably _increases_ the chance of backfeeding the parport with something it won't like
[02:17:31] <cradek> well that's true
[02:17:35] <jmkasunich> you just told me you don't want to go full speed
[02:17:48] <cradek> you missed a line I typed:
[02:17:50] <cradek> the reliable 5v might be nice, since I could move to another parport without recalibrating
[02:18:05] <cradek> if I move to a non-laptop, it would be nice if my speeds didn't all increase 40%
[02:18:05] <jmkasunich> that "max" trimpot has quite a bit of range, you probably could get full speed anyway
[02:18:08] <jmkasunich> I didn't miss it
[02:18:35] <jmkasunich> what are the odds of moving to another box?
[02:18:46] <jmkasunich> if you do, adjust R5 and you are all set
[02:18:51] <jmkasunich> KISS
[02:18:51] <cradek> ok
[02:19:20] <jmkasunich> just don't accidentlly hoop the parport to the +12V terminal ;-)
[02:19:33] <jmkasunich> s/hoop/hook
[02:19:49] <jmkasunich> its funny, my current work project is a high end version of this isolator
[02:20:25] <jmkasunich> high end = several KHz bandwidth, and better than 1% accuracy (goal is as close to 0.1% as I can get cheaply)
[02:20:38] <cradek> sounds challenging
[02:20:39] <jmkasunich> and no trim pots!
[02:20:41] <cradek> analog input?
[02:20:58] <jmkasunich> analog in, analog out, 2500V isolation between
[02:21:11] <cradek> jeez
[02:21:45] <jmkasunich> working voltage is only 800 or so, but needs to pass UL
[02:22:05] <jmkasunich> I'm doing something pretty similar to this
[02:22:27] <jmkasunich> comparator on the input, self oscillating at about 300KHz and generating PWM
[02:22:39] <jmkasunich> send that thru the isolator, filter it to make output
[02:22:47] <jmkasunich> 2 tricks for accuracy
[02:22:58] <jmkasunich> 1) using analog devices new non-opto isolators
[02:23:23] <jmkasunich> something like 3nS skew between rising and falling edge prop delays
[02:23:45] <jmkasunich> 2) sending the pwm signal back across the isolation barrier and filtering it on the input side too
[02:23:59] <jmkasunich> and closing a feedback loop with that signal
[02:24:14] <jmkasunich> cancels out most errors, and much of the filter lag
[02:25:10] <jmkasunich> I just finished laying out a proof-of-principle test board
[02:25:17] <jmkasunich> 3" x 0.8"
[02:25:24] <jmkasunich> gonna order glass tomorrow
[02:25:26] <cradek> why so narrow?
[02:25:40] <jmkasunich> just happens to be the way it laid out
[02:25:42] <cradek> you need cnc to mill your prototypes
[02:25:52] <jmkasunich> I like plated thru holes
[02:26:11] <jmkasunich> work is paying, I can get several pieces for $100
[02:26:48] <jmkasunich> with silkscreen, plated holes, soldermask, and solder coated pads
[02:27:28] <cradek> ah, much nicer than milled
[02:27:49] <jmkasunich> actually its a bit of a bummer
[02:28:00] <jmkasunich> that price gets three boards up to 60in^2 each
[02:28:06] <jmkasunich> I have 3in^2 each
[02:28:20] <cradek> so add on another project?
[02:28:27] <jmkasunich> if I had time
[02:28:37] <jmkasunich> I'd design an H bridge
[02:28:58] <jmkasunich> spend a couple hours the other day talking to fenn about H bridges, mosfet drivers, etc
[02:29:04] <jmkasunich> s/spend/spent
[02:29:42] <jmkasunich> he's too cheap to use IR2110 type drivers at about $5 for a half-bridge
[02:30:34] <cradek> seems so many of us here are impossibly cheap (me included)
[02:30:35] <jmkasunich> I think I have a driver design that uses two $0.16 NPNs, a $0.30 small MOSFET, and can drive two $<1 20mOhm mosfets
[02:31:26] <jmkasunich> (also needs three $0.07 diodes, 4-5 resistors, and a couple caps)
[02:31:48] <cradek> sounds cheap enough for any budget
[02:32:00] <skunkworks> I was tempted to send bo-dick some chips ;)
[02:32:10] <jmkasunich> heh, until you build it on a $30 PC board
[02:32:20] <jmkasunich> the IR2110 is simple enough to build on perfboard
[02:32:31] <cradek> skunkworks: I admit I had the same thought
[02:32:53] <jmkasunich> he'd just burn them up
[02:32:57] <cradek> with him, something other than cheap is at work (I know cheap) but I don't know what it is
[02:33:14] <jmkasunich> cheap and clueless?
[02:33:46] <jmkasunich> his attempt to spice the thing (and the fact that he has no idea why it didn't work) tells me he doesn't know electronics 101
[02:34:28] <cradek> yeah, you're probably right
[02:35:07] <jmkasunich> fenn had some misconceptions about driving mosfets, but when I started explaining, I could tell that he "got it"
[02:35:52] <jmkasunich> theres a certain base level of electronics know-how that you simply must get from books and/or hands on work, over a significant period of time
[02:35:53] <cradek> "doesn't know how something works" and "without any clue" are very different
[02:35:56] <skunkworks> I have some house work to finish but I hope to have 1 board done some time this week.
[02:36:08] <jmkasunich> only then can you begin to learn more from talking to others
[02:36:34] <skunkworks> I know my electronics is rusty.
[02:36:50] <jmkasunich> rusty, but there
[02:37:02] <jmkasunich> rust scrapes off
[02:37:08] <cradek> my calculus is rusty but that doesn't mean I can't figure out calculus problems
[02:37:08] <skunkworks> usually ;)
[02:37:17] <cradek> ha "scrapes off"
[02:37:46] <skunkworks> I'll have to remember that one
[02:37:55] <jmkasunich> hmm, I just heard something strange
[02:38:17] <jmkasunich> the disk in my computer started to spin down, then after a couple seconds spun back up
[02:38:33] <jmkasunich> I don't have power management enabled
[02:38:41] <cradek> that's when you start scrambling for backup tapes
[02:38:43] <jmkasunich> and I didn't think linux ever turned off the disks
[02:39:30] <cradek> a few disks powersave by themselves, but I doubt you have one if it's modern
[02:39:49] <jmkasunich> relatively modern
[02:40:03] <jmkasunich> actually, I don't know which one it is
[02:40:21] <jmkasunich> there are two drives, one is a new (~1 year old) 80G
[02:40:28] <jmkasunich> the other is 10G or so
[02:40:57] <jmkasunich> I really need to come up with a backup plan
[02:41:42] <skunkworks> I must have a hardrive go bad every few months.
[02:41:48] <jmkasunich> http://www.mikerubel.org/computers/rsync_snapshots/
[02:41:56] <jmkasunich> I was reading that page the other day
[02:42:05] <jmkasunich> and thinking about setting up a backup server
[02:44:23] <cradek> ok hardware's done
[02:44:29] <cradek> this will be slick if it works
[02:46:12] <skunkworks> you are doing some sort of pwm-filter - dc to run in place of a pot?
[02:46:19] <cradek> yes
[02:46:25] <skunkworks> cool
[02:49:23] <cradek> so can I run freqgen type=1 and disregard capture_position()?
[02:49:33] <jmkasunich> yeah
[02:49:50] <jmkasunich> just vary the frequency between 0 and max-freq for output from zero to max
[02:51:32] <cradek> in hal-intro, the freqgen functions have _ in them, but I think they're really -
[02:51:55] <jmkasunich> yeah, everything should be - now, only the docs are out of date
[02:52:20] <cradek> ok
[02:56:09] <cradek> did you change iocontrol.0.spindle-speed-out to be rps or is it still rpm?
[02:56:21] <jmkasunich> uhhhhh
[02:56:30] <jmkasunich> rps?
[02:56:33] <jmkasunich> maybe?
[02:56:55] <jmkasunich> halmeter is your friend
[03:03:53] <cradek> it's rpm
[03:04:05] <jmkasunich> figured
[03:04:09] <jmkasunich> figures
[03:04:17] <jmkasunich> if I had changed it I would probably remember
[03:04:36] <jmkasunich> but I have this vague fuzzy memory of changing something
[03:04:49] <jmkasunich> I think it was when I changed the sim-encoder to use rps instead of rpm
[03:04:56] <cradek> what has to be equal to velocity to get a 100% duty cycle?
[03:05:01] <cradek> I'm not getting anywhere near 100
[03:05:03] <cradek> %
[03:05:18] <cradek> I think I don't quite understand freqgen
[03:05:51] <jmkasunich> hang on a sec, lemme load it
[03:06:38] <cradek> something about maxfreq?
[03:07:04] <jmkasunich> maxfreq is the maximum frequency in Hz (at which point the output is on all the time)
[03:07:23] <cradek> ok I don't get that
[03:07:25] <cradek> frequency of what?
[03:07:48] <jmkasunich> type 1 is _not_ true PWM, its pseudo-PWM
[03:08:02] <jmkasunich> there are two outputs, up and down
[03:08:10] <jmkasunich> if you command zero, both are low all the time
[03:08:34] <jmkasunich> if you command +10% of max-freq, then UP will go true for 1 base-period every 10
[03:09:08] <cradek> ok
[03:09:11] <jmkasunich> command -33% of max-freq, and DOWN will go true for 1 base periods every three
[03:09:13] <jmkasunich> etc
[03:09:21] <cradek> I have maxfreq 5000, and command 5000 but don't get 100%
[03:09:35] <jmkasunich> you changed maxfreq?
[03:09:43] <cradek> yes
[03:09:48] <jmkasunich> can't do dat
[03:09:56] <jmkasunich> (not if you're doing pseudo-pwm)
[03:10:01] <cradek> oh
[03:10:16] <jmkasunich> what you told it is "never go TRUE more than 5000 times per second"
[03:10:27] <jmkasunich> but since base-period is lots faster than that, you never reach 100%
[03:10:29] <cradek> ah ok
[03:10:41] <jmkasunich> set max-freq to zero, or bignum, and it should reset to the actual limit
[03:10:51] <cradek> how do I set what commanded vel gives 100%?
[03:10:56] <jmkasunich> which is basically 1/base-period
[03:11:42] <cradek> if I'm slow, say so and I'll go read it again
[03:12:03] <jmkasunich> I'm rusty myself, so I'm testing it
[03:13:17] <jmkasunich> ok, here's how it works
[03:13:32] <jmkasunich> velocity is in arbitrary units (you get to pick them)
[03:13:49] <cradek> ok it's rpm then
[03:14:08] <jmkasunich> pin velocity is multiplied by param velocity-scale to get the number of pulses per second
[03:14:52] <jmkasunich> that result is visible at parameter frequency (in Hz)
[03:15:03] <jmkasunich> the duty cycle is frequency / max-freq
[03:15:21] <jmkasunich> (assuming max-freq is the original, 1/base-period value)
[03:16:16] <jmkasunich> I'd start by setting maxfreq to bignum, then read its value
[03:16:24] <jmkasunich> set velocity-scale to that value
[03:16:37] <jmkasunich> now 0.0 = 0% duty cycle, and 1.0 = 100% duty cycle
[03:16:47] <cradek> ok
[03:16:58] <cradek> so this all goes off when I change my base period
[03:17:07] <jmkasunich> yes
[03:17:17] <jmkasunich> remember, it was never designed to be a pwm generator
[03:17:23] <cradek> right
[03:17:26] <jmkasunich> (maybe I should make a PWM module)
[03:18:12] <cradek> it's 4916.6
[03:18:50] <jmkasunich> what is? maxfreq?
[03:18:54] <cradek> yes
[03:19:03] <jmkasunich> what's your base-period?
[03:19:09] <cradek> 20
[03:19:28] <jmkasunich> I have 50uS here, and my maxfreq is 1.98863+e4
[03:19:41] <cradek> arg
[03:19:45] <cradek> 49716.6
[03:19:51] <jmkasunich> ok, thats more like it
[03:19:53] <jmkasunich> ;-)
[03:20:28] <jmkasunich> so set velocity scale to that number (or close, 50000 would be fine)
[03:20:54] <jmkasunich> now you can vary velocity from 0.0 to 1.0 and should see it go from 0% to 100%
[03:23:06] <jmkasunich> once you know what speed you get at 100%, you can divide velocity-scale by that
[03:23:30] <jmkasunich> say 100% gives you 2000RPM, so then velocity-scale should be 50000/2000 = 25.0
[03:23:49] <jmkasunich> then velocity can be in RPM
[03:25:05] <cradek> got it
[03:25:48] <cradek> here goes nothing
[03:27:07] <cradek> ha
[03:27:08] <cradek> it works
[03:27:12] <jmkasunich> yay!
[03:27:23] <cradek> I have to command 50% before I get anything
[03:27:33] <jmkasunich> eww
[03:27:43] <cradek> oh the 5v jumper
[03:29:33] <cradek> kick ass
[03:33:06] <cradek> looks like I'll really need some kind of interpolation table
[03:33:20] <jmkasunich> its nonlinear?
[03:34:06] <cradek> oh I thought the instructions said min/max don't work with the dac input, but they do
[03:37:36] <cradek> hmm, abort doesn't unsync, bug!
[03:37:56] <cradek> wow, this is slick
[03:43:13] <jmkasunich> what is slick? working S words in g-code?
[03:43:17] <cradek> yes
[03:43:25] <cradek> I've never seen that work before
[03:43:28] <jmkasunich> little things make you happy eh?
[03:43:36] <cradek> you call that little?
[03:43:42] <jmkasunich> you'll like the Mazak
[03:43:50] <jmkasunich> I have some hal blocks and ladder logic
[03:43:59] <jmkasunich> you command a speed in RPM
[03:44:15] <jmkasunich> and if neccessary, it will slow down, shift gears, and speed back up again
[03:44:23] <cradek> ha, cool
[03:44:45] <cradek> that kicks ass
[03:45:50] <jmkasunich> I just wish I had documented what I did
[03:46:24] <jmkasunich> that kind of stuff just screams for a schematic/block-diagram style drawing
[03:46:30] <cradek> yeah
[03:47:24] <jmkasunich> IIRC, the incoming command goes to a comparator that decides which gear range is needed
[03:47:34] <jmkasunich> and to two scale blocks, one for hi gear and one for low
[03:47:52] <jmkasunich> the two output are the values that would be sent to the drive for each gear setting
[03:48:01] <jmkasunich> they go to 2 inputs of a 4 input mux
[03:48:10] <jmkasunich> the other two inputs are fixed at a low speed
[03:48:27] <jmkasunich> the mux select pins are controlled by the ladder
[03:48:48] <jmkasunich> mux output goes to a limit2 block (ramps output to match input)
[03:49:02] <jmkasunich> and another comparator compares the output and input to say "ramp is done"
[03:49:14] <jmkasunich> the comparator outputs go to the ladder
[03:49:40] <jmkasunich> if desired speed range != current speed range, set mux to fixed low speed
[03:49:47] <jmkasunich> wait for ramp complete
[03:49:56] <jmkasunich> shift into neutral
[03:50:06] <jmkasunich> then shift into desired gear
[03:50:15] <jmkasunich> set mux to proper scaled signal
[03:50:19] <jmkasunich> wait for ramp complete
[03:50:51] <jmkasunich> there are sensors on the gearbox to tell you when the shifter has moved
[03:51:02] <cradek> how much IO does this all take?
[03:51:09] <jmkasunich> hmmm
[03:51:09] <cradek> you must have tons of switches
[03:51:49] <jmkasunich> 2 solenoid valves for "shift to high" and "shift to low" (I'm pretty sure a spring returns it to neutral)
[03:52:10] <jmkasunich> three prox sensors to indicate "in high", "in low", and "in neutral"
[03:52:32] <jmkasunich> DAC sending 0-10V to the spindle drive
[03:52:43] <jmkasunich> the rest is all internal
[03:52:54] <cradek> you're right, I can't wait to see this
[03:52:55] <jmkasunich> (comparators, muxes, ladder, etc)
[03:53:58] <cradek> hmm, I better get to bed
[03:54:44] <cradek> goodnight, and thanks for the help with the spindle
[03:54:44] <jmkasunich> I should to
[03:54:56] <jmkasunich> I didn't get as much Lyxing done as I intended
[03:55:08] <jmkasunich> writers block
[03:55:13] <jmkasunich> goodnight
[03:56:05] <cradek> goodnight
[06:27:49] <alex_joni> morning..
[06:29:32] <alex_joni> er..guess it's too late