#garfield Logs

Jan 09 2023

#garfield Calendar

02:12 AM rue_mohr: polprog, wait, what IS a lock-in amplifier?
02:49 AM rue_shop3: so
02:51 AM rue_shop3: 19% to stop
02:51 AM rue_shop1: its a 1800 line encoder
02:51 AM rue_shop1: so 7200 counts
02:52 AM rue_shop1: stopping takes 19%
02:52 AM rue_shop1: so, forward for 1368 counts, then reverse
02:52 AM rue_shop1: nope
02:52 AM rue_shop1: reverse that
02:53 AM rue_shop1: 5832 counts forward, then 1368 reverse
02:53 AM rue_shop1: but
02:53 AM rue_shop1: how do we make sure it stops in the right place?
02:54 AM rue_shop1: by the 5832 counts, its already basically hit max velocity
02:55 AM rue_shop1: so 1368 could be considered a minimum stopping distance
02:56 AM rue_shop1: I should go to bed early tonight
02:56 AM rue_shop1: erp too late, its 1am
02:57 AM rue_shop1: so, the question is, how to we garuntee we stop where we want
02:57 AM rue_shop1: especially under dynamtic loads
02:57 AM rue_shop1: thats why I think we should use velocity control
02:58 AM rue_shop1: and we use the position as markers to change velocity
02:58 AM rue_shop1: hmm not even so much velocity
02:59 AM rue_shop1: because we dont care about the shape that much
02:59 AM rue_shop1: as long as we stop in posiion
02:59 AM rue_shop1: and, if, due to the load, we cant make velocity, we dont care
03:00 AM rue_shop1: so, you want to do positioning without velocity control
03:00 AM rue_shop1: yes
03:01 AM rue_shop1: because you dont care what the velocity is
03:01 AM rue_shop1: exactly
03:01 AM rue_shop1: you have to care about soemthing or you will miss the target position
03:02 AM rue_shop1: can we just jump right over velocity and do acceleration
03:02 AM rue_shop1: you can control the acceleration, your maxing out the driver
03:03 AM rue_shop1: it seems to me, that stopping is the hard part
03:03 AM rue_shop1: and that, there are two things to know about stopping,
03:03 AM rue_shop1: - when to start stopping
03:03 AM rue_shop1: - how long its going to take to stop
03:04 AM rue_shop1: which is kinda the same thing, BUT if you modulate the stopping force you might be able to do a controled landing
03:05 AM rue_shop1: there is also the problem of figuring out if its stopped or not
03:05 AM rue_shop1: tho
03:05 AM rue_shop1: if we over-kick it into a slow rollback
03:06 AM rue_shop1: we can know the velocity will be in a certiain range
03:06 AM rue_shop1: hmm, that coupled with the fact that we do have a few counts for error
03:07 AM rue_shop1: so, your saying , +- we kick it into reverse *just* untill we see it reverse, then give it a *tiny* kick forward again
03:07 AM rue_shop1: it also occurs to me, that if these drives were non-backdrivable, life would be easier
03:08 AM rue_shop1: 144:1 would be a LOT smaller as a worm drive
03:08 AM rue_shop1: there is no reason the cnc, either of them, need to be back-drivable
03:09 AM rue_shop1: I...
03:09 AM rue_shop1: cant see how it wouldn't work
03:10 AM rue_shop1: well, I see a thing
03:10 AM rue_shop1: we were gonna use a belt drive to prevent drive play
03:10 AM rue_shop1: can we do anti-lash on a worm drive?
03:11 AM rue_shop1: why not?
03:11 AM rue_shop1: the plasma is a great test ground, really low resolution
03:11 AM rue_shop1: so tommroow shall we make some worm drives?
03:11 AM rue_shop1: maybe put an encoder on one you already have?
03:12 AM rue_shop1: but, we dont need to
03:12 AM rue_shop1: what?
03:12 AM rue_shop1: we just need to control the motor, the worm drive is inncodental
03:13 AM rue_shop1: were going to need more practice with what to do during concurrent steps anyhow
03:13 AM rue_shop1: so far its just been about 1 isolated step
03:13 AM rue_shop1: so, maybe if we try to hit like 8 steps
03:13 AM rue_shop1: 10
03:13 AM rue_shop1: 10?
03:13 AM rue_shop1: for the plasma cnc we need 10 steps
03:14 AM rue_shop1: but if were going to switch to a worm drive, were not subject to the ratio we made anymore
03:14 AM rue_shop1: hmm
03:14 AM rue_shop1: I think we just pulled up all the nails holding our design down
03:14 AM rue_shop1: hey look
03:14 AM rue_shop1: what
03:15 AM rue_shop1: the limits went with it
03:15 AM rue_shop1: har har
03:15 AM rue_shop1: so?
03:15 AM rue_shop1: so, we figure out how to stop a motor shaft
03:15 AM rue_shop1: *just* till rollback
03:15 AM rue_shop1: yes
03:15 AM rue_shop1: I think we can code that
03:17 AM rue_shop1: so, assume a stopping distance of 1368 counts
03:17 AM rue_shop1: I see two problems
03:18 AM rue_shop1: whch are?
03:18 AM rue_shop1: overshoot, and undershoot
03:18 AM rue_shop1: in either situation we need to know about our velocity
03:20 AM rue_shop1: see, the microcontroller cant just say "if I put it in reverse now, I'll stop right on the mark"
03:20 AM rue_shop1: yes, but keep in mind the mark has width
03:21 AM rue_shop1: what was it? +- 4 lines?
03:21 AM rue_shop1: still, if the tires are sliding, your too late, nothing you can do to stop on the line
03:21 AM rue_shop1: even if its thick
03:22 AM rue_shop1: it implies you put the brakes on early and back off if your stopping too early
03:22 AM rue_shop1: this implies knowing the velocity
03:22 AM rue_shop1: which implies doing a controlled velocity stop
03:22 AM rue_shop1: how do you land on a position if your not doing a controled velocity stop?
03:23 AM rue_shop1: so, we do an uncontrolled run, with a controlled stop
03:24 AM rue_shop1: because its a step, we dont care what the middle looks like
03:24 AM rue_shop1: its beyond the controlled resolution
03:25 AM rue_shop1: what if we dont do a controlled velocity stop
03:25 AM rue_shop1: oh do tell
03:25 AM rue_shop1: what if we do a position/time stop
03:25 AM rue_shop1: dude, thats velocity
03:26 AM rue_shop1: no, not like that
03:26 AM rue_shop1: uhu
03:26 AM rue_shop1: like for every step, we uh
03:26 AM rue_shop1: see? thats velocity control
03:26 AM rue_shop1: yea but I'm not talking about control like that
03:27 AM rue_shop1: try to use your words
03:27 AM rue_shop1: oh shut up
03:27 AM rue_shop1: so, we put it in reverse
03:27 AM rue_shop1: yes thts the first step
03:27 AM rue_shop1: and
03:28 AM rue_shop1: position starts getting counted off
03:28 AM rue_shop1: yea
03:28 AM rue_shop1: so we can subtract from our runway length
03:28 AM rue_shop1: uhu
03:28 AM rue_shop1: at a point
03:28 AM rue_shop1: I'm presuming your starting the decel early
03:28 AM rue_shop1: sure
03:29 AM rue_shop1: at a point we can have like a velocity trigger
03:29 AM rue_shop1: uhu
03:29 AM rue_shop1: where by, were at a velocity we know how long it takes to stop from
03:29 AM rue_shop1: ah, break it down into a runway and a taxi lane
03:30 AM rue_shop1: sure
03:30 AM rue_shop1: so cut off the main reverse at the taxi speed
03:31 AM rue_shop1: then do a second brake pulse that cancels the known taxi speed with a known reverse impluse
03:31 AM rue_shop1: you DO realize that even the stepper bounces off the rails a few times in the process of getting to position
03:32 AM rue_shop1: you suggesting we allow overshoot and bounce a few times?
03:32 AM rue_shop1: I'm saying it'd be ok, its part of our acceptable profile
03:33 AM rue_shop1: it would help if we could do cause/effect on this
03:34 AM rue_shop1: record how long a stop takes and adjust
03:34 AM rue_shop1: do you think we could land it between the marks each time
03:34 AM rue_shop1: if that open loop step test doesn't prove it I'll be darned
03:35 AM rue_shop1: what about the idea of mixing the backemf feedback
03:35 AM rue_shop1: we CAN just add a tach if you want
03:35 AM rue_shop1: atleast with a tach we could know our velocity
04:37 AM Tom_L: .
04:37 AM rue_mohr: yes
04:45 AM Tom_L: http://tom-itx.no-ip.biz:81/~webpage/cnc/configs/orient_error.png
04:45 AM Tom_L: http://tom-itx.no-ip.biz:81/~webpage/cnc/configs/orient_error.txt
04:45 AM Tom_L: still working on it
04:46 AM rue_mohr: oh
04:46 AM rue_mohr: wait
04:46 AM rue_mohr: so its an emc problem or a your hardware problem
04:46 AM Tom_L: yes
04:46 AM Tom_L: :)
04:47 AM rue_mohr: mess
04:47 AM Tom_L: code isn't quite right yet
04:47 AM rue_mohr: but it was
04:47 AM rue_mohr: for the old machine
04:47 AM Tom_L: doesn't require all the old one had
04:48 AM Tom_L: and i didn't have the 2nd PID loop in yet but i think it requires it
04:48 AM Tom_L: so then you have to add an 'or' component to choose between the two
04:48 AM rue_mohr: that video I was watching yesterday was interseting
04:49 AM Tom_L: use this one for normal operation, use that one for spindle orient
04:49 AM rue_mohr: I was prettymuch able to stay up with it
04:49 AM Tom_L: what video?
04:49 AM rue_mohr: the instructor took two hard corners that I had to drift on, but was able to keep following
04:49 AM rue_mohr: the one I posted the link for
04:49 AM rue_mohr: about motor control
04:49 AM rue_mohr: its too far back for me to find now
04:49 AM Tom_L: oh
04:50 AM rue_mohr: what does T8 M6 do?
04:51 AM rue_mohr: S2000 M3 is for 2000 rpm yes?
04:55 AM Tom_L: yes
04:55 AM Tom_L: T is tool M6 is change
04:56 AM Tom_L: S spindle speed M3 turn on fwd
04:56 AM Tom_L: the orient code is sprinkled all thru the config so it takes a bit to find it all
01:22 PM polprog: rue_mohr: imagine you need to measure something, but you have a ton of noise
01:22 PM polprog: Like, you want to measure a signal sent by an IR remote
01:22 PM polprog: and there is noise from the CCFLs and everything else
01:23 PM polprog: So you add modulation, right? 34, 35, 36 etc kHz for remotes
01:23 PM polprog: and then to detect it, you demodulate it and then measure the demodulated level, right?
01:23 PM polprog: So the same thing can be done in any measurement where you need to fight noise
01:24 PM polprog: Say, you want to measure something
01:24 PM polprog: you have a detector and a driven element
01:25 PM polprog: like i dont know, a laser and a photodiode
01:25 PM polprog: i cant come up with another example
01:25 PM polprog: the thing is - instead of shining the laser always on
01:25 PM polprog: you modulate it, to some frequency
01:25 PM polprog: then the lock in amplifier is basically a demodulator with a voltmeter stuck to it
01:25 PM polprog: you dial in the same frequency on the lock in and the voltmeter needle peaks
01:26 PM polprog: Now you got rid of (very cery large part of) the noise
01:26 PM polprog: so it's like an IR demodulator but the freuquency is not fixed
01:26 PM polprog: you adjust it on the front panel
01:26 PM polprog: and the result is the demodulated level
01:27 PM polprog: the thing is that whatever you are measuring will attenuate the laser more or less
01:27 PM polprog: and the lock in will detect that attenuation level
01:28 PM polprog: you loose the absolute value measurement but the ratio is still kept
01:28 PM polprog: so if you want to measure how opaque something is, you shine a laser at the detector, note down the lock in reading
01:28 PM polprog: then put the thing in the laser beam so that it occludes it and note down the reading again
01:29 PM polprog: and the ratio of these is your result
01:30 PM rue_mohr: oh hi
01:31 PM rue_mohr: ah
02:54 PM polprog: hi
03:23 PM aandrew: polprog: isn't that exactly what chopper-stabilized op amps do? they basically shift the signal up then shift it back after the amplification/filtering/whatever to get rid of the DC offset?
03:26 PM polprog: its all related, but a lock in amplifier is an instrument that you can use easily in a lab environment
03:26 PM polprog: think about a wideband 100Hz - 100kHz radio with a level meter
03:26 PM polprog: radio receiver*
03:55 PM rue_mohr: chopper! tahts was it!
03:56 PM rue_mohr: choppers are good for really high gain, of really low frequency signals, they delete the dc offset
04:26 PM rue_mohr: then rebuild it
05:22 PM rue_mohr: there is a math I didn't do
05:22 PM rue_mohr: on the big cnc
05:22 PM rue_mohr: the resolution is 0.1mm
05:22 PM rue_mohr: and I want it to jog at 1m/s
05:23 PM rue_mohr: thats 100kHz step rate
05:23 PM rue_mohr: hey tom, could you ask the kid what the max jog rate is on the huge machine?
05:35 PM Tom_L: somewhere in the 2000 ipm iirc
05:35 PM Tom_L: maybe more
05:35 PM Tom_L: oh on the cincinnati?
05:35 PM Tom_L: i dunno
05:38 PM Tom_L: he said the one that does hard metal is 200ipm & the aluminum is around 600ipm rapid
05:50 PM rue_shop3: arg power outages
06:43 PM aandrew: Tom_L> somewhere in the 2000 ipm iirc
06:43 PM aandrew: lol I read that as the 2000 international plowing match
06:48 PM rue_shop3: 1 delay unit is about 0.69us
06:48 PM Tom_L: rue_shop3, why were you asking?
06:49 PM rue_shop3: so about 0.84m/s ok
06:49 PM rue_shop3: Idea of how they dealt with the scaling
06:49 PM Tom_L: my mill does 210ipm
06:55 PM rue_mohr: I doubt the big machine uses a step/direction interface ;]
07:25 PM Tom_L: dunno why not
07:25 PM Tom_L: most likely servo amps
07:36 PM rue_mohr: probabyl not stepped tho
07:37 PM rue_mohr: probably velocity controlled vectors
07:50 PM Tom_L: a guy in town retrofitted a single spindle cincinnati with linuxcnc
07:50 PM rue_mohr: k
07:51 PM rue_mohr: did he have to redo the motors?
07:56 PM Tom_L: i've no idea but i don't think so
07:56 PM Tom_L: he used the original amps
07:56 PM Tom_L: afik
07:57 PM Tom_L: he's since retired and took down all his videos of it
08:07 PM aandrew: https://imgur.com/gallery/yUUNPHc HAHAHAHAHAHA now I’m sad
08:07 PM rue_mohr: damnit
08:07 PM rue_mohr: whats the image link on htat?
08:08 PM aandrew: https://i.imgur.com/p07Gh7f.jpeg
08:08 PM rue_mohr: apparently my browsers core was used by a lot of web bots, so they see that core and block sending content to me
08:08 PM rue_mohr: heh
08:08 PM aandrew: You have very… unique computer troubles
08:09 PM rue_mohr: I cant update firefox or I lose kompozer
08:09 PM rue_mohr: there are NO gui html editors anymore
08:09 PM rue_mohr: kompozer was the last one
08:09 PM rue_mohr: I CAN create html content wysiwyg in an email editor, but I cant load and modify existing content
08:10 PM rue_mohr: EVERYONE hand codes web pages right now
08:10 PM rue_mohr: its 2023
08:10 PM rue_mohr: we went backwards
08:10 PM rue_mohr: in 2023 you cant select text for a page and click 'center'
08:11 PM rue_mohr: you have to apply a CSS type and then go write a css rule for it
08:11 PM rue_mohr: W T F
08:11 PM rue_mohr: and people who are doing it are oblivious that any other way makes sense
08:12 PM rue_mohr: maybe in 2024 we will do away with high level languages and code everything in processor specific assembler
08:13 PM rue_mohr: I want to wrap kompozer into a docker image and have no idea how
08:15 PM rue_mohr: polprog, see if you can hook a camera up to it and install python3
08:35 PM rue_shop3: ok, if 1 rev was about 40Hz
08:35 PM rue_shop3: we would expect a half rev to be about 80Hz, right?
09:55 PM rue_mohr: 20.41hz 19%
09:55 PM rue_shop3: that explains it
10:02 PM aandrew: rue_shop3: why not leave firefox alone (pin it) and use chrome or another user instance with a "local" version of firefox?
10:02 PM aandrew: or the opposite - have a komposer user which has the specific version of firefox and your normal user for something newer
10:03 PM aandrew: that's one thing I really like about running linux on the desktop, that kind of thing is a lot easier there
10:19 PM rue_shop3: 1/3 is 33.56Hz, 25.5%
10:19 PM rue_shop3: aandrew, system library conflicts
10:27 PM aandrew: rue_shop3: chroot?
10:27 PM aandrew: I realize it's a game of whack-a-mole and yes, something like a docker instance would be great but I also have zero clue on how to set that kind of thing up
10:27 PM rue_mohr: yea
10:29 PM rue_mohr: I dont have a thing ti root out the dependecy tree for me
10:30 PM aandrew: might be easier to just clone your existing HD and use that as the basis of the docker image
10:31 PM aandrew: not clean but would work
10:38 PM rue_mohr: ~
10:39 PM rue_mohr: I need to make a copy of it and see if it runs with a 64 bit kernel
10:44 PM aandrew: a VM with ssh -X would also work well
10:45 PM rue_mohr: ... or a different machine
10:45 PM rue_mohr: that just has web browsers instlled that I can upgarde every 6 months and not care