Prev: Triac controller IC
Next: RTD linearization
From: Jan Panteltje on 13 Dec 2009 05:09 On a sunny day (Sat, 12 Dec 2009 15:41:16 -0800) it happened Jon Kirwan <jonk(a)infinitefactors.org> wrote in <l0a8i5tf3oqjl0rkke90s6soi8kc3sot27(a)4ax.com>: >Accelerometers require power and in this case to be usable would need >to be attached to her (non-trivial) and powered continuously. I >couldn't sample them, periodically, because I'd need to know "right >away" and sampling couldn't occur once a minute or once every 10 >seconds. It would have to be relatively continuous and this places a >burden on the power source. Besides the difficulty of keeping it on >her, somehow, without her clawing it off. And did I mention RF? More >power, though that could be used only upon "detection." > >False positives are okay. Up to a point. She is very active, skips >and dances a lot and loves to jump up and down while clapping her >hands together, laughing and giggling loudly. She is very happy, by >and large. I'm not sure how to hew very close to zero false negatives >while keeping false positives to a "dull roar" here. Something may >come to mind, so I'll keep this in view. But right now I'm not sure >how to deal with continuous sampling, power, keeping such a thing >attached to her, together with usable detection negative/positive >rates -- algorithms. Good ideas there may help push me along that >line, though. > >Jon Photocell power? Yes, but I was actually thinking about sampling hundreds of times per second. I dunno how much power, as a alternative to an accelerometer a movable magnet in a coil (remember the old magnetic phone cartridges) could be used as a zero power consuming vibration detector. This is what I thought after writing that posting, and a night sleep: OK, this is how *I* would proceed, that is not how you or anyone else should proceed, but how I would proceed based on what I know and have done in the past. I would start with making some bracelet or belt with a 3 axis acceleration sensor. The sensor would be sampled by a small PIC with ADC, and I would compose a SDLC or HDLC packet. That is to say a sync byte, some data bytes, and CRC. This I would connect to one of those 430 MHz (free band) transmitters. Those are the size of a dime, I have one here to remote control the lights. The range of those is maybe 10 meters or less. In the same room I would have a receiver for that. Cable from that receiver to the PC elsewhere. Digital data stream, twisted cable, perhaps optical. In the PC a card with a 8035 SCC or similar, to decode the packets. Hang on a huge harddisk, construct a data format, few bytes, say n samples per second, some bytes (x, y, z, i, t), where 'i' can hold some extra data, markers, what not. time stamp. Then I would just let it run, recording data 24/7, and mark the times when there are seizures. The advantage is that you do not have to bother the person, you can do any further testing and development on the PC in non-real time. What you MUST do however is mark the times that each seizure occurs. Then, after collecting some real data, have a look at the data, maybe do a FFT to look for any specific vibrations that may precede or indicate a seizure. Then it is perhaps just a case of counting times between pulses.. If all else fails, set up a simple neural net, there are many, at least for Linux, neural net programs available for free. Some net topology, and run the data through it together with the signals when the seizure really happened. The net will learn what you yourself have learned, maybe even better and 100% attentive. From that, over time, you can get a reliable system, by having the PC alert you. If it works , and why not, you can market it and make a buck or 2 too.
From: Jon Kirwan on 13 Dec 2009 05:46 On Sun, 13 Dec 2009 10:09:02 GMT, Jan Panteltje <pNaonStpealmtje(a)yahoo.com> wrote: >On a sunny day (Sat, 12 Dec 2009 15:41:16 -0800) it happened Jon Kirwan ><jonk(a)infinitefactors.org> wrote in ><l0a8i5tf3oqjl0rkke90s6soi8kc3sot27(a)4ax.com>: > >>Accelerometers require power and in this case to be usable would need >>to be attached to her (non-trivial) and powered continuously. I >>couldn't sample them, periodically, because I'd need to know "right >>away" and sampling couldn't occur once a minute or once every 10 >>seconds. It would have to be relatively continuous and this places a >>burden on the power source. Besides the difficulty of keeping it on >>her, somehow, without her clawing it off. And did I mention RF? More >>power, though that could be used only upon "detection." >> >>False positives are okay. Up to a point. She is very active, skips >>and dances a lot and loves to jump up and down while clapping her >>hands together, laughing and giggling loudly. She is very happy, by >>and large. I'm not sure how to hew very close to zero false negatives >>while keeping false positives to a "dull roar" here. Something may >>come to mind, so I'll keep this in view. But right now I'm not sure >>how to deal with continuous sampling, power, keeping such a thing >>attached to her, together with usable detection negative/positive >>rates -- algorithms. Good ideas there may help push me along that >>line, though. >> >>Jon > >Photocell power? >Yes, but I was actually thinking about sampling hundreds of times per second. >I dunno how much power, as a alternative to an accelerometer a movable magnet >in a coil (remember the old magnetic phone cartridges) could be used >as a zero power consuming vibration detector. >This is what I thought after writing that posting, and a night sleep: > > OK, this is how *I* would proceed, >that is not how you or anyone else should proceed, but how >I would proceed based on what I know and have done in the past. > > I would start with making some bracelet or belt with a 3 axis > acceleration sensor. As Vladimir suggested, by the way. The eZ430-Chronos includes a 96- seg LCD display, pressure sensor, 3-axis accelerometer and wireless comms ... cheaply, too. See: http://focus.ti.com/docs/toolsw/folders/print/ez430-chronos.html?DCMP=Chronos&HQS=Other+OT+chronos http://focus.ti.com/graphics/tool/ez430-chronos_800.jpg >The sensor would be sampled by a small PIC with ADC, and I would compose a SDLC or HDLC packet. >That is to say a sync byte, some data bytes, and CRC. >This I would connect to one of those 430 MHz (free band) transmitters. The above is offered with any of: 433 MHz, 868 MHz, or 915 MHz. >Those are the size of a dime, I have one here to remote control the lights. >The range of those is maybe 10 meters or less. >In the same room I would have a receiver for that. >Cable from that receiver to the PC elsewhere. >Digital data stream, twisted cable, perhaps optical. >In the PC a card with a 8035 SCC or similar, to decode the packets. >Hang on a huge harddisk, construct a data format, few bytes, >say n samples per second, some bytes (x, y, z, i, t), where 'i' can hold some extra data, >markers, what not. time stamp. I've got one of the above on order, some days ago. Before Vladimir mentioned it, in fact. I still will have the great difficulty getting her to wear it. Given past experience, it may take months (probably years) to get her to cooperate. But I might get lucky. >Then I would just let it run, recording data 24/7, and mark the times when there are seizures. >The advantage is that you do not have to bother the person, you can do any further testing and development >on the PC in non-real time. >What you MUST do however is mark the times that each seizure occurs. >Then, after collecting some real data, have a look at the data, >maybe do a FFT to look for any specific vibrations that may precede or indicate a seizure. >Then it is perhaps just a case of counting times between pulses.. > >If all else fails, set up a simple neural net, there are many, at least for Linux, >neural net programs available for free. >Some net topology, and run the data through it together with the signals when the seizure really happened. >The net will learn what you yourself have learned, maybe even better and 100% attentive. >From that, over time, you can get a reliable system, by having the PC alert you. > >If it works , and why not, you can market it and make a buck or 2 too. Well, we've been discussing almost these thoughts earlier in this thread. I've already sat down to think through some ideas about processing methods. It's an option I will _also_ follow up on (should she allow me to do so, of course.) I'm not particularly partial to neural nets. I won't go into details here, but they are a narrow tool for a narrow range of jobs in my opinion. There might be something new, but years ago I was decidedly unimpressed except in a very few cases. Regarding FFT, that is an obvious step for early post-analysis. For implementation, though, I may consider cross-correlation against known 'signatures' if I can develop a set of those. That's easy to understand and can work well, at times. At the lowest levels of data conditioning, I've a lot of learning to do about 3-axis accelerometers and their noise and distribution shape, biases, and other features so that I can make some sense out of what I read from them. I may consider Kalman filtering. In short, this won't be a quick fix. Nor the only one, even if it succeeds to achieve something. One of the nice things about the concept is that it may provide an hour's notice. And yes, I intend to discuss some details of such a device with a neurologist and endocrinologist in February. They may inform me of other products that already exist (though for some reason they've not yet done so) and may be willing to support anything I find in the process over the next year or two. Each individual is different and adaptation may be easy or hard -- I just don't know. But it is possible there is a product here. No idea, for now. If so, it's going to take a team or two and some serious time to get there. In the meantime, I still plan on working through the auto-mute. More near term and supplements well anything else I do, regardless. Jon
From: Jan Panteltje on 13 Dec 2009 11:02 On a sunny day (Sun, 13 Dec 2009 02:46:24 -0800) it happened Jon Kirwan <jonk(a)infinitefactors.org> wrote in <s3g9i5hcp416lfjevtg1s5avq3b17u4frc(a)4ax.com>: >I'm not particularly partial to neural nets. I won't go into details >here, but they are a narrow tool for a narrow range of jobs in my >opinion. There might be something new, but years ago I was decidedly >unimpressed except in a very few cases. Well, once can cheat. Just an idea, say if you can encode the data stream 'preamble' of the seizure into a wave file or raw audio format, and such a transformation would not be difficult, you could perhaps feed it to 'Dragon Naturally Speaking' voice dictating software. Dragon uses a neural net IIRC (could be wrong about that, but there are ones that do). It can also couple a word to an action on the PC... the rest follows logically. Dragon was for sale a while back at a big discount on Amazon IIRC (but I did not buy it, it runs on MS windows for a start, and the discount was only in the US). Have fun :-)
From: ehsjr on 13 Dec 2009 22:47 Jon Kirwan wrote: > On Sun, 13 Dec 2009 00:14:17 -0500, ehsjr <ehsjr(a)nospamverizon.net> > wrote: > > >>Jon Kirwan wrote: >> >>>On Sat, 12 Dec 2009 16:46:21 -0500, ehsjr <ehsjr(a)nospamverizon.net> >>>wrote: >>> >>> >>> >>>>Jon Kirwan wrote: >>>> >>>> >>>>>To start off, I'm not looking for a specific design, though of course >>>>>I will be very happy for any such attempts. I'd like some thoughts >>>>>about approaches or problems I may need to consider. I'd be happy to >>>>>then expose some design I come up with, to criticism. >>>>> >>>>>I need an auto-mute circuit that I can use to retrofit devices that >>>>>provide an amplified audio output to a speaker or speaker pair. These >>>>>include television sets which use UP/DOWN buttons to set volume all >>>>>the way to resistor-based knobs and wheels that set volume. >>>>> >>>>>I could consider not "getting everything" and instead just focusing >>>>>only on those devices which use a resistor to control the volume, >>>>>interceding at that point (using the existing control but adding a >>>>>circuit around it.) In that case, the circuit would need to behave >>>>>the same regardless of which resistive 'end' was used to set the >>>>>highest volume. I'd like to handle TV sets that use UP/DOWN buttons, >>>>>too. But even _some_ solutions are better than none. >>>>> >>>>>By 'retrofit' I mean that I cannot add new control systems to existing >>>>>ones by drilling holes and making the operation more complex to handle >>>>>-- the operation must be fully automatic and set by me _before_ I open >>>>>up the units and insert the circuit, without having to create any >>>>>external access holes or buttons, etc. >>>>> >>>>>My daughter has grand mal seizures that my wife and I need to hear the >>>>>beginnings of. My daughter loves to turn on stereo systems and music >>>>>boxes, quite loud at times. She enjoys listening and often has her >>>>>computer software playing something loud while having a CD player >>>>>playing something else in the same room, while still something else is >>>>>playing on a CD player in the next room, as well. We don't want to >>>>>take that away from her, but it also makes for a noisy environment >>>>>which can easily mask our ability to detect a seizure as early as we'd >>>>>like to. The results of our missing the early sounds of a seizure >>>>>event could potentially lead to broken arms, or even death in an >>>>>extreme case. So this can have very important consequences. >>>>> >>>>>We've used timers on the power plugs. But besides the fact that she >>>>>moves things around from place to place if it "doesn't work" from her >>>>>point of view, using a timer greatly complicates our own life. She >>>>>needs to have the ability to initiate the operation by using controls >>>>>that already exist on the device. (She is 25 years old, but operates >>>>>much like a 4 year old. She can learn some things, like how to turn >>>>>the volume control knob, but using timer boxes greatly complicates >>>>>operation and thus greatly complicates both her and our lives.) >>>>> >>>>>What I need is something that doesn't increase the complexity of her >>>>>use of the device. She simply needs to learn to "adjust the volume" >>>>>as she always does to cause the mute operation to cease, instantly. >>>>>But that action should initiate the start of a new timing cycle. The >>>>>auto-mute effect needs to take place after about 10 minutes of use, >>>>>but I'd like to be able to set that range from perhaps 1 minute to 15 >>>>>minutes. That said, to be completely honest about it, I could live >>>>>with a fixed 10-minute delay. >>>>> >>>>>The power source is an issue. These devices I'd modify _do_, of >>>>>course, have internal power supplies and I could scarf around to find >>>>>something to attach to, of course. How the ground will relate to the >>>>>speakers, I don't know. It may depend on the device. The speaker >>>>>outputs may even be galvanically isolated. Best would be that energy >>>>>is derived from the sound system's own delivered power to the >>>>>speakers, so that it's 'universal' in that regard. This would save me >>>> >>>>>from replacing batteries or having to make custom designs for each and >>>> >>>>>every situation's internal supply modifications. (While the voltage >>>>>is building up in such a case, though, I'd like the unpowered circuit >>>>>situation to be 'unmuted.') But battery powered, if necessary, is >>>>>acceptable if I don't have to replace them more often than once every >>>>>few months and so long as I'm able to fit the battery system inside >>>>>(in some cases, that will be 'hard'.) >>>>> >>>>>What would work best for her is that if she 'fiddles' with the volume >>>>>control, the mute operation ceases and the timer starts. >>>>> >>>>>This needs to work on CD and karaoke players, stereo and mono >>>>>amplifiers, TVs, etc. Almost all are wall-plug powered. Not all, >>>>>though. Some use multiple D-cells ('boom boxes') or allow an >>>>>'either-or' operation, using batteries if unplugged from the wall. >>>>> >>>>>I've only just begun to think about this and my own limitations in >>>>>experience are suddenly in evidence to me. My first thought would >>>>>only work on the resistive type controls, would use a micro to monitor >>>>>the value (ADC) and then control a digital POT I select. It would >>>>>need power but I could use an MSP430 to mitigate that problem, using a >>>>>small CR2025 or CR2032 which would last quite a while. (The timing >>>>>requirement of minutes, alone, almost forces me to think in terms of a >>>>>micro, though I can think of a few analog circuits using a cap and >>>>>mosfet that would handle such times.) I would probably need custom >>>>>programming, a tweak for the input gain perhaps, and perhaps a >>>>>different digital POT for each unit I modified. But at least I can >>>>>see how to handle that. >>>>> >>>>>Thoughts and criticisms meant constructively are appreciated. >>>>> >>>>>Jon >>>> >>>>Let me see if I understand the functional requirements: >>>>1) Every X minutes, mute the device >>>>2) Un-mute it when the volume control is fiddled >>>> >>>>Is that exactly what you want in terms of function, >>>>ignoring the technical requirements (no holes, power >>>>supply considerations, the muting device or circuit >>>>needs to work with several different pieces of equipment, >>>>whatever)? >>> >>> >>>Yes. That pretty much nails what I'd like to try out, right now. >>> >>>As should be abundantly clear, we are hacking out new territory and >>>always experimenting to improve the quality of our results with her. >>>So once we field something, we may discover new effects to worry >>>about. >>> >>>It's kind of like the "theory of pendulums." You can start out very >>>neatly describing the motion, constraining the swing such that sin >>>theta = theta to a reasonable approximation to eliminate confounding >>>terms, and yield the well known pendulum law. However, when you start >>>actually _building_ pendulums and when you improve your measurement >>>precision of the timing over time, you find the theory doesn't take >>>into account the diameter of the holes that rock on the pins you >>>build, relative to each other, which can affect the predictions by 2 >>>or 3 percent or more -- which cannot be explained by timing >>>measurement errors alone. So you search out this new effect, discover >>>it, and then want to deal with it, too. >>> >>>I expect that once we get this working, what is currently obfuscated >>>by the magnitude of the current problem will be stripped away to view >>>and we'll probably have some new thoughts to add, then. For now, I >>>can't see any of that so this is exactly what I'm looking for. >>> >>>It goes in incremental steps. Like life. >>> >>>Jon >> >>Two things: first, separate the life condition from the >>functional requirements you present here. That means >>you want a circuit that does: >>1) Every X minutes, mute the device >>2) Un-mute it when the volume control is fiddled > > > Yup. > > >>That is the only functional requirement set we (responders) >>should address. We are not capable of knowing whether it >>will address the life situation, and not professionals on >>the medical side of things. > > > Obviously. > > >>Second thing: to meet 1 & 2 above one general approach that >>might fit is as follows. Put DC and signal on the volume >>pot - the wiper will give you a DC voltage as well as the signal. >>Use a cap to bring the ac to the amplifying stages, blocking >>the DC. Run the DC from the wiper through an R to a small 'lytic >>which will charge to the level at the wiper. (A sort of poor man's >>sample & hold.) The cap connects to one input of a comparator. >>The input goes to the wiper through an identical R with no cap. >>Use enough hysteresis to accomodate slight difference in the DC >>applied to the inputs. The output of the comparator resets the >>ten minute timer. The timer gates the audio out to the speakers. >> >>I see plenty of possible downside to the above - it requires >>"surgery" to each device, which may make it a non-starter. It >>also operates for only one direction of the volume control, and >>it is only conceptual - you would have to flesh it out. But it >>is one idea you could experiment with, and the power source >>is already inside the equipment. > > > Let me rephrase this and expose my ignorance. > > I'm not sure where a volume control intercedes in an audio amplifier > system, but if I had to guess then I'd probably imagine it placed it > as a divider on the output load of some early stage of the amplifier > chain -- mostly because it's probably better located where there is > less power to worry about (read: cheaper pot.) > > The DC offset added to the audio at this point will be 'somewhere.' > Changing the pot will move this bias point and you want me to use > averaging (RC) to "sample and hold" this set point (actually, after > some number of taus have passed, it will have settled on that point -- > a reasonable approach for a manual control.) Then use a comparator to > compare this against an unfiltered version (instantaneous set point.) > > I may get lucky and have a pot that has one end at ground or some volt > source. Or all three nodes may not be tied to a v-source. > > If I got it, one immediate issue is that I want _any change_. That's > up-volume or down-volume. You mention 'hysteresis' in your suggestion > but not for this purpose, as I gather it, but instead as a way of > avoiding noisy false tripping due to barely noticeable jarring of the > unit, electrical noise, etc. I'd like to detect manual volume changes > in either direction. But that is solvable. Do I get the gist so far? Yes, I think you understand it. The hysteresis does what you said, but it was more to make the trigger "window" a little wider, and make the switching crisp and definite. As far as moving the control in either direction, it is solvable as you said. Maybe use a second comparator set up to switch when the control moves in the other direction. As far as muting, use the comparator output(s) to reset the timer, and the timer output to switch the audio output line from the speaker(s) to a resistor or resistors and vice versa. Regarding the existing pot setup, it is often like this, where the signal comes from the preamp: Signal---[cap]---+ | P O<---- signal out to amplifier stage T | Gnd -------------+ > > Another issue is what mutes the output. If I actively mute, that act > itself will affect what those same nodes do for the comparator inputs > (filtered and unfiltered) since those nodes must be involved in the > muting, itself. That presents a possible problem. What I may like to > do is separate things so that I isolate the pot and 'copy' its value > to the prior nodes being controlled. Well, that gives me some thought > lines to move along. It should't affect the comparators if it occurs between the final amplifier and the speaker(s). > > Possible variations are discrete circuits, IC circuits, and a host of > topologies to ferret out and design around. Maybe the best way to > start is to just start. I'll open up one of the devices and see what > I see there. Good luck! Ed > > Jon
From: Jon Kirwan on 14 Dec 2009 00:26
On Sun, 13 Dec 2009 22:47:39 -0500, ehsjr wrote: >Jon Kirwan wrote: >><snip> >>Do I get the gist so far? > >Yes, I think you understand it. The hysteresis does what you said, but >it was more to make the trigger "window" a little wider, and make the >switching crisp and definite. As far as moving the control in either >direction, it is solvable as you said. Maybe use a second comparator >set up to switch when the control moves in the other direction. As >far as muting, use the comparator output(s) to reset the timer, and >the timer output to switch the audio output line from the speaker(s) >to a resistor or resistors and vice versa. > >Regarding the existing pot setup, it is often like this, >where the signal comes from the preamp: > Signal---[cap]---+ > | > P > O<---- signal out to amplifier stage > T > | > Gnd -------------+ Yes. I anticipate this _after_ the first stage's conditioning of the input and well before the final power stage. Suppose that the 'signal out' you mention passes through yet another cap before the next stage. If so, isn't this a problem for a DC path? || C1 IN --------||-----, || | | \ Rx / || \ <----||----- OUT / || C2 \ | | --- /// No DC current path, right? In any case, I just opened up my first victim. The pot has 7 points of attachment into the PC board. Two of them are twist tabs for the main mounting and are themselves grounded. Of the other five, they are on 5-hole line tangent at the circumference. One of these is tied to the same ground. But the other four 'go somewhere'. Call the pins A, B, C, D, and E. Pin B is tied to the negative rail (ground.) (Since there is a battery system, as well as AC, I can verify that it is the most negative rail by using the most negative side of the battery pack connection.) Here are the measurements against ground for two rotation positions: MIN VOL MAX VOL --------------------------- A 0.5 ohm 32.3k ohm B --- --- C 0.5 ohm 32.3k ohm D 220 ohm 32.3k ohm E 47.7k ohm 32.3k ohm Obviously, in-circuit and not desoldered. Interestingly, the resistance between A and C goes from about 0 ohms to about 64.5k ohms going from MIN to MAX volume, respectively. The resistance from C to D goes from 220 ohms to 0 ohms going from MIN to MAX, respectively. That's enough to make this interesting. I need to think more closely to be sure, but the pot appears to not be a single resistor track and wiper, at first blush. I think I need to assume every other system will be just as messy. Then, at least, the only way is down -- easier -- from there. >> Another issue is what mutes the output. If I actively mute, that act >> itself will affect what those same nodes do for the comparator inputs >> (filtered and unfiltered) since those nodes must be involved in the >> muting, itself. That presents a possible problem. What I may like to >> do is separate things so that I isolate the pot and 'copy' its value >> to the prior nodes being controlled. Well, that gives me some thought >> lines to move along. > >It should't affect the comparators if it occurs between the final >amplifier and the speaker(s). I have a hard time imagining a pot right at the final stage, because of the power (few watts, at least) involved. But you might be talking about something else I said. >> Possible variations are discrete circuits, IC circuits, and a host of >> topologies to ferret out and design around. Maybe the best way to >> start is to just start. I'll open up one of the devices and see what >> I see there. > >Good luck! Thanks. Looks like I'm going to need it. Blasted thing. Jon |