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