Thursday, January 28, 2010

Weekly meeting agenda

Today's plans (here's the last meeting agenda):
  1. Task list - does everyone have access?
  2. Review and update group policies.
  3. Research update
    1. Dr. Jones
      1. Tutorial on the data transfer protocol.
      2. Our group's videos are featured on the IEEE RAM YouTube channel. I've entered some photos in a contest for the front cover of the IEEE Robotics and Automation magazine.
      3. Python now runs on the PIC24. Still work to do for the Summer Bridge program.
      4. Prepare a quad chart, two slide summary, three slide summary of the group's research.
      5.  Continuum review paper accepted; need to review another paper.
    2. Others

Python on a PIC

After some long hours, I got Python compiled and working on a PIC24HJ64GP502. It barely fits, but it does all work! Things to do:
  1. Clean up the make process. In particular, I'd like to be able to use make to build just the C code from the Python sources. I do have everything else building from both MPLAB and a Makefile (ugh).
  2. SVN commit this to the project.
  3. Write code to interface with the hardware. Idea: write a read/writeBit(s)/Word function, then use Python to build nice classes around all the peripherals. However, I'm not sure if there's enough RAM or if the Python will run too slowly to be practical.
  4. Put together a nice GUI so I can edit code, save it in a file, or send it to the PIC\
Some notes: to run ipm, "/cygdrive/c/Python26/python --serial=com14 --baud=57600".

Thursday, January 21, 2010

Building a bridge

I'm planning on helping with the MSU BCoE Summer Bridge program. I'm planning on a 10-day portion, having the students build a WareBot: a robot which follows line to deliver packages, avoiding obstacles along the way. There are two portions: the mechanical platform and the microcontroller. I'd like to develop a simple tracked mechanical platform to use DC motors, a servo and an IR distance sensor, and line sensors. I hope to have a student complete that for me this semester; the question of how difficult it is to build these remains. The microcontroller question is more complex. I could use a PIC24, but C programming for it would be painful. A second option is the BASIC Stamp; a third option would be some sort of Python-powered uC (perhaps an ARM).

