Tuesday, March 8, 2016

Beaglebone Black Boot Only From SD Card

After my unpleasant experience with the BBB crashing and corrupting it's own OS in eMMC, I decided that to use BBB in my application I have to ensure its reliability by forcing it to boot from SD card like the original Beaglebone. After a bit of a scare where it seemed as though this always required the boot button to be pressed on the board itself (it does not always require this, only when there is a viable OS in eMMC), I uncovered various sources which explained which configuration file on the BBB to lobotomize to make it boot from SD card every time without having to push any buttons on the board.

This link is typical of most instructions for booting from SD in that it mentions holding the boot button on the card without explaining any further. Also it includes the usual instructions for using the SD card to load the OS into the eMMC. Despite not being what I was looking for, this was notable for being one of the clearest guides to getting started with upgrading the BBB to Debian outside of BeagleBone's own web pages: http://thethingsystem.com/dev/Bootstrapping-the-BeagleBone-Black-with-Debian.html

The BeagleBone:Debian wiki is a maze of poor documentation, I'm afraid. Here is the map through the maze that I've developed as a result of feeling my way through it multiple times:

Here is the top-level wiki page for how to install Debian. It makes mention of an image "that can run from a microSD card" but that link just goes to another wiki page. It's actually easier just to get the SD image from the BeagleBoard.org page; through trial and error I've verified that the same image works fine on both the original BeagleBone and BBB. Further down the page, it mentions having to hold the boot button and provides a link to a FAQ that supposedly answers how to boot from SD every time. That FAQ is just a link to yet another page. http://elinux.org/Beagleboard:Debian_On_BeagleBone_Black

Here's where the link to "an image that can run from a microSD card" goes. It's a confused tangle of a whole pile of different images, from ones for eMMC, stripped down ones, ones for other Beagle products, and in there is a prebuilt image for SD card. Again, easier just to go to BeagleBoard.org. http://elinux.org/BeagleBoardDebian#BeagleBone.2FBeagleBone_Black

Here is a different page on the wiki for an image for SD card. In a block quote, it has the first clue about what modifications on the eMMC to cause it to go to the SD card by default. The hint has us deleting the MLO file (which apparently can only be accessed by mounting the BBB as a thumb drive). However, other instructors mention just renaming the file which is clearly a wiser method. http://elinux.org/Beagleboard:Updating_The_Software#Image_For_Booting_From_microSD

Here is one of those corroborating links for the method of deleting/renaming the MLO file: http://perf.tamu.edu/perftech/beaglebone-black-boot-from-the-minisd-card/

In my case, since the eMMC had been fully corrupted, I didn't have to touch the MLO file. I was able to move the SD card from my BeagleBone to the BBB and everything worked exactly the same, except that now I can hook up an HDMI monitor (more on that later). In fact, when I connected the BBB to my PC via USB, nothing mounted, so I never got a chance to try out this hint. I might go through the steps for flashing the OS to the eMMC just to see if I can restore my BBB to factory settings so I can rehearse this hint!

Using Audacity to transpose pitch

It turns out that in addition to having all the high and low pass filtering I could ever need built in, Audacity will let me frequency shift the sound up and down! Neither the effects menu or the help files refer to this as "transposing," unhelpfully; the option is under "Change Pitch" near the top of the effects menu.

https://garagebandmeetupsingapore.wordpress.com/2010/04/25/using-audacity-to-transpose-tracks-change-pitch-without-changing-tempo/

Op Amp Stability

It turns out that the output voltage of one of the op amps that we are using for our fixed voltage source will ring when the load is placed across it using the analog mux. The other op amp truly produces a fixed voltage using a unity gain follower and does not respond to the addition of a load, but the one that has the problem is the one that's supposed to adjust its output to produce the fixed voltage on the other side of a current sense resistor. Searching for ways of improving stability, both I and my coworker initially focused on the usual method of adding damping to the feedback loop with first a resistor and then an RC network. Here are some links that discuss this method. Most of them focus on doing simple frequency analysis that I haven't been able to do for decades and should really refamiliarize myself with.

