#emc-devel | Logs for 2007-06-30

[01:16:16] <jmkasunich_> jmkasunich_ is now known as jmkasunich
[02:07:16] <cradek> good evening
[02:30:30] <jmkasunich> hello
[02:31:39] <cradek> I had a fun few days working on stuart's machine but unfortunately i'm not leaving kansas tomorrow with a bridgeport
[02:31:51] <jmkasunich> bummer
[02:31:52] <cradek> maybe in a few weeks it'll work out
[02:32:36] <cradek> I found a really great laptop at boeing surplus today
[02:32:59] <cradek> I was just getting fed up with mine (keyboard was dying again) and was starting to watch ebay
[02:33:24] <jmkasunich> isn't boeing surplus in WA state?
[02:33:28] <cradek> this is a thinkpad 2GHz with 1GB ram and 1600x1200 screen
[02:33:40] <cradek> nope, it's in wichita
[02:33:43] <cradek> (might be more of them)
[02:33:46] <jmkasunich> oh
[02:34:12] <cradek> the only thing I don't like is the nipple pointer (I much prefer the pad)
[02:34:20] <cradek> but the kb is decent and the screen is *great*
[02:34:25] <jmkasunich> its has only the pointer?
[02:34:27] <cradek> yes
[02:34:35] <jmkasunich> I'm used to seeing both
[02:34:36] <cradek> that's an IBMism
[02:37:28] <cradek> some guys I talked to mentioned a homing scheme that's used on modern large machines - I think we could easily support it
[02:37:40] <jmkasunich> what is that?
[02:38:27] <cradek> each axis has a pointer that shows a position that's half a turn of the screw away from index. the operator jogs it to there and hits the home button. the axis searches for the index and sets home position.
[02:38:46] <cradek> they say they love it because there are no switches and wires to break
[02:39:05] <cradek> these machines have NO switches (home or limit)!
[02:39:27] <cradek> (these were maintenance guys...)
[02:39:28] <jmkasunich> these are pro class machines? (mazak etc)
[02:39:33] <jmkasunich> or retrofitted bports?
[02:39:35] <cradek> yes they are fanuc
[02:39:43] <cradek> definitely pro
[02:39:56] <jmkasunich> I'd have never expevted that
[02:39:58] <jmkasunich> c
[02:40:23] <cradek> yeah I was pretty shocked too
[02:40:38] <cradek> but even for a hobbyist with encoders, this could be very useful
[02:40:48] <cradek> and it's just another matter of skipping homing stages isn't it?
[02:40:58] <jmkasunich> I think so
[02:41:09] <cradek> SEARCH_VEL=0, LATCH_VEL=nonzero?
[02:41:14] <jmkasunich> main problem would simply be supporting it on the ini file
[02:41:21] <jmkasunich> I see you've already thought about that ;-)
[02:41:58] <jmkasunich> SEARCH_VEL = 0, LATCH_VEL != 0, and USE_INDEX = TRUE
[02:44:19] <cradek> yeah I think that's the ticket too
[02:44:44] <jmkasunich> if you write the docs I'll code it ;-)
[02:45:42] <jmkasunich> off topic question....
[02:46:05] <jmkasunich> is it normal for an ubuntu box to be touching the disk every second or so, all the time?
[02:46:32] <cradek> hard disk?
[02:46:35] <jmkasunich> yeah
[02:46:57] <jmkasunich> I never noticed on the old box because it was loud, but on this one I can hear the heads seek
[02:47:14] <jmkasunich> the light blinks about once every second or two
[02:47:23] <cradek> yuck
[02:47:41] <cradek> it checks for a CD being inserted I think - don't know why it would touch the hard disk
[02:47:55] <cradek> this one isn't doing that
[02:48:18] <jmkasunich> wonder if it could be the VMs
[02:48:40] <jmkasunich> top shows them as among the top processes, but only a few % of the CPU
[02:48:57] <jmkasunich> they spend 99% of their time running "sleep 300"
[02:49:37] <jmkasunich> you know any tricks for finding out what is going on?
[02:49:50] <jmkasunich> ps -A gives a huge list of stuff
[02:50:08] <cradek> I wish I knew a good way to snoop who's doing the IO, but I don't
[02:50:17] <cradek> you could strace a suspect process I guess
[02:50:57] <jmkasunich> there are a lot of suspects
[02:51:00] <jmkasunich> I think I'll start by stopping the VMs
[02:53:56] <jmkasunich> stopping the VMs fixed it
[02:54:09] <cradek> hmm
[02:54:25] <jmkasunich> mostly
[02:54:57] <jmkasunich> something is still doing a seek every 5-10 seconds
[02:58:01] <jmkasunich> the seeks don't seem to correlate with network activity - the lightes on the switch go idle for quite a while when I'm not doing anything
[03:09:38] <cradek> I'll see if I can figure out how to do the docs...
[03:49:23] <cradek> jmkasunich: I think I have the docs done
[03:52:19] <cradek> do you want me to check it in so you can see it?
[03:52:27] <jmkasunich> sure
[03:52:40] <jmkasunich> its getting late here - I'll code it tomorrow
[03:54:28] <cradek> committed
[03:55:21] <cradek> this might be a nice answer for the guys who want limit switches to disable their amps, but don't want to add home switches
[03:55:37] <cradek> I very well may be in that boat soon actually
[03:57:02] <Skullworks-PGAB> taking skill out of the hardware and requiring a skilled (or just someone with a clue ) operator.
[03:57:57] <cradek> it could definitely be argued that a machine should contain no unnecessary parts
[03:58:02] <Skullworks-PGAB> I'm thinking that this method works best with a course screw.
[03:58:14] <jmkasunich> and a well trained operator
[03:58:44] <cradek> .2" is pretty fine but not at all hard to place a pointer into
[03:58:43] <Skullworks-PGAB> better pointer - without being off by 1 turn
[12:09:12] <jepler> strangely enough I was also thinking about "home to index only" yesterday
[15:40:06] <skunkworks> that is a neat idea. I would not have a problem with that. Would you have to move it more than one turn so the emc knows how many counts between indexes? so you can get it close (within a half a turn) and emc would know which direction to do the final move to find the index?
[18:00:40] <alex_joni> hello
[18:00:43] <alex_joni> anyone home?
[18:01:01] <alex_joni> * alex_joni needs some tuning advice
[18:15:17] <SWPadnos> tune it up, baby!
[18:24:27] <alex_joni> weell.. so far I'm not able to make it move at all
[18:24:30] <alex_joni> not even badly
[18:25:22] <SWPadnos> well, I'd say tuning is going to be secondary to that then :)
[18:25:51] <alex_joni> the problem is that the motor and encoder are not directly connected
[18:25:59] <alex_joni> remember my tripod?
[18:26:03] <SWPadnos> to each other or to EMC?
[18:26:07] <SWPadnos> yes
[18:26:08] <alex_joni> to each other
[18:26:13] <SWPadnos> ah
[18:26:15] <alex_joni> this is a servo version
[18:26:40] <SWPadnos> so you have a capstan roller to drive the encoder
[18:26:46] <SWPadnos> from actual wire travel
[18:26:51] <alex_joni> yeah
[18:27:04] <alex_joni> and about 3.56 counts / mm
[18:27:11] <alex_joni> please don't laugh
[18:27:20] <SWPadnos> hahaha - oh
[18:28:13] <alex_joni> so far I tried moving the encoder by hand, and I see the motor starting to spin up the other way
[18:28:20] <alex_joni> so that's ok so far
[18:28:36] <SWPadnos> I don't know that you can use PID for this - it's inherently nonlinear
[18:29:07] <jmkasunich> if the motor is driving the wire and the encoder is observing the wire, thats not non-linear
[18:29:21] <jmkasunich> or at least, not badly nonlinear
[18:29:43] <SWPadnos> sure it is - as tbe spool fills up, the ratio of motor effort to wire motion changes
[18:29:43] <jmkasunich> if the wire is being wound on a spool, as the spool fills up the radius will change
[18:29:51] <SWPadnos> right - probably not too bad, but definitely nonlinear
[18:30:01] <alex_joni> yeah, but the spool is pretty big
[18:30:11] <SWPadnos> it's the paper-roll problem, only more random :)
[18:30:19] <alex_joni> so the diameter changes are small
[18:30:22] <alex_joni> under 1mm
[18:30:24] <jmkasunich> use a largish spool with minimum buildup, and you can keep that non-linearity under 10%
[18:31:15] <SWPadnos> ok, if it's that good already, then it shouldn't be a problem
[18:31:16] <alex_joni> jmkasunich: too bad you're so far away :)
[18:31:23] <jmkasunich> for tuning?
[18:31:31] <alex_joni> ok, here's my plan for the next few things
[18:31:36] <alex_joni> jmkasunich: yeah, that too
[18:31:52] <alex_joni> I plan to change the wire (first one was too thick, second on ebroke too easily)
[18:32:07] <alex_joni> then add some mass suspended to it.. holding it by hand doesn't solve anything
[18:32:48] <alex_joni> then I'll try to tune PID untill it keeps position (balancing the weight)
[18:34:28] <jmkasunich> are you doing PWM from EMC direct to the transistors?
[18:35:09] <jmkasunich> or using some kind of servo amp?
[18:35:59] <alex_joni> pwmgen
[18:36:03] <jmkasunich> ok
[18:36:15] <alex_joni> going to L298 bridges
[18:36:19] <jmkasunich> what data do you have on the motors?
[18:36:34] <jmkasunich> if you can figure out K it might help a lot
[18:36:37] <alex_joni> casette recorder motors
[18:36:47] <jmkasunich> eww
[18:36:53] <SWPadnos> heh
[18:37:10] <jmkasunich> how are the motors coupled to the spools?
[18:37:22] <jmkasunich> seems they isn't nearly enough torque if direct drive
[18:37:29] <alex_joni> on the motor shaft there's a smaller spool
[18:37:41] <alex_joni> then a rubber to the larger spool
[18:37:46] <alex_joni> roughly 1:2 reduction
[18:37:55] <jmkasunich> still seems way way too low
[18:38:06] <jmkasunich> one rev of the motor moves how much wire?
[18:38:08] <jmkasunich> 50mm?
[18:38:10] <jmkasunich> 100mm?
[18:38:49] <jmkasunich> just need a swag
[18:40:25] <alex_joni> hang on..
[18:40:33] <alex_joni> I managed to reduce the reduction further
[18:40:44] <alex_joni> give me a minute to check how much
[18:42:53] <alex_joni> now I'm 1:4
[18:42:58] <alex_joni> and about 35mm / motor rev
[18:43:03] <jmkasunich> ok
[18:43:21] <jmkasunich> do you know the motor speed at any particular supply voltage?
[18:43:26] <jmkasunich> (unloaded)
[18:43:25] <alex_joni> encoders are mouse wheels + IR sensors
[18:43:39] <alex_joni> I think 4000 RPM at 9V
[18:43:52] <alex_joni> that's from the datasheet
[18:43:55] <jmkasunich> seems high for a cassette recorder
[18:43:56] <jmkasunich> ok
[18:44:08] <jmkasunich> these were capstan motors?
[18:44:20] <alex_joni> what's a capstan motor?
[18:44:35] <jmkasunich> the round rod that turns to drive the tape past the tape head is the capstan
[18:44:45] <jmkasunich> ususally its just the motor shaft itself
[18:44:50] <SWPadnos> the capstan is the thing that makes the tape move at a constant speed, regardless of the tape position
[18:44:56] <SWPadnos> (on the reels)
[18:45:10] <alex_joni> then probably yes
[18:45:14] <jmkasunich> a rubber roller pinches the tape against the capstan
[18:45:17] <alex_joni> they had some electronics inside for constant rpm
[18:45:29] <jmkasunich> what is the shaft diameter (approximately)
[18:45:38] <alex_joni> about 1mm or less
[18:46:00] <alex_joni> but now I have the spindle support glued on it
[18:46:00] <jmkasunich> oh, ok
[18:46:06] <alex_joni> roughly 5-6mm diameter
[18:46:18] <jmkasunich> I was sanity checking the 4000 RPM number
[18:46:22] <jmkasunich> it seems OK
[18:46:37] <alex_joni> http://www.ewinson.com/eg530yd.htm
[18:46:53] <jmkasunich> standard cassette speed is 1-7/8 ips = 2857mm/min
[18:46:54] <alex_joni> first one
[18:47:23] <jmkasunich> oh, specs and everything!
[18:47:46] <jmkasunich> milli-Newton-meters ;-(
[18:48:24] <alex_joni> I expect about 50g payload or such
[18:49:26] <jmkasunich> rated torque on the motor will give you 0.18N of line tension
[18:50:03] <jmkasunich> how about 18gm
[18:50:12] <alex_joni> eek
[18:50:26] <alex_joni> wonder if friction isn't close to that
[18:50:41] <jmkasunich> 35mm per rev gives you an effective spool diameter of 11.14mm
[18:50:54] <jmkasunich> so effective spool radius is 5.57mm
[18:50:59] <alex_joni> right
[18:51:43] <jmkasunich> 0.98Nmm / 5.57 mm radius = 0.1759N = 17.95 gm
[18:53:12] <jmkasunich> meanwhile, 2000RPM = 70 meters per minute
[18:53:30] <jmkasunich> you need to gear it down by an order of magnitude
[18:54:15] <jmkasunich> which is probably impossible at this point, right?
[18:54:17] <jmkasunich> (out of time)
[18:54:21] <alex_joni> right
[18:54:29] <alex_joni> and it would mean a complete redesign of parts
[18:54:48] <jmkasunich> alex_joni should have done the math first ;-(
[18:56:20] <alex_joni> weeell.. I got here afterwards
[18:56:25] <jmkasunich> oh
[18:56:38] <jmkasunich> so your friend should have done the math first
[18:56:41] <alex_joni> didn't see the motors/setup until a couple of days ago
[18:56:45] <alex_joni> yup
[18:57:09] <jmkasunich> how different is it from your tripod?
[18:57:20] <alex_joni> not that much
[18:57:26] <alex_joni> except it's a servo app
[18:57:40] <jmkasunich> still 3 motors, and approximately 2D travel?
[18:57:45] <alex_joni> 4 motors
[18:57:49] <alex_joni> and 3D travel
[18:57:58] <jmkasunich> ok, thats pretty different to me
[18:58:03] <jmkasunich> completely different in fact
[18:58:14] <alex_joni> the 4th motor is not really needed
[18:58:23] <alex_joni> I had 3 motors and 3d travel
[18:58:33] <alex_joni> just not enough weight to show the 3D travel
[18:58:47] <jmkasunich> so is the 4th motor pulling down?
[18:59:02] <alex_joni> no, they are placed on a square
[18:59:09] <jmkasunich> eww
[18:59:18] <jmkasunich> mathematically indeterminate
[18:59:17] <alex_joni> like I said.. the 4th motor is not really usefull/needed
[18:59:26] <alex_joni> overdetermintated
[19:00:23] <jmkasunich> got any pics of the thing?
[19:00:32] <alex_joni> I can upload some in a few minutes
[19:00:36] <jmkasunich> * jmkasunich is trying to figure out a way to save it
[19:02:08] <jmkasunich> can you remove the motor shaft spool, and have the shaft drive the outside of the main spool by friction?
[19:02:45] <alex_joni> not anymore..
[19:02:47] <alex_joni> it's glued
[19:02:49] <alex_joni> :(
[19:03:04] <jmkasunich> what is it made of?
[19:03:17] <alex_joni> metal
[19:03:20] <jmkasunich> what kind of glue?
[19:03:39] <alex_joni> something sticky :P
[19:03:48] <alex_joni> like superglue or something like that
[19:03:52] <alex_joni> fast glue on
[19:03:56] <jmkasunich> most glues get less sticky at 200C or so
[19:04:03] <jmkasunich> apply fire
[19:04:14] <alex_joni> right.. that might work.. hopefully not damaging the motor
[19:04:25] <jmkasunich> the drawing says the shaft is actually 2mm, but you said 1mm or less
[19:04:27] <jmkasunich> which is right?
[19:05:33] <jmkasunich> superglue is also brittle - if you can support the spool and hit the end of the shaft with a punch you might be able to drive it out
[19:05:42] <alex_joni> ok, I'm on a different PC
[19:06:13] <alex_joni> it's 2 mm
[19:06:22] <alex_joni> I estimated it wrongly
[19:06:36] <jmkasunich> and the spool is 5-6mm
[19:06:43] <jmkasunich> so at best you'll gain 3x
[19:07:32] <alex_joni> yes
[19:07:42] <jmkasunich> and that assumes that you can mount the motor to drive the main spool OD without slippage or excessive friction
[19:08:06] <jmkasunich> this needs to be done monday, right?
[19:09:11] <alex_joni> pics coming up
[19:10:00] <alex_joni>
[19:10:08] <alex_joni> let me know if it works
[19:11:07] <jmkasunich> seems to
[19:11:09] <alex_joni> actually tomorrow morning
[19:11:21] <jmkasunich> I thought you said the motor spools were metal
[19:11:25] <jmkasunich> look plastic to me
[19:11:43] <alex_joni> the spools are plastic
[19:11:58] <alex_joni> look at pic 17
[19:12:04] <jmkasunich> thats what I'm looking at
[19:12:12] <alex_joni> motor is on the left
[19:12:17] <jmkasunich> the wire is going to wind up on the big spool
[19:12:23] <jmkasunich> and you are doing a belt/pulley drive
[19:12:27] <jmkasunich> right?
[19:12:26] <alex_joni> there's a whiter spool on the motor
[19:12:32] <alex_joni> right
[19:12:40] <jmkasunich> the belt is a rubber band or similar?
[19:12:43] <alex_joni> the white spool on the left I just took out completely
[19:12:50] <alex_joni> rubber belt
[19:13:00] <jmkasunich> so now you have the 2mm shaft of the motor driving the belt?
[19:13:12] <alex_joni> but that's not the motor shaft you're seeing there
[19:13:24] <jmkasunich> oh, the plastic pulley has a metal hub?
[19:13:27] <alex_joni> yeah
[19:13:36] <jmkasunich> how big is the big spool?
[19:13:40] <jmkasunich> 50mm dia?
[19:13:55] <alex_joni> the stuff glued to the motor shaft is OD 8mm
[19:14:14] <jmkasunich> so if you could get that crap off you'd have a 4x improvement
[19:14:14] <alex_joni> the big spool is 35mm OD
[19:15:12] <jmkasunich> the wire winds up in a groove in the big spool, ~30mm diameter?
[19:15:20] <jmkasunich> and the belt runs in another groove, also about 30mm?
[19:16:25] <alex_joni> the wire winds up in a groove about 43mm
[19:16:30] <alex_joni> the belt runs in a groove about 30 mm
[19:16:44] <jmkasunich> how can you have a 43mm groove in a part that is 35mm OD?
[19:17:03] <alex_joni> I meant the part where the belt is
[19:17:21] <jmkasunich> ok, so the actual OD of the big spool is close to 50mm
[19:17:34] <alex_joni> yes
[19:18:07] <jmkasunich> somebody lathed the spools specifically for this project?
[19:18:14] <alex_joni> yeah
[19:18:33] <alex_joni> but that was before the motor was bought
[19:18:49] <alex_joni> actually he ordered some other motors (with a gearhead on them)
[19:18:51] <jmkasunich> whats the chances of making the belt pulley part bigger, or the wire winding part smaller
[19:19:00] <alex_joni> but those aren't here yet
[19:19:05] <jmkasunich> I see
[19:19:36] <jmkasunich> so he wasn't just being dense - he had a plan that would have given him acceptable torque, but the supplier didn't come through
[19:19:57] <alex_joni> yeah, he got the motors from somewhere else as a failsafe
[19:20:14] <alex_joni> the only ones similar in size/voltage he could find
[19:22:46] <alex_joni> ok,I just had an idea
[19:22:50] <jmkasunich> if you can get rid of the metal hub and let the belt run on the 2mm shaft, you should get 69gm
[19:22:56] <alex_joni> I'll glue the small spool on top of the big one
[19:23:06] <alex_joni> and run the wire there
[19:23:29] <jmkasunich> will that hold enough wire? and will the wire bend that tight?
[19:23:45] <alex_joni> yeah, it's fishing line at this point
[19:24:00] <jmkasunich> what is the diameter of the small spool
[19:24:03] <alex_joni> 20mm
[19:24:09] <alex_joni> in the groove
[19:24:26] <jmkasunich> that will get you up to 150gm if you use the 2mm motor shaft
[19:24:52] <jmkasunich> if you stick with the 8mm metal thing, you only get 37.5gm even with the small spool on top of the big one
[19:25:13] <alex_joni> I don't have a problem with 37g
[19:25:15] <alex_joni> at this point
[19:25:26] <jmkasunich> I really think you gotta figure out how to un-glue the metal from the motor
[19:25:44] <alex_joni> I'm not sure the rubber bands are small enough to do that
[19:25:55] <alex_joni> they aren't that tight on the metal now..
[19:26:02] <jmkasunich> and you can't find alternative rubber bands?
[19:26:14] <alex_joni> I think it will start to slip on the 2mm shaft
[19:26:24] <alex_joni> not at this time (10PM here;)
[19:26:29] <jmkasunich> crap
[19:27:01] <jmkasunich> how is the large spool mounted? could you turn it over so the rubber band runs on the 43mm groove instead of the 30mm groove
[19:27:29] <jmkasunich> that will help the ratio even if you are still using the 8mm metal thing, and it might take up enough slack to let you use the 2mm
[19:27:55] <jmkasunich> 8mm -> 43mm, 20mm winding wire = 53gm
[19:28:11] <jmkasunich> 2mm -> 43 mm, 20mm winding wire = 215gm
[19:28:19] <alex_joni> nope,not gonna work
[19:28:27] <jmkasunich> darn
[19:28:35] <jmkasunich> can't flip it over?
[19:28:43] <alex_joni> as it is now, no
[19:29:00] <alex_joni> the smaller part of it actually is inside a channel
[19:29:12] <alex_joni> the larger part won't fit in there
[19:29:21] <jmkasunich> so the best you can do is 8mm driving 30mm, and 20mm winding wire
[19:29:26] <alex_joni> yes
[19:29:37] <jmkasunich> 37.5gm, not counting friction losses
[19:29:48] <jmkasunich> yuck
[19:30:08] <alex_joni> 8mm driving 35mm, and 20mm winding wire/thread
[19:30:23] <jmkasunich> 43gm
[19:30:32] <alex_joni> I just measured one of them
[19:30:42] <jmkasunich> * jmkasunich has a spreadsheet for the calcs ;-)
[19:31:13] <alex_joni> ok, so I guess that's the best we can do right now
[19:31:20] <jmkasunich> 28m/min at 2000 RPM
[19:31:34] <jmkasunich> you got plenty of speed ;-)
[19:32:13] <alex_joni> yeah, too bad that's not really helpfull
[19:32:20] <jmkasunich> how is the encoder driven? from the rollers on the upper right in pic 17?
[19:32:29] <alex_joni> right
[19:32:40] <alex_joni> but in the mean time it's only one roll
[19:32:48] <alex_joni> with a wire loop over it
[19:32:52] <jmkasunich> too much speed is exactly the problem - you need LOTS more reduction to trade speed for torque
[19:33:58] <alex_joni> hmm.. I can try to reduce the diameter of the wire spool
[19:34:16] <alex_joni> would about 4mm help? (instead of the 20mm now) ?
[19:34:18] <jmkasunich> you're not gonna be able to radically reduce it
[19:34:31] <alex_joni> I can try to turn a new spool and glue that one ontop of the big one
[19:34:32] <jmkasunich> you mean 4mm dia? or 4mm less than it is now?
[19:34:38] <alex_joni> 4mm dia
[19:34:55] <alex_joni> I'm not sure I can turn a smaller one without breaking it
[19:34:55] <jmkasunich> 8 driving 35, and 4 winding = 218gms
[19:35:26] <jmkasunich> can you attack the string to a 4mm spool? and will the spool hold the neccessary amound of strong?
[19:35:30] <jmkasunich> string
[19:35:33] <jmkasunich> attach
[19:35:40] <jmkasunich> amount
[19:35:47] <jmkasunich> man, I can't spell worth crap
[19:38:13] <alex_joni> I only need about 200mm of travel
[19:38:27] <alex_joni> so that's not a lot of string
[19:38:55] <alex_joni> I have some 2 component material which I can model, then turn in the lathe
[19:39:18] <jmkasunich> 16 wraps of string on a 4mm spool = 200mm
[19:39:34] <alex_joni> yup, that's no issue
[19:39:45] <alex_joni> I think it's called 'cleading mass' ?
[19:40:27] <jmkasunich> ?
[19:40:36] <alex_joni> modelingclay
[19:40:38] <alex_joni> modeling clay
[19:40:43] <jmkasunich> ah, yes
[19:40:52] <jmkasunich> although it usually stays soft
[19:41:03] <alex_joni> this one turns to stone-like consistency
[19:41:03] <jmkasunich> if its two components that you mix and it gets hard, thats not clay
[19:41:08] <alex_joni> after 1-2 hours
[19:42:28] <alex_joni> I'll let my friend work on this now
[19:42:37] <jmkasunich> sounds like a plan
[19:43:01] <jmkasunich> I hope the friend isn't an engineering student - if so he should have done the math first
[21:54:39] <alex_joni> jmkasunich: still there?
[21:57:06] <jmkasunich> back for a few minutes
[21:57:17] <jmkasunich> (before I go mow the grass)
[21:57:27] <alex_joni> I just attached some weight to one of the motors
[21:57:41] <alex_joni> it takes about 37g to pull it down, and spin the encoder
[21:57:47] <alex_joni> (with the motor disconnected)
[21:57:54] <jmkasunich> so that is friction
[21:57:59] <alex_joni> right
[21:58:10] <alex_joni> you said 43g motor force
[21:58:42] <jmkasunich> not enough
[21:59:10] <alex_joni> sure?
[21:59:26] <jmkasunich> 6 grams of margin?
[21:59:43] <alex_joni> yeah
[21:59:47] <jmkasunich> doesn't seem like much at all
[22:00:33] <jmkasunich> a lot depends on how much of the 37gm is friction, and how much is motor cogging
[22:01:11] <jmkasunich> but in general, I'd want something like 2x margin
[22:08:31] <alex_joni> well.. it seems the motor spinning in the right way reduces that 37g
[22:08:49] <alex_joni> now I wonder how I should tune..
[22:09:13] <jmkasunich> no D
[22:09:25] <jmkasunich> your coarse encoder resolution will make it too noisy
[22:09:38] <jmkasunich> lots of I, to overcome steady state friction
[22:09:53] <alex_joni> P=50, I=50 ?
[22:10:07] <jmkasunich> no clue, to be honest, you'll have to experiment
[22:10:12] <alex_joni> I'll try..
[22:10:22] <alex_joni> the problem is I'm not sure how
[22:10:28] <alex_joni> movement is not really happening
[22:10:29] <jmkasunich> for starters, I'd try to understand output scaling
[22:10:50] <jmkasunich> what is the supply voltage? that will be the motor voltage at 100% duty cycle
[22:10:58] <alex_joni> supply voltage is 10V
[22:11:09] <alex_joni> motor voltage at 100% duty cycle is close to that
[22:11:12] <jmkasunich> how fast does the motor go at that speed? (from data sheet - answer is "way too fast")
[22:11:32] <alex_joni> any idea how to measure?
[22:11:37] <jmkasunich> so, you'll have nearly zero counterEMF at working speeds
[22:11:41] <jmkasunich> measure what? speed?
[22:11:45] <alex_joni> yeah..
[22:11:56] <alex_joni> I don't have unlimited wire amounts..
[22:12:17] <jmkasunich> you can measure Kv by spinning the motor at a known speed and measuring the armature voltage with a meter
[22:12:34] <jmkasunich> I usually use the drill press for that, long before I install a motor in something
[22:14:39] <jmkasunich> when you are running PWM straight to a 298, you are running voltage mode
[22:14:51] <alex_joni> right
[22:14:54] <jmkasunich> the motor terminal voltage (average) will be Vsupply * duty cycle
[22:15:03] <jmkasunich> inside the motor, that gets divided between three things
[22:15:18] <jmkasunich> L*dI/dT, R*I, and counter-emf
[22:15:42] <jmkasunich> the L term only matters when current is changing rapidly, and you can probably ignore it for the moment
[22:15:55] <jmkasunich> counter-emf = Kv * speed, and your speed is gonna be quite slow
[22:16:09] <jmkasunich> (compared to the no-load speed of the motor)
[22:16:24] <jmkasunich> so, the vast majority of your voltage drop will be I*R
[22:16:35] <jmkasunich> in a way thats good news
[22:16:41] <jmkasunich> it means that you almost have a current loop
[22:17:34] <jmkasunich> if you apply 6V to the motor, about 5.5 of it will appear across the I*R drop, and if you know the armature resistance, you can figure out the current, and thus the torque
[22:17:55] <jmkasunich> so for you, PWM duty cycle is approximately proportional to torque
[22:18:50] <jmkasunich> if would be good to figure out _roughtly_ what the scaling constant is
[22:19:08] <jmkasunich> IOW, 6V = ~ 50 grams on the string, or whatever
[22:19:51] <jmkasunich> try some experiments
[22:20:35] <jmkasunich> with no weight (and no string even), gradually increase the duty cycle until the motor moves
[22:20:51] <jmkasunich> do it both ways, hopefully they aren't too different
[22:21:00] <jmkasunich> thats a measure of friction in the pulley and spool
[22:21:18] <jmkasunich> then put a light weight on the string, and gradually increase duty cycle till it moves, again both ways
[22:21:29] <jmkasunich> then again with a heavier weight
[22:22:00] <jmkasunich> then you'll know how much additional duty cycle is needed per gram of weight
[22:24:25] <alex_joni> I see
[22:25:01] <alex_joni> deadband is between 2 ticks?
[22:25:06] <alex_joni> encoder ticks I mean..
[22:25:09] <jmkasunich> yeah
[22:25:24] <alex_joni> so 1/INPUT_SCALE + a bit
[22:25:27] <jmkasunich> yeah
[22:26:13] <alex_joni> hmm.. this is strange
[22:26:24] <alex_joni> I have the motor + pulley connected now (no wire)
[22:26:28] <alex_joni> so encoder doesn't move
[22:26:47] <alex_joni> but when I jog, I get a short move from the motor in the right direction, then it stops
[22:27:16] <jmkasunich> probably have some FF1
[22:27:23] <alex_joni> yeah
[22:27:31] <alex_joni> ff1=1
[22:27:38] <alex_joni> and probably I is too small?
[22:28:10] <jmkasunich> probably, but I have no idea
[22:28:18] <jmkasunich> thats why I wanted you to do those experients
[22:28:40] <jmkasunich> once you know what it takes to move things, then you can actually understand what the gains MEAN
[22:28:44] <alex_joni> I understand..
[22:28:50] <alex_joni> I'll do that now
[22:28:55] <jmkasunich> P of 50 means that if you have an error of 1mm, you will be getting an output of "50"
[22:29:10] <jmkasunich> but unless you know what "50" means to the motor, that doesn't tell you much
[22:32:41] <alex_joni> ok, I have about 24% duty cycle set for the pulleys to start moving (no load)
[22:36:06] <jmkasunich> its gonna be hard to tune, because you have a huge dead zone
[22:38:32] <cradek> can you eliminate the dead zone with min-dc?
[22:38:42] <jmkasunich> not really
[22:38:56] <jmkasunich> the command will still have to swing from +24% to -24% before anything happens
[22:39:02] <cradek> oh ok
[22:39:08] <jmkasunich> we need a lookup table component
[22:39:27] <cradek> yeah, some kind of generic transfer function
[22:39:48] <jmkasunich> so you could put in a non-linear transfer function whose output goes from 0 to 24% when the input goes from 0 to 1%, then goes from 24% to 100% as the input goes from 1% to 100%
[22:40:00] <cradek> right
[22:40:01] <jmkasunich> the reason I haven't written it is the pain of getting the curve into it
[22:40:13] <jmkasunich> you could use params, but that would suck for any more than a few points
[22:40:35] <alex_joni> send a gif :P
[22:40:44] <cradek> one can just write the function one needs with comp
[22:41:20] <jmkasunich> its hard to send a gif or any file to a kernel module
[22:43:03] <alex_joni> 38% for 27g
[22:43:27] <jmkasunich> so 14% increase to lift 27g, about 2g per %
[22:43:48] <alex_joni> I'll add 10g now, and check again
[22:46:56] <alex_joni> about 40-41% for 37g
[22:47:11] <alex_joni> maybe the 38% was too much..
[22:47:27] <jmkasunich> 38+5 = 43, not really that far off
[22:47:42] <alex_joni> yeah
[22:48:46] <alex_joni> ok, so 2g per %
[22:48:56] <alex_joni> I'll check for max weight now
[22:51:16] <alex_joni> about 68g at 100%
[22:51:30] <alex_joni> a bit more than we calc'ed
[22:51:44] <jmkasunich> we calced "rated" torque
[22:51:59] <alex_joni> yeah
[22:52:07] <jmkasunich> not "apply full voltage while the rotor is locked and draw excessive current" torque
[22:52:23] <alex_joni> ok, anything else I can measure?
[22:52:25] <jmkasunich> which you can do for a while, but isn't a good idea for long term operation
[22:52:37] <alex_joni> it needs to run about 1h :P
[22:52:42] <jmkasunich> heh
[22:52:48] <jmkasunich> good point
[22:52:51] <alex_joni> lifetime
[22:53:00] <alex_joni> anyways.. anything else to measure?
[22:53:26] <jmkasunich> the fact that full rated voltage only caused it to draw less than 200% current and make less than 200% torque means its a high resistance motor
[22:53:34] <jmkasunich> (not that we didn't know that already)
[22:53:45] <jmkasunich> now you'll know what the gain numbers mean
[22:54:01] <alex_joni> are you sure?
[22:54:08] <alex_joni> * alex_joni grins :P
[22:54:08] <jmkasunich> I'd scale things so the PID output is in percent
[22:54:46] <jmkasunich> so a pgain of 50 will mean 1mm of error = 50% output which is about 26% over the base friction level, or 13 grams of force
[22:55:10] <alex_joni> darn.. if it weren't 2am :/
[22:55:14] <jmkasunich> ouch
[22:55:16] <alex_joni> * alex_joni is thinking really slowly
[22:55:28] <jmkasunich> unfortunately I have to go mow the grass before it starts to get dark
[22:55:29] <alex_joni> care to give me a few pointers on the scaling?
[22:55:52] <jmkasunich> I think you want to set the pwmgen scale to 100
[22:56:12] <jmkasunich> that should result in "100" from the pid producing 100% (easy enough to verify)
[22:56:23] <alex_joni> right
[22:56:59] <alex_joni> pid.*.maxoutput = 100
[22:57:04] <alex_joni> right?
[22:57:08] <jmkasunich> yeah
[22:59:13] <alex_joni> ok, that should probably cover it?
[22:59:29] <jmkasunich> I think so
[22:59:32] <alex_joni> I'll try some numbers now
[22:59:42] <jmkasunich> increase gains (P and I) until it starts to oscillate, then back off
[22:59:42] <alex_joni> any FF1 ?
[22:59:45] <jmkasunich> usually P first
[23:00:05] <jmkasunich> I try FF1 after I have P and I working OK
[23:00:07] <alex_joni> I need some kind of motion for that
[23:00:24] <alex_joni> so far it's not really moving as I want it to
[23:00:30] <jmkasunich> if you have I gain, you _will_ get motion, unless your scale and or max output is all wrong
[23:00:40] <jmkasunich> the integrator will eventually wind up enough to make it move
[23:00:47] <jmkasunich> if it doesn't move, up the gains
[23:01:13] <alex_joni> if it sits still.. it shouldn't try to move .. right?
[23:01:21] <alex_joni> so I need to either command some movement
[23:01:28] <alex_joni> or move the encoder a bit?
[23:01:29] <jmkasunich> yes ;-)
[23:01:32] <jmkasunich> command movement
[23:01:37] <alex_joni> jog ok?
[23:01:44] <jmkasunich> scope the command, fb, error, and output
[23:01:49] <jmkasunich> trigger on the commanded move
[23:01:53] <alex_joni> ok
[23:03:58] <alex_joni> output as in pid output?
[23:04:19] <jmkasunich> yes
[23:07:01] <jmkasunich> outside with me... good luck
[23:07:05] <alex_joni> ty
[23:07:07] <jmkasunich> don't stay up all night