Gas station without pumps

2016 August 13

Transimpedance pulse monitor does need low-pass

Filed under: Circuits course,Data acquisition — gasstationwithoutpumps @ 18:16
Tags: , , ,

In More thoughts on log-transimpedance for pulse monitor lab, I wondered

I’m wondering now whether I can have students do a log-pulse monitor without bandpass filtering—just high-pass to get rid of the DC signal from overall illumination.  Given the new position of the lab in the course, as the second amplifier lab, I don’t really want to get too tricky with RC filtering.  The “gotcha” that was a problem before is that I had to remove short glitches in the very first stage, to avoid the bandpass filter lengthening them into things that looked like pulses—I don’t want students to have to do that sort of debugging on their second amplifier lab. If I can eliminate the hardware bandpass filters, and just have them use software ones, then the lab becomes more feasible.

I was also concerned that the Schottky 1N5817 diode I had tested did not have provide gain at low currents—the low threshold voltage for Schottky diodes is a disadvantage in this application. So this morning I wired up a log-transimpedance amplifier followed by a couple of op amps as inverting amplifiers.  I first tried a combined gain of 408 (which I had used before with an IR emitter as the transimpedance diode), then upped the gain to 4453. I used high-pass filters to block DC, but no low-pass filters.

The circuit was not functional without adding at least one low-pass filter (a 680nF capacitor in parallel with the diode), because the 60Hz interference saturated the amplifiers, and the smaller pulse signal was completely buried.

With the capacitor, the circuit worked fine in moderately high light, but the signal got weak in low light (due to the transimpedance amplifier having a max gain of about 35kΩ—the asymptotic equivalent resistance of the diode as current goes to 0).  With just the single capacitor for filtering, the 60Hz noise was larger than the pulse signal, but a digital filter could still recover the signal:

Notch filtering does a great job of removing the 60Hz noise from this signal sampled at 360Hz.

Notch filtering does a great job of removing the 60Hz noise from this signal sampled at 360Hz.

So it looks like I do have to have students do low-pass filtering for the pulse monitor. Can I fit that into the second amplifier lab, along with the log transimpedance, or will it all get too complicated?

2016 August 12

More thoughts on log-transimpedance for pulse monitor lab

I’ve been having some more thoughts on having students do a log-transimpedance amplifier for the optical pulse monitor lab (see Pulse monitor with log-transimpedance amplifier). Previously I’ve looked at V-vs-I curves for base-emitter junctions and for the IR emitter—the silicon transistors gave me about 60mV per decade of current, and the IR emitter gave me about 105mV/decade.

I’ve been thinking of having students do the V-vs-I fitting for a simple diode. I don’t have any signal diodes at home at the moment, so I tried testing a 1N5817-TP Schottky diode (about 16¢ in 100s). I used the same setup that I used for testing power nFETs, so I could go up to a high current, but did not have good resolution at low voltages and currents.

The Schottky diode has about 63.6mV/decade, up to around 100mA.

The Schottky diode has about 63.6mV/decade, up to around 100mA.

The Schottky diode has a very similar slope to the emitter-base junctions I’ve tested in the past, but I’d really have to test down to much lower currents—we’re interested in the range 10pA to 500µA, which is buried in noise in these measurements.

I can get down to 1µA fairly easily, by eliminating the voltage dividers and just using unity-gain buffers to get low-impedance values to drive the analog-to-digital converters. I tried with four different sense resistors (470Ω, 15kΩ, 560kΩ, and 5.6MΩ) and got very consistent results. The noise levels are much lower, because the larger sense resistor and lack of voltage divider makes for much larger voltages being measured for the current-sense channel.  I also used the differential ADC channel for measuring the voltage across the sense resistor, which should remove a little noise compared to taking separate measurements and subtracting them.

I have more confidence in the 60.2mV/decade and 0.37V offset from these measurements than the high-current measurements I did for the first plot. At low currents, the diode behaves more like a 33kΩ resistor than like a logarithmic element.

I have more confidence in the 60.2mV/decade and 0.37V offset from these measurements than the high-current measurements I did for the first plot.
At low currents, the diode behaves more like a 33kΩ resistor than like a logarithmic element.

The 60.2mV/decade fit seems pretty good from 10µA to 10mA, and the noisier high-current measurements suggest that it is good to 100mA.  The sensitivity is less below 10µA and more above 10mA, behaving almost like a fixed 33kΩ resistor at low currents.

I can get a pretty good fit over a wide range with a three-parameter model of the equivalent resistance as a function of current: a resistor in parallel with a device that has a power-law fit for resistance as a function of current:

There is no theoretical justification for this model, but it seems to match the data better than the standard voltage-as-logarithm-of-current model, at least at low currents.

There is no theoretical justification for this model, but it seems to match the data better than the standard voltage-as-logarithm-of-current model, at least at low currents.