http://cds.linear.com/docs/en/application-note/an148fa.pdf

http://www.st.com/web/en/resource/technical/document/application_note/CD00176008.pdf

Eventually, I found a couple of forum threads where a guy had a circuit sort of similar to ours, where he was trying to turn on a MOSFET with an op amp and his circuit's step response showed ringing identical to ours. He felt his way to a different looking solution which turned out to be the one that worked great for me, which was putting a capacitor between the output of the op amp and the negative side of the feedback loop. Actually, this seems topologically very similar to having the cap in parallel with the feedback resistor, it merely also includes the sense resistor (or in this person's case the MOSFET Gate-Drain resistance) which is to say the entire feedback loop. In this person's case, he was more interested in understanding why his SPICE model hadn't caught the problem. Anyhow, this feedback topology is actually covered in the above tutorials as the "in the loop" compensation method, and the presence of inline resistance before the feedback is also discussed as a prime cause of instability, so it turns out that all of the sources that I found are actually in agreement.

http://electronics.stackexchange.com/questions/175652/how-to-test-op-amp-stability/175656

http://electronics.stackexchange.com/questions/176669/why-doesnt-ltspice-predict-this-op-amp-oscillation/176696


Thursday, March 3, 2016

Import MP3 to MIDI Software

Searching for software which can convert audio to sheet music or MP3. It's basically a lot to ask and doesn't work very well. Also at the moment there aren't a lot of software packages making any promises of being able to work.

Neuratron is a conversion software, but it promises to work only on simple, clear audio with no drums. It's also fantastically expensive: http://www.neuratron.com/order.asp?country=US

The brashest promises I've found are for Intelliscore, which says something like "just play your favorite pop song into the program and watch it unravel": http://www.intelliscore.net/demo.html

People that bought it on Amazon were rather displeased with it: http://www.amazon.com/IntelliScore-Ensemble-Converter-transcription-software/dp/B00A69PA64

Fortunately, Intelliscore offers a free demo version which it has been very instructive to try out: http://www.intelliscore.net/demo.html

The result from just trying the demo was quite a mess, exactly as reported on Amazon. However, any pop music is going to be sonically complex so it's not hard to understand how this might result. Probably the program would do better if I could apply filters to the MP3 to limit the frequency range to either the bass or treble treble ranges. I started searching for programs that could do digital filters since I didn't want to add extra hiss by going through an analog filter. I found hardly any programs that would do this, and I think there are a couple of reasons. There's probably not a sufficient market for stand-alone filter software, and it turns out that good old Audacity has tons of plugins that do filtering.

Here's a list of all the Nyquist plugins including the filters. It turns out that I didn't need to download anything, my copy of Audacity came with everything I needed pre-installed. The list is very interesting however and contains very good descriptions of each filter. http://wiki.audacityteam.org/wiki/Download_Nyquist_Plug-ins

Here's a forum where somebody discusses how to use the filters in Audacity. http://audacity.238276.n2.nabble.com/High-pass-and-Low-Pass-can-t-wrap-my-head-around-em-td241453.html

This is an interesting discussion on the same forum of how to use filters to clean up voice recordings: https://sourceforge.net/p/audacity/mailman/message/26961565/

Eagle Schematic import DXF

As with most things in Eagle, it does not import DXF files natively, but users have written some ULP scripts to do it. The way that these scripts tend to work is that they read the DXF and convert it into Eagle-native draw commands to redraw the contents of the DXF. For some reason, all DXF import scripts that I've found so far just skip importing text from the DXF; all you get is the lines and shapes. In my case, importing a drawing border file, that is enough to get started with.

Cadsoft has a least made it easy to find ULPs by providing hosting and indexing for scripts submitted by their users. If you just go to the following link and type 'DXFimport' into the search tool, you get a variety of versions of this script, starting from an original script and going up to version 1.6 with improvements by several different users resubmitted under the same name and new version levels: http://www.cadsoftusa.com/downloads/ulps

Interestingly, the hint about where to find this came from this post on Cadsoft's own Facebook page concerning version 1.5 of the script: https://www.facebook.com/cadsoftcomputer/posts/556869044353063

