Back
[03:04:38] <jmkasunich_> anybody around?
[03:08:33] <cradek> just us chickens
[03:08:50] <jmkasunich_> I'm trying to make a design decision
[03:09:38] <jmkasunich_> if I have N stepgens in an FPGA, should I export 5i20.0.stepgen.0.read, 5i20.0.stepgen.1.read, .2.read, etc, or just 5i20.stepgen.read
[03:09:44] <cradek> I hope it's easy - it feels pretty late
[03:09:50] <jmkasunich_> for the software stepgens I only export one
[03:10:06] <jmkasunich_> makes for nice clean hal files, at the expense of some flexibility about what thread you put things in
[03:10:19] <cradek> what situation would you want them in different threads?
[03:10:23] <jmkasunich_> dunno
[03:10:35] <jmkasunich_> for stepgens, probably never
[03:10:43] <cradek> then do the simpler one
[03:10:52] <jmkasunich_> yeah, thats what I was leaning toward
[03:11:09] <jmkasunich_> but part of me is offended by asymetry
[03:11:11] <cradek> things should be as simple as possible, but no simpler
[03:11:23] <jmkasunich_> some things have individual functs, some don't...
[03:11:34] <jmkasunich_> its not "regular" or "orthogonal"
[03:11:42] <cradek> yeah
[03:11:45] <jmkasunich_> of course, its easier and simpler, and there is much to be said for that
[03:11:51] <cradek> it's like . vs -
[03:12:28] <jmkasunich_> I just decided.... based on the following criteria:
[03:13:15] <jmkasunich_> the number of people asking "why can't I have stepgens in different threads?" will be less than the number of people asking "why does only one axis work?"
[03:14:17] <cradek> haha
[03:14:21] <cradek> good idea
[03:14:31] <jmkasunich_> thanks for being a sounding board
[03:14:36] <cradek> sure
[03:15:36] <jmkasunich_> aren't pointers fun? "p = &((*p)->next);"
[03:16:31] <cradek> p is a **?
[03:16:35] <jmkasunich_> yeah
[03:16:41] <cradek> yuck
[03:16:50] <jmkasunich_> I'm finding the end of a list, then adding a new item
[03:17:10] <jmkasunich_> so I need the address of the last 'next' field so I can stick the new item address in it
[03:17:40] <cradek> you're supposed to insert at the head of the list, silly
[03:17:55] <jmkasunich_> that would be easier, except for two things
[03:18:20] <jmkasunich_> 1) stepgen.N.some-pin - I have to traverse the list to figure out what N is (or else store it somewhere)
[03:18:42] <jmkasunich_> 2) I want them to run in order of N, not reverse
[03:19:12] <jmkasunich_> the order probably doesn't matter, but if it ever does, running them the other way is non-obvious and will cause head-scratching
[03:23:45] <SWPadnos> regarding a single read function: it may even be easier inthe FPGA, since you can share a latching signal among all the stepgens
[03:24:08] <SWPadnos> rather than needing to be able to latch counts individually
[03:24:18] <jmkasunich_> no latching needed
[03:24:29] <SWPadnos> synchronous update / bus?
[03:24:30] <jmkasunich_> counts are a 32 bit number which is read in a single bus cycle
[03:24:59] <SWPadnos> are they updated in a single bus cycle, and synchronous to the bus clock?
[03:25:10] <jmkasunich_> yep
[03:25:17] <SWPadnos> well ok then :)
[03:35:50] <jmkasunich_> I think I'm gonna make step-type a hal parameter
[03:36:16] <jmkasunich_> so you can change from step/dir to up/down with a "setp"
[03:36:26] <SWPadnos> that should work for anything that uses two (output) pins
[03:36:46] <SWPadnos> I guess that makes sense - the actual outputs aren't named HAL pins anyway (step/dir, up/down ...)
[03:36:52] <jmkasunich_> the fpga stepgen only has step types 0, 1, and 2 (step/dir, up/down, and quadrature)
[03:39:15] <cradek> I'm surprised you did quadrature
[03:39:21] <jmkasunich_> why?
[03:39:53] <cradek> nothing uses it, and it seems like it would be hard to do
[03:40:18] <jmkasunich_> its easy to do
[03:40:20] <SWPadnos> quadrature output should be pretty easy
[03:40:26] <jmkasunich_> if stepreq = '1' then
[03:40:26] <jmkasunich_> phasea <= phaseb xor dirout;
[03:40:26] <jmkasunich_> phaseb <= phasea xor not dirout;
[03:40:26] <jmkasunich_> end if;
[03:40:32] <cradek> ok
[03:42:12] <jmkasunich_> it doesn't have an index, but other than that it can be used as a high speed version of the simulated encoder
[03:42:22] <jmkasunich_> (which may or may not be usefull)
[03:43:17] <cradek> that reminds me (why?) yesterday I ran across a bunch of model airplane servos
[03:43:23] <cradek> I think they take pwm in
[03:43:32] <cradek> it seems trivial to hook one to the speed control knob of my lathe
[03:43:36] <jmkasunich_> not exactly pwm
[03:43:40] <cradek> they are self homing etc
[03:43:48] <cradek> oh - what is it?
[03:43:50] <SWPadnos> do you mean the servos that control things like flaps?
[03:43:53] <cradek> yes
[03:44:07] <jmkasunich_> pulse length modulation
[03:44:13] <SWPadnos> they are PWM, but not duty cycle
[03:44:25] <jmkasunich_> something like 0.5 to 1.5mS pulses for min to max output
[03:44:29] <jmkasunich_> 1.0mS is center
[03:44:37] <jmkasunich_> but the rep rate can be as slow as 50Hz
[03:44:41] <SWPadnos> right - so you would need to use a "slow" PWM, rather than the easier-to-filter DDS-type
[03:45:05] <jmkasunich_> traditionally a multi-channel system would send all the pulses one after another, and the receiver would de-mux them
[03:45:10] <cradek> hmm not so good then is it
[03:45:22] <jmkasunich_> I've been meaning to do a HAL comp for servos
[03:45:28] <cradek> I won't be able to get that out of the pluto
[03:45:35] <jmkasunich_> you actually have a servo, you're elected
[03:45:40] <cradek> on a parport it would be simple
[03:45:40] <SWPadnos> possibly for controlling coolant pressure or somthing :)
[03:45:50] <jmkasunich_> software version would have limited resolution, but usable
[03:46:49] <jmkasunich_> http://en.wikipedia.org/wiki/RC_servo
[03:47:27] <jmkasunich_> I had the times wrong, 1.25 thru 1.75mS, 1.50 is neutral
[03:47:52] <jmkasunich_> one pulse every 20mS, although I think that can change without ill effects
[03:47:58] <SWPadnos> how long can the stepgen step pulses be?
[03:48:37] <jmkasunich_> a sizable fraction of a second I think (for the sw stepgen)
[03:48:51] <jmkasunich_> but to change the length of the pulses you'd need to mess with the steplen parameter
[03:49:02] <SWPadnos> right - if that were a pin, it would work
[03:49:10] <jmkasunich_> do it right
[03:49:25] <SWPadnos> though a simple PWM should be about 3 lines in comp (after the preamble)
[03:49:47] <cradek> I don't see how it's different from pwm with a min and max
[03:49:56] <jmkasunich_> I guess its not
[03:50:17] <cradek> isn't it already done then?
[03:50:18] <SWPadnos> don't the EMC PWMs try to output at as high a frequency as possible?
[03:50:30] <cradek> no we have fixed frequency pwm too
[03:50:33] <jmkasunich_> SWPadnos: you can set the frequency
[03:50:42] <SWPadnos> oh, in that case it should be done ;)
[03:51:13] <jmkasunich_> so, pwm_freq = 50, max_dc = 0.04, min_dc = 0.02 (for 1mS to 2mS)
[03:51:19] <cradek> it's so simple maybe I'll put it on a separate parport
[03:52:08] <cradek> hm, I've got to get the important stuff working first, without getting sidetracked
[03:52:08] <SWPadnos> well - good night guys
[03:52:11] <cradek> goodnight
[03:52:12] <cradek> me too
[03:52:15] <jmkasunich_> goodnight
[03:53:22] <SWPadnos> one last thing before bedtime: did anyone actually call the hotel to check on the reservations (we couldn't find on the web)?
[03:53:45] <jmkasunich_> not me
[03:54:19] <SWPadnos> me either. maybe I'll do that tomorrow
[03:54:28] <SWPadnos> or next week ...
[03:54:42] <SWPadnos> ah well. night
[03:57:29] <tomp> pwm servo can control a galvo add a pen laser, and emc can draw like this
http://elm-chan.org/works/vlp/frasamp.avi
[04:00:48] <tomp> i think that was only 16kpps, details at
http://elm-chan.org/works/vlp/report_e.html
[18:41:16] <alex_joni> hi jmkasunich_
[18:42:05] <jmkasunich_> hi
[18:42:16] <jmkasunich_> hmm, I didn't realize I had a _
[18:42:20] <jmkasunich_> jmkasunich_ is now known as jmkasunich
[18:42:40] <alex_joni> tab works :)
[18:42:47] <alex_joni> * alex_joni is replacing linkpp with net in all configs
[18:42:54] <alex_joni> guess it's ok with you?
[18:42:57] <jmkasunich> yes ;-)
[18:44:58] <alex_joni> ok, here goes
[18:45:08] <alex_joni> (hope I have no spelling errors.. can't run all configs)