At low currents, the Schottky diode acts like a 35kΩ resistor, but at high currents, the voltage seems to be 0.409 I. This model seems to fit to better than 10% over 7 decades, which is not too bad for a 3-parameter model!

I’m wondering now whether I can have students do a log-pulse monitor without bandpass filtering—just high-pass to get rid of the DC signal from overall illumination.  Given the new position of the lab in the course, as the second amplifier lab, I don’t really want to get too tricky with RC filtering.  The “gotcha” that was a problem before is that I had to remove short glitches in the very first stage, to avoid the bandpass filter lengthening them into things that looked like pulses—I don’t want students to have to do that sort of debugging on their second amplifier lab. If I can eliminate the hardware bandpass filters, and just have them use software ones, then the lab becomes more feasible.

Playing with Nao humanoid robot

Filed under: Robotics — gasstationwithoutpumps @ 11:09
Tags: , , , ,

Yesterday I had an opportunity to play with a Nao robot in a three-hour workshop at UCSC, run by Dr. Denise Szecsei of the University of Iowa. I found out about the workshops through an article in Santa Cruz Tech Beat, an on-line publication about local tech events. (Santa Cruz Tech Beat is worth reading, with a high signal-to-noise ratio and only about 30 articles a month.)

The basic idea that Denise was pushing is the use of the Nao robots in introductory programming courses—she created a course at the University of Iowa called Dancing Robots that supposedly been successful in recruiting women into programming courses there (she did not give us detailed information, as the focus of the workshop was on getting us to experience programming the robots, not on academic justification). She was also looking for collaborators on either educational projects or art projects, so was glad to have some grad students from the Digital Arts and New Media project at the workshop.

You can see an example of the results of the dancing robots courses on YouTube:

I’ve always thought that the Nao robots were cute, but at $9000 from the US distributor RobotsLab (and $890/year for warranty), they are too expensive for me to buy as a toy.  So I welcomed the chance to play with one for 3 hours.

What the workshop was intended to be was a brief tutorial on Choreographe, the drag-and-drop scripting environment for the robots. That environment looks ok to use, with simple message passing along wires to trigger pre-written boxes for actions like “say” or “timeline” animation.  Most of the dancing work is done by using the timeline like stop-frame animation (at 25 “frames” per second), with the software interpolating between target poses.  The target poses are created by physically manipulating the robot, making the whole process accessible to 6th graders (though the fragility and cost of the robots makes me think that you would need careful supervision even for high-school and college students).

I was not interested in the dance aspects of the robots, so I worked with one of the workshop staff (Denise’s son) on diving into the Python SDK (there are also C++, Java, and JavaScript interfaces, but the Python one is best integrated with Choreographe and the best for rapid prototyping, which is all I had time for). I spent a little time the night before the workshop looking at the programming interface (which I did not really understand from the quick glances at the documentation) and at the capabilities of the robot in terms of sensors and actuators.

What I wanted to do was to program one action—shifting the weight of the robot onto one leg, then picking up the other leg, so that the robot stood on one foot.  I planned to do the weight shifting by coordinated motion of the hip roll and ankle roll actuators.  Initially, I had thought to do it on just one leg, but I ended up doing it on both legs, since the starting position had the feet approximately the hip distance apart, so rotating both hip-roll actuators one way and both ankle-roll actuators the other way results in a parallelogram linkage, with the hips and torso staying level while moving sideways.

To detect the weight shift, I used the force resistors in the foot.  There are several ways to access them through getData() calls: the processed “leftFootTotalWeight” and “Device/SubDeviceList/LFoot/FSR/TotalWeight/Sensor/Value”  or the raw sensor values “Device/SubDeviceList/LFoot/FSR/FrontLeft/Sensor/Value”, … .  I ended up using “leftFootTotalWeight” or “rightFootTotalWeight”.  The basic idea was to start a thread running moving the hips far to the left, and set up an interrupt routine triggered by the event footContactChanged. When that event fired, I checked the weight on the right foot, and stopped the motion if the weight was low enough (I think I used 300g, since the unloaded force resistor with the foot in the air was reporting something like 200g).

I did not have time to add a further refinement to the weight shift, to adjust the weight to be centered over the supporting foot, using the center of pressure sensor. I had the robot speak the values of that sensor, but did not use it to tweak the hip and ankle angles of the supporting leg.

Once the weight had been shifted on the left leg, I had Nao pick up the right leg by adjusting the hip pitch, knee pitch, and ankle pitch of that leg.  The posing software in Choreographe made it fairly easy to figure out what the correct signs were for the angles and for picking target values. The robot lurched a little bit as the right foot was picked up, probably because the foot had not been fully unweighted, but possibly because of the foot not being lifted quite vertically.