Investigating the BASIC Stamp, I'd think that a BASIC Stamp II would be fine. It needs a serial connection to the PC at RS232 levels per the schematic (sigh), so just an FTDI cable doesn't work (here's an example of using an FTDI chip plus interfacing transistors). The USB Board of Education provides a nice setup, but the prototyping area is too small, plus it's somewhat expensive. I'd need to add an additional breadboard to this for the sensors/motors I've chosen. PBASIC is OK, but I'm not that excited about it. Their IDE is nice, and integrated with a bootloader, which is very good. However, it doesn't have any analog inputs, which is bad; an alternative is to use an RC delay to read an analog voltage.

The alternative would be Python running on a uC, supplemented by I/O libraries. That's a lot of work, especially if I'm not planning on using it elsewhere. However, it looks like I could buy one and follow the tutorial; the library looks reasonable.  However, I don't fully understand how to send it code / bootload it. I've downloaded the code and now need to update my Cygwin install to build it. Looks like more work, but also looks promising...

Update: UNIX builds are always painful. PyChip built fine, after I found the docs/src/BuildSystem.txt to help me. I needed docutils to built the html files, which was easy to install after finding it. make check fails with a compiler error on ut_dict.c, which wasn't encouraging. Reading the docs/src/InteractivePython.txt, it seems like the interactive mode does what I'd hoped: transforms source code to bytecode, sends it to the target, then prints the results of executing that code on the target. Given that the PIC24HJ64GP502 has 6K of RAM (plus 2K of DMA space), perhaps I could run on it; docs/src/FrequentlyAskedQuestions.txt recommends 8K of RAM, with 4K as an absolute minimum. Of course, I'd then need to wrap many of the C functions in Python, which would be a pain.

Hardware update: PyChip has some support for the a very nice STM32 board which costs just $25! However, it uses an RS-232 connection, which is a pain. I'm not sure if the TX and RX pins are accessible at TTL levels.

Interesting articles

Reading in the IEEE Spectrum, I ran across two interesting articles. First, an interesting perspective from a University of Alabama professor on the climate, contrasting strongly with claims that climate data is unquestionable. (Note that the second article gives a series of opinions from the pro-change perspective, rather than factual claims, though it sounds factual.) Second, an interesting article on the China's Great Firewall gives a graphics below of what's censored as the image below:

In addition, a friend of mine with MS pointed me to some very exciting news: narrowed veins  (note the PDF is freely available) which do not carry enough blood away from the brain may be the root cause! There's a TV news story and web info on it as well.

Wednesday, January 20, 2010

Micro updates

I spent some time today working on an updated slide for Micro based on what I taught; I think it does a better job of capturing the MOV instruction's abilities.

I've also been thinking about re-doing the course using video supplemented with in-class exercises. I feel like I know what I'd like to do in these videos and how to do so reasonably efficiently. Now, what should I cover in the classroom without overwhelming myself?

Based on today's lecture, I need to have two levels of exercises: simple problems which verify what was taught, versus more difficult problems that require a bit of reasoning. For example, I task students with swapping data between two registers or memory locations as in-class exercises. I was surprised at how many questions and how much confusion this could generate. For the video portion, I'd go with something simpler: what happens after a sequence of MOV instructions? For the in-class exercises, I can ask them to perform a task (swapping) using these instructions.

The second in-class question is how to use in-class quizzes or something like that to reinforce the lecture. My guess is that I'd start with exercises, develop a good set of them, then move up to creating quizzes after the exercises are done.

Now on to my annual review, which I've been avoiding all day...

Tuesday, January 19, 2010

Tutorial created

Pondering a bit more on better ways to teach, I think my last few problems are resolved. In particular, my plan is to create a short (~7 minute) lesson which ends with an example, then an exercise based on that example. The exercises can and should be PC-based, such as writing and simulating some assembly code. I'm planning on recording in Camtasia from PowerPoint slides, supplemented by bringing in demos on MPLab, Quartus, etc. and showing data sheet, web sites, etc.

As a first pass of doing this, I've created a dataXfer tutorial video and accompanying docs. It took longer than I'd planned and I see several things to improve on in the future. However, I think the idea is sound and fairly do-able.

PC tools:
  • ZoomIt is a nice way to draw things while recording a video.
  • The latest version of Doxygen (1.6.2) doesn't work with my #ifndefs. After much playing, downgrading to 1.6.1 solved the problem. It now includes a nice search feature build into the docs!
But these things have eaten so much of my day and there's lots I haven't done yet...

    Sunday, January 17, 2010

    Improving micro

    Three of my group's videos are now featured on the IEEE RAM YouTube channel. That's marketing progress! I tried uploading the 2007 SECON video on Friday, so I can replace the audio with something legal. The upload failed, however, so I'll try again Tuesday.

    One my my Micro students sings in a barbershop quarter. How neat! Here's the podcast:

    Note: this slick player came from here.

    One thing I've been thinking about is how to improve Micro. One suggestion by Mark Taylor involves placing all the lecture content in videos which students watch, then using class time to build problem solving skills. I like the idea, but there are several problems I need to work through to get there. My thoughts:

    • I typically include a lot of group work / discussion as I give the lecture. This gives me a chance to correct wrong impressions, etc. How can I incorporate this into a video lecture?
      • Just giving the correct answer after an exercise encourages not doing the problems: I know that I'd just watch the thing rather than work the exercises.
      • Not giving the correct answer might leave students confused when I tried to build on that concept later in the lecture.
    • How do I make the lecture interesting? I know that I'd be bored by lecturing to my PC for an hour.
      • Throw in video clips of me? If so, when and why?
      • Break the lecture up into 10 minute pieces, ending with an exercise due in class?
      • Throw in some background music? See it more like a radio program?
      • Perhaps use screencast advantages: show MPLAB doing something, pull up and highlight data sheets, refer to book pages.
    • Techincally, what's the best way to do this?
      • The simplest approach, probably a good place to start, is to narrate my PowerPoint slides.
      • It would be nice to splice in a screencast, etc. Perhaps make that a movie then embed in PowerPoint?
      • Adding some video (here's a motherboard, etc.) would definitely add some interest.
      • However, editing this might become a lot more painful.
      • I'd no longer have a simple set of slides to distribute, but a whole production. I'm not sure whether book adopters would like the multi-media version or not.
    • Tommy pointed out that this would be a great tool for a week when I was gone: record my lectures!
    • In the end, I'd like to just try it: record one lecture and see how it goes.

    Thursday, January 14, 2010

    Meetings and e-mail

    Bob passed on a neat quiz on embedded C. Wow -- I only got a 70%. Good stuff! The only annoyance is the registration requirement.

    I've spent most of my morning working through e-mail, scheduling meetings, etc. It's amazing how just e-mail backs up.

    Today is our research group meeting. Topics:
    1. Introductions - Justin and Jae-Pyung are new.
    2. Videos - from Ankit and a paper to review.
    3. Machining help - the Industrial Technology group is will to make things for us.
    4. Research update - everyone talks about what they're doing and any recent progress
      1. Me - My focus is marketing, followed by the paper with Durga.
        1. Ankit's movie 
        2. Summer bridge / Micro demoBot / Intro to Robotics base - with Cory
        3. The SECON movies are now on my YouTube channel.
        4. Three of our group's videos will be featured on the IEEE RAM YouTube channel.
        5. Prepare a quad chart, two slide summary, three slide summary of the group's research.
        6. Brainstorm on a good image / movie to showcase our group.
        7. Web site updates and improvements.
      2. Buddy - dynamics works!
    5. Procedures
      1. Review group policies. New: responsible conduct of research requirement to receive NSF funding.
      2. YouTube videos and audio tracks - from what I can tell, our videos don't constitute fair use. We need to use only free music. Sources:
        1., -- checked; this is truly FREE.
        2. YouTube's AudioSwap -- but they reserve the right to put in ads.
        3. Google for "free legal mp3" gives (unchecked), (unchecked), and more.
        4. (unchecked)
        5. NOT FREE: prohibits free usage for Internet videos (see item h on their terms of use), charging $100 per song!

    Tuesday, January 12, 2010

    Marketing, maybe?

    Tuesdays and Thursdays are my marketing (and research) days. However, there's always the odd task or two that still needs doing before I get to that. Today's surprise: converting the bootloader to 2005 forced me to fix some whar_t to char conversions I'd ignored earlier. That turned into a project, but is done now.

    While I still have the trial version, I'm now working on converting the full SECON movie to YouTube.

    Sounds like military robotics is hot!

    For marketing, things I can think of:
    • Publicity
    • Marketing
      • Post Ankit's video when it's ready
      • Improve our group's web site
      • Come up with an idea for an amazing image or movie to showcase our group.
      • Create a quad chart to summarize research group thrusts.
      • Put together a one-slide, two-slide, and three-slide research group summaries then meet with Lori, Gary to get their feedback and ask them to shop these ideas for me.
      • Work with Jean, Mike to publicize and recruit.
    • Funding
      • Look for and apply for funding of any sort I can think of.
      • Continue writing and revising my CAREER proposal.
      • Schedule an Eglin visit.
    I figured out how to embed a playlist without creating a custom player: it's hidden in the "Edit playlist info" dropdown. Here's the SECON 2008 full version:

    Family favorites

    It's always interesting to see what Alex and Daniel like. Some of their favorites, found during the snow and cold weather recently:
    • Why it's important to drive carefully on ice.
    • What cold animals do in a Florida zoo.
    • A water balloon to the face.
    More fun videos:

    Monday, January 11, 2010


    It seems like I'm just tying up lots of loose ends today. That's not much fun, but certainly is necessary.
    • Micro:
      • Attendance sheet
      • Prereq checks
      • File folder labeling and clean-up
      • Lab writeup editing
      • Create a ZIP with the latest library
      • E-mail Tommy re: Summer bridge purchasing
    • Yearly review writing
    • Record laser cut tutorial again
    • Return a call
    In working on some YouTube videos, I'm now trying to only use free audio tracks. Though it's still confusing how all this works (when does this constitute fair use), using only free music is best. Which leads to the question: what are good free music sources, not contaminated by commercial songs from a website which claims only free content? Perhaps YouTube's AudioSwap is easiest, and should be 100% legal. But it seems like I can't mix in more than one song and ads may still be displayed.

    SECON movie uploaded

    I spent time with the DivX Author trial and split the shorter version of SECON video Graham created into YouTube-sized pieces then uploaded them. Here they are (as a playlist -- watch them in series). The first video is the teaser Graham produced.

    To embed this playlist, I used a custom player (YouTube | My account | Custom video players). Then, I had to play around with the size to get the aspect ratio correct. I wonder if there's an easier way to do this?


    A student in Micro asked me if I'd considered Atmel's AVR when choosing a microprocessor for the book. I knew they didn't offer a C compiler and were limited to 8 bits, but little else. I did a bit of research and was impresssed:
    • There's one AVR core; the various families (tinyAVR, megaAVR, etc.) add features but share the same core. See the diagram to the right. Nice!
    • The AVR instruction set contains two 16-bit pointer registers for indirect addressing, compares and signed/unsigned branches, 16-bit addressing for data, a multiplier, and a stack. It's nice.
    • As shown in the overview, there are lots of DIP packages, great for breadboarding.
    • There are third-party C compilers, but no well-supported free ones. That's a big minus.
    I realized that I need to use tags (i.e. labels to Blogger) to keep track of my posts, so I've started using them.

      Friday, January 8, 2010


      I'm using Dropbox to share a video editing task with a student. What a convenient thing -- it's so much easier to use than SVN.

      Today's list:
      • Micro:
        • Work on a Micro exam 1
        • Look through and edit lab files
        • Fix homework #1
        • Prereq checks
        • Create attendance sheet
      • Work on my annual review
      • A bit more e-mail
      • Re-record bitmap to laser cut video
      But instead of doing this, I went to an excellent lecture on Gen NeXt by Mark Taylor. He had some neat ideas: moving lectures onto video and using class for problem solving. I'd love to do that, but it's a lot of work. Getting some in-class demos working this semester will be a good step in that direction, however. I also still want to re-record my tutorial on laser cut conversions.

      Alex is tired of doing his weekly reports. Maybe I should stop requiring these for him.

      Thursday, January 7, 2010

      Neat products alert

      Ryan, one of my Micro students, pointed out a neat product from Sparkfun, their LCD display. It's $35 and has an easy-to-use interface (serial commands to an attached ATMega), which is great.

      Reading the latest IEEE Spectrum, here's a Roomba competitor which uses a laser rangefinder to SLAM the room it's in. Wow! I'd certainly love to play with one of those...

      Camstudio bring-up

      From what I can tell, development on Camstudio has died. I'd prefer to use Camtasia Studio, but don't have the money to purchase it (sigh). However, it does work. Here are my setup notes:
      1. I prefer the Beta version, which shows corners around the area you record. Download it from the Camstudio blog.
      2. Fix the audio settings, which don't work on Vista: per this video, from the Recorder choose Options, Audio Options, Audio Options for Microphone, then use PCM, 22050 Hz, 16 bit, Stereo, 88200 Bytes/sec.
      3. I prefer something other than the default Microsoft Video 1 video codec, which does a poor job. The DivX codec I have is compatible with YouTube. The CamStudio lossless codec also works with YouTube.
      4. Be careful -- don't record movies longer than 10 minutes, or YouTube won't take them.
      Using that, here's a tutorial on how to convert a bitmap to a laser-cuttable vector image. I chose an octopus from the web; below are the before and after images.
      I made a video tutorial of the steps. Then I discovered the my microphone died right before I recorded this. Aargh. I'll re-do it when I'm back in operation...update: it's finally done.

      Today's PC task: convert movies on a DVD to YouTube. While Google shows lots of commerical apps, I'd like something both trustworthy and free. So, I downloaded the DivX Author program, which allows me a 30-day trial, and I'm converting. So far, so good. Though somewhat tedious, since I need to break the videos up into 10 minute chunks.

      Snow day

      Amazing -- today is a snow day. I'm working from home, which is nice. As always, a big goal is sorting through my e-mail inbox, which still needs some work.

      Random PC stuff: I'm trying to figure out how Google docs folder permissions interact with per-file permissions. I'd like to handle all sharing of the Micro labs using a folder, instead of changing the permission for each file. It seems like the permissions last edited take priority -- that folder permissions simply modify each file's permission. This would make sense in the case that a file can live in multiple folders. As long as I can get all the permissions looking the right way, I'll be happy for now. Part of the confusion is a lag: it seems to take a couple of minutes before the revised permissions take effect, which makes it harder to determine.

      An amazing video Ricky found:

      Today's goal is marketing: I'd like to look for proposal possibilities, develop PowerPoint slides to market our research, etc. More soon.

      Classes have started

      Classes started today; I've finished my lecture. Although enrollment for the last two spring semesters exceeded 60 students, we're at 50 this semester, so I've started the process of canceling a lab section. I also spent some time updating my syllabus with reading assignments. I'm thinking of trying some selective release features on myCourses to remind students to read; we'll see.

      One big problem right now: I can't log in to the Wiki in order to edit it!

      The list for today:
      • Micro:
        • Read through Micro papers
        • Updated permissions for Google docs access
        • Get Micro e-mail lists organized
        • Work on a Micro exam 1
        • Schedule room for Micro exams
        • Send lab files to Steve 
        • E-mail Justin re: time change
        • E-mail TAs re: meeting and plans
      • Reply to Ian's e-mail re: trunk kinematics
      • More e-mail work and cleanup
      • Schedule a review with Nick
      • Work on my annual review
      • Schedule lunch
      • Schedule a research group meeting
      Whenisgood makes scheduling a meeting soooo easy. I've got two pending.

        Tuesday, January 5, 2010

        Shape sensing

        Krishna found a neat shape sensor that might work for a continuum robot; it looks similar to ShapeTape. Some videos (here, here) nicely illustrate its capabilities.

        More random PC fixes:
        • Annoying MS security: viewing a downloaded .chm file doesn't work until you unblock it. Here's another method.
        I'm mostly ready for classes with an updated schedule for Micro. I think I'll try some conditional release use this semester to assign homework, etc. Or perhaps I'll stick with e-mail, since that seems to work.

        Monday, January 4, 2010

        Getting organized for the new year

        I'm back at work -- it's been two weeks. Wow.

        Some random thoughts and links I haven't had time to really categorize yet: the MSU budget (where is research spending shown?). The ARM Cortex-M3 Technical Reference Manual gives general ARM info, but lacks and instruction set encoding. That's in the ARMv7-M Architecture Reference Manual, which ARM doesn't publicly post (annoying). Of course, it's findable via Google. I wonder if there's a good textbook for the ARM Cortex? I haven't found one yet.

        PC fixes:
        • Windows Defender kept complaining and couldn't auto-update. The manual install method worked fine (follow the link from here).
        • To define a custom paper size in Windows, use File |  Server properties from the Windows Explorer when viewing Printers in the Control Panel (I'd never seen that one before!). However, the laser printer seems stuck on a max page size of 11x11 in. Grrr.
        • After playing with it, I've decided that Photoshop Elements is a disappointment. I keep wanting to use tools from the full version, which I have on the laptop. Sigh.
        • Perhaps this is why the laptop takes forever to resume after sleeping. We'll see.

        To do:
        1. A class schedule for Micro. I need to replace section numbers with page numbers for the reading assignments.
        2. Better plans for what I'd like to accomplish this semester.

          Sunday, January 3, 2010

          Painting in the new year

          Vika and I decided to repaint our kitchen. The old paint demonstrated several big problems. First, because it was a flat sheen, it both showed food stains, hand prints, etc. Second, washing it (even with a damp rag) discolored the wall, meaning any stain was for all purposes permanent. Third, it flaked off easily, so that any semi-vigorous rubbing would actually remove the paint from the wall! The color (an earthy tan) was nice, but definitely not kid-friendly.

          So, we began by asking friends, reading a book, borrowing some tools, then making many trips to Lowe's for supplies and more supplies. Neither Vika nor I have any painting experience, so we began without a clear picture of how to do this! It made for an adventure, a learning experience, and a fun time. To work around our kids' schedule, we painted in afternoons when they took a nap, then again in the evenings after they were in bed. We ended up painting until midnight or so for two nights, including new year's. There's nothing like doing something to really learn it. Lessons learned:

          • The AccuBrush (on the left), which I received as a Christmas present, works wonderfully. It takes a bit of time to learn and can't paint all the way into a corner, but it's very fast. The thing that took me time to realize was that the brush needs to paint in one direction: backwards when doing a long section of wall to avoid marks from the wheel, brush, etc.
          • A corner brush (on the right) was fairly useless. It doesn't paint the seam when the two corners meet. I found using a standard paint brush easier.
          • The paint stirrer was fairly useless. It works, but leaves a lot of paint on the stirrer afterwards. A free paint paddle would have worked better. Live and learn...
          • A trim edger is very, very helpful. However, be sure not to paint against one side, then place that painted side against something you don't wait painted. Oops.
          • Painter's tape it good, but not a cure-all.  Some paint actually seeped under it. In other places, pulling the tape off de-laminated the paint, since the paint formed a continuous sheet from wall to tape. So, it helps but don't rely on it too heavily.
          • A paint stirrer isn't that helpful -- a lot of paint sticks to it. A free paint paddle would have worked fine.
          • Rollers are wonderful. Brushes are much slower and harder to use.
          • It's really fun to see the results after you're done! Not perfect, but much, much better than it was...
          Here's the final result. If only I could paint that fast in real life...