Also interestingly, version 1.6 of the script can also be downloaded from github here: https://github.com/erikwilson/import-dxf

This forum post mentions a different script which I haven't tried which might be either better or no longer available: https://www.element14.com/community/thread/16729/l/importing-a-dxf-file-into-eagle-610-steps?displayFullThread=true

Here is another thread where that script is discussed, with links to an article with more detail that I haven't yet tried to follow: https://www.element14.com/community/thread/21171/l/import-dxf-file-in-eagle-pro-620?displayFullThread=true

Tuesday, March 1, 2016

Can Eagle export a netlist to PADS

A page to accumulate answers that I find to this question. As with most Eagle questions, the answer seems to fall within the realm of "no, but users have written some scripts or something to do it but there are no guarantees."

For now all I have to report is the following interesting link:

A blog post from somebody who I guess wrote a netlist file converter. http://www.neufeld.newton.ks.us/electronics/?p=120




Eagle CAD hints and tips

The learning curve for Eagle is proving to be familiarly painful. Part of this is because much like AutoCAD, it seems to be so loaded with options that it's hard to access them all. Here's a list of important non-intuitive tricks that make it possible to use the software.

1. When creating parts (in my case, borders), you have to draw the part as a "Symbol", then go to Device (where it might or might not be necessary that the new part name match the name of the symbol just defined) and click the "Add" button and add the symbol that you just drew! If you don't do this, when you try to add the part to a schematic, the part is found in the library but it's blank. It's possible to update the symbol later and use the "Update library" function in the schematic tool to pull the changes into the schematic without having to update the "Device" in between.

2. When running the DXF import ULP, you have to be editing a Symbol when you run the ULP and the script that the ULP produces. The ULP simply produces a series of draw commands. It is a good idea to manually fix which layer the drawing is done in (the most recent version of the ULP allows this layer to be chosen ahead of time via dialog).

3. To copy things from one symbol to another, you have to select them as a group, then press the "copy" button while the group is selected. Then you have to close the symbol (can't have more than one up at a time apparently), open the target symbol, then press the "Paste" button to get the copied items attached to your mouse pointer to be set down. A link with the example that helped make this clear:

http://www.bot-thoughts.com/2012/09/eagle-cad-copying-between-schematics.html

4. To manually select items to add to a group rather than using a select border, you need to press control while clicking each item!!! If you accidentally do something that loses the group selection, you can easily get the selection back by pressing the group button again.

5. To do things to a group once the group is selected, you press the button that corresponds to the action (like copy, move, delete, or any of the options under "chanage"), then ctrl-right-click on an item in the group to perform the action on the entire group!!!!!! It is possible to change the size of a bunch of text items in a group with this method if they are all text items.

Here's a link where right-click is explained as important: https://forum.sparkfun.com/viewtopic.php?t=10681

6. To copy a group, such as components and wiring, or a block of text items, select it as a group, then you can right click on the group and get a context menu. None of the context menu items apply to the group except that at the bottom there will be a "Copy: Group" option. You can select that, then close the drawing that you are copying from and open the drawing that you are copying to. This seems to be the sole exception to the pick-an-action-then-ctrl-right-click paradigm described in the previous hint.

Here's a forum thread in which many contributors describe this process: https://forum.sparkfun.com/viewtopic.php?t=2449

7. To create properties for the title block of the border, you add text with the special character '>' in front. Then on the schematic you can create an attribute of the same name for the part to have the value substituted for the word in the part. N.B.: the attribute needs to have display set to 'none' or the value text will show up in both places, in the area of the schematic where the text being substituted is and also as a floating attribute value initially placed next to the handle for the title block. Tom had a lot more familiarity with how it's possible to layer this feature, but for now here is a somewhat funny link in which a bunch of people propose workarounds to avoid using the substitution feature because they don't understand it, and then somebody comments at the bottom thread explaining how it is supposed to work but doesn't get any likes!

http://electronics.stackexchange.com/questions/93773/editing-title-block-frame-in-eagle