If I’d had more time, I would have done the centering of the weight over the supporting leg before lifting the other foot. I would also have moved the motion of the supporting foot into a separate script, so that different gestures could be made from the one-legged stance. In doing that, I’d probably want to have any one-legged boxes run a balancing thread to keep the weight centered over the supporting foot, so that sticking out an arm or a leg doesn’t topple the robot. Either that, or have a one-legged balance box that is runs in parallel with any gesture actions.  It would probably take me a day or two of programming to create one-legged action boxes robust enough for someone else to use them, and probably a few weeks of use testing before they would be worth adding to Choreographe.

Working with the robots definitely needs two people, as one person needs to spot the robot any time it is moving (remember, fragile and expensive!).

It was very useful working with someone familiar with part of the programming interface, so that I did not have to waste much time figuring out how to create a new box or test it out. He was the one who suggested outputting a string to pass into a “say” box for reporting the foot sensor values for debugging, for example. I started out just reading the sensors and reporting the weight, then tried figuring out how to interrupt an ongoing motion by raising one arm very slowly, to be interrupted by any of the touch sensors. Once I had the basics of starting a parallel thread and stopping it on an interrupt, I programmed the weight shift. Once that was working I added lifting and lowering the non-supporting leg.

I fully expected that the spotter would be called on to catch the robot as it fell during my development of the program, but despite a little worrisome lurching as the unweighted foot was lifted, the robot never toppled.

I doubt that the Python SDK is fast enough to do a closed-loop feedback system for balance, but it was certainly good enough for a slow weight shift onto a single leg, and the feet are wide enough that no dynamic balancing was needed. It would be a fun programming environment for a Python course, as long as the students were into humanoid robotics.

The Choreographe environment provides a reasonable interface for fairly simple sequencing and synchronization, but I suspect one hits its limits pretty soon. Being able to create new blocks rapidly, by copying existing blocks and editing the Python in them, makes the system a lot more powerful, though I got the impression that the “Dancing Robots” courses rarely get that far.

The Nao robots were, as I expected, a lot of fun, but I couldn’t really recommend them for a beginning programming class. At $9000 for each pair of students, they are way too expensive and way too fragile.  For beginning programmers, you really want things that students don’t have to worry about breaking if they make a little mistake. One can get fun robot toys for students to program for $100 each, since wheeled robots are much cheaper and easier to make than humanoid ones. Not only is the financial risk lower with cheap robots, but they can be made much more robust (though educational robots needn’t be made to sturdiness required of combat bots).

To break into the consumer market or school market, I think that Nao would have to come down in price by about a factor of 10, which would be difficult to manage, given what the robots contain.  There are 24 actuators (2 head, 6 in each arm, 6 in each leg), plus cameras, ultrasonic range finder, touch sensors, foot pressure sensors (4 per foot), gyroscope, accelerometer, LEDs, … . The motors and 12-bit joint angle sensors (magnetic rotary encoders) alone probably cost close to $1000.

 

2016 August 11

Email to professors

Filed under: Uncategorized — gasstationwithoutpumps @ 10:37
Tags: , , , , , ,

This is the time of year when many semester-based colleges are starting classes again, so there are the usual spate of blog posts from faculty trying to orient the new students.  On perennial theme is on how to communicate with faculty, since so many students seem clueless about it.  (Two years ago, I plugged the book Say This, NOT That to your Professor, which I still recommend.)

Today, I happened to see the post How to Email Your Professor (without being annoying AF), in which Laura Portwood-Stacer provides a template and explanations:

10 Elements of an Effective, Non-Annoying Email

Here’s a template you can follow in constructing your email to a professor. Each element is explained further below.

Dear [1] Professor [2] Last-Name [3],

This is a line that recognizes our common humanity [4].

I’m in your Class Name, Section Number that meets on This Day [5]. This is the question I have or the help I need [6]. I’ve looked in the syllabus and at my notes from class and online and I asked someone else from the class [7], and I think This Is The Answer [8], but I’m still not sure. This is the action I would like you to take [9].

Signing off with a Thank You is always a good idea [10],
Favorite Student

Element #1: Salutation …

Element #2: Honorific 

Element #3: Name …

Element #4: Meaningless Nicety…

Element #5: Reminder of how they know you …

Element #6: The real reason for your email …

Elements #7 and 8: This is where you prove you’re a wonderful person …

Element #9: Super polite restatement of your request …

Element #10: Sign-off …

The hidden Element #11: The follow-up …

I don’t think that Ms. Portwood-Stacer is a professor, as her advice seems more appropriate for freelance writers than for students.  It isn’t bad advice, but I’d recommend something slightly different.

First, I don’t care much whether students include elements #1, #2, and #3, though I agree with her that “Hey!” is offensive. I don’t mind students using my first name, and I tell them so, but I agree that it is probably safer to use “Professor X” if you don’t know the person’s preferences.  In a formal business letter, the proper salutation is important, but in an e-mail without CCs it can be omitted.  (In an email with CCs, it is important to indicate who is being addressed.)

I disagree strongly about #4. I read a lot of email every day, and don’t want to have to wade through meaningless noise.  Skip the chitchat and get to the point—don’t waste my time.

Along the same lines, move #6 to the front. Ask your question or make your request directly, don’t bury the lede. After you’ve made a clear request, then provide the background information: who you are and what you’ve already done to try to get an answer. Make this more complete—if you are asking for something in my role as undergraduate director, for example, I need to know your major, your concentration, and which year’s catalog you are following.

The “thank you” at the end is nice, but a followup thank you message after my reply is appreciated more—the extra trouble taken makes the thanks seem more sincere.

One missed point—provide your full name and your nickname if you go by that in class right at the beginning of the message: This is Ridiculous Name Overly-Hyphenated, who goes by “Rid Overly” in class. I have to read my university e-mail with Google, which does an absolutely horrendous job of showing me who messages are from (there are probably 40 people it identifies to me as just “David”).

Use the official University e-mail address, as FERPA rules require me not to discuss your academic record with anyone but you (unless you’ve given explicit permission otherwise). We’ve had incidents of people pretending to be students to get information they had no right to, so I’m trying to be careful to respond only to the official email addresses. Remember to edit your campus directory entry, so that your email is associated with your real name, and not just your userid (I have no idea who “alkim345” is).

So rewriting her example for a classroom question:

This is Ridiculous Name Overly-Hyphenated, who goes by “Rid Overly” in Class Number. 

This is the question I have or the help I need.

I’ve looked in the syllabus and at my notes from class and online and I asked someone else from the class, and I think This Is The Answer, but I’m still not sure.

This is the action I would like you to take.

Thank you.

For an advising question:

This is Ridiculous Name Overly-Hyphenated, who goes by “Rid Overly”. 

This is the question I have or the help I need.

I’m a bioengineering major in the bioelectronics concentration, following the 2013–14 curriculum. I plan to graduate in Spring 2017.

I’ve looked at the curriculum charts, in the online catalog, and at the online advising web pages; I asked the professional advising staff; and I was directed to ask you.

This is the action I would like you to take.

Thank you.

If you need to meet with me, which is not needed for a lot of routine things, but is sometimes quite useful, add

May I come to your office hours next week at 3:15 p.m.?

Technically, you don’t need an appointment for open office hours, but those who have reserved slots ahead of time take priority over those who drop in. If you can’t make scheduled office hours and want to meet in person, say something like

I have a conflict during your office hours, but am free at the following five times …, would any of those times work for you?

2016 August 10

Response from UCSC on MRC’s beauty spot

Filed under: Uncategorized — gasstationwithoutpumps @ 22:37
Tags: ,

In MRC’s beauty spot revisited, I complained about the temporary construction staging area having become a permanent blight on campus. I brought the blog post to the attention of the administration, who had the campus architect answer me:

I am responding to your inquiry about the staging area on behalf of the Chancellor. Thank you for your comments and I apologize for the delayed response. The areas adjacent to the East Remote Parking Lot are anticipated to continue to be used for contractor staging, as campus infill sites lack on-site staging space. During periods of low demand for contractor staging, the areas will be used as surge campus parking. Transportation and Parking Services is exploring the feasibility of making the area in and around the East Remote Parking Lot more efficient.
Please let me know if you have any other questions or would like to talk about this further.

I decided it was worthwhile to pass on Ron’s comment about the lack of environmental review, so I asked,

OK, but a question came up in response to my blog post.  Did the campus ever do an EIR on the development of that “temporary” staging area which now apparently has been redesignated a permanent staging area?

And I got a subsequent reply:

The Campus determined that the creation and use of the staging area was categorically exempt from CEQA so no environmental document was prepared. At the time, the Campus anticipated that the staging area would only be needed for up to 5 years, at which time it would be restored. However, since the campus has accommodated enrollment growth under the 2005 LRDP through infill development, ongoing construction in the central campus has necessitated continued use of the staging area.
The Campus created a mechanism to collect funds for eventual restoration of the area. This mechanism is still in place.
Please let me know if you have any additional questions.

While a temporary staging area may be categorically exempt, I’m not sure that a permanent one is. I believe that the exemption was based on the assumption that the site would be restored after five years.

It has been 16 years now that this five-year staging area has been around, and there are clearly no plans to ever restore the site as originally promised.  Perhaps the Sierra Club or some other land-use watchdog might want to look into this issue—I don’t have the time nor the energy to pursue it further.

« Previous PageNext Page »

Create a free website or blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 351 other followers

%d bloggers like this: