Tuesday, September 27, 2016

Building compling installing linuxcnc on Ubuntu Studio 16

I want to share with you how to build linuxcnc on Ubuntu Studio 16.

Why is this so important?

I want an open toolchain, so I'm working with linuxcnc and freecad.

It's tough to install both on the same machine at that bleeding intersection since 1. linuxcnc lags Debian releases somewhat and 2. linuxcnc requires realtime kernel, while 3. freecad is a new project in explosive development (with no expectation of supporting older Debian releases presumeably?).  At the moment, freecad-daily is non-trivial to run on the current 2.7-linuxcnc install iso.  They're off by one Debian release. 

Hypthesis: Ubuntu 16 Studio to the rescue!

My hypothesis is to run freecad and linuxcnc under Ubuntu 16 Studio to leverage the realtime kernel.  Anyone out there doing this btw?

Here are my steps to compile linuxcnc on Ubuntu16 Studio.  Linuxcnc runs all 100+ unit tests with no warnings or errors and 'linuxcnc' from the command line starts the program.  I have not (yet!) configured a machine or calibrated the servo threads.

Future attempts to run freecad-daily there may be made.


 1162  git clone git://git.linuxcnc.org/git/linuxcnc.git linuxcnc-dev
 1164  cd linuxcnc-dev/
 1166  cd src
 1174  sudo apt install libmodbus-dev
 1176  sudo apt install libusb-1.0-0-dev
 1182  sudo apt install libglib2.0-dev
 1184  sudo apt install libgtk2.0-dev
 1186  sudo apt install bwidget
 1188  sudo apt install libtk-img
 1190  sudo apt install tclx
 1196  sudo apt install libreadline-dev
 1199  sudo apt install tcl8.6-dev
 1201  sudo apt install tk8.6-dev
 1204  sudo apt install libboost-python-dev
 1208  sudo apt install libxmu-dev
 1209  ./configure --with-realtime=uspace --enable-non-distributable=yes
 1210  make
 1211  sudo make setuid
 1212  source ../scripts/rip-environment
 1213  runtests
 1214  linuxcnc

Links


* http://linuxcnc.org/
* http://wiki.linuxcnc.org/cgi-bin/wiki.pl?LinuxCNCKnowledgeBase
* http://noahvawter.blogspot.com/2016/09/building-compling-installing-linuxcnc.html
* https://github.com/LinuxCNC/linuxcnc
* http://wiki.linuxcnc.org/cgi-bin/wiki.pl?Installing_EMC2
* http://linuxcnc.org/docs/devel/html/code/building-linuxcnc.html

Wednesday, June 10, 2015

Monday, October 27, 2014

Activities of the Evening

Bass Sticks

The good news is I finished the Music-Optimized Breakout Board I started at Framingham Makerspace last Wednesday.  All I had to do was add two headers, a diode, regulator and crystal to each of the 3 boards.

Then I was able to test-boot each one.  All three came up the first time!  I haven't run further diags yet, but it's worth soldering on the rest of the headers so I can do so.


Sunday, October 26, 2014

Activities of the Week

The last week was very busy...

Bass Sticks
I was especially delighted to do some work in the Framingham Maker Space again!

Soldering New Boards
I soldered down most of the SMD components on a round of Music-Optimized Breakout Boards.

Mounting New Sensors
A few nights before that, I mounted the 4 new sensors that arrived for the bass stick (see Caught a Cold ).

Determining Optimum Resistor
Before making permanent mounting boards for the sensors, I needed to determine the optimum resistor to pair each one with.  I made a test jig for doing that and verified it work along with a Matlab script to plot and analyze the recorded signal and detect the resistance that produces the highest signal-to-noise ratio.  From what I've seen so far, it's between 35 and 40 dB.  Next step is to make this measurement official, buy some resistors and make a permanent board. 

Electric Eels

A Duet
Back at the MIT Maker Faire a few weeks ago I played an amazing duet with one of the organizers.  She was on fiddle and skillfully improvised a 2nd part to my lead on the classic hymn Silent Night.   By a nice bystander, it was recorded.  I was actually very shocked and surprised to play - caught off guard hearing a second note sounding after rehearsing it alone so many times - and what's more, the player's rhythm danced around the main line like a dancer whirling a beginner around on the floor.

By the second verse we played, we started to hit it off musically a little more and I was able to hear some of her stylistic expression and accompany them, pausing between phrases and accelerating the tempo in the middle of them.  I would love to do more like this:  This was the whole entire point of making these instruments - to play live electronic music along with others! 

A Tuning Correction
Also during that duet, the violinist showed me the tuning was slight incorrect for the Electric Eels - about 20 cents or 1/5 of a semitone. This surprised me since the math in the software had been carefully conceived accurate, but it was true nonetheless.

So I also spent a few minutes this evening, discovered the cause and fixed it.  This required digging out my old black MacBook to edit the software and upload it.  I made an attempt to start a repo on BitBucket with it, but the commands I tried didn't work.  That was probably because it appeared to have already been a git repo?!  I'm not sure how that happened, I'll have to look deeper into that.

Despite the confusion with the source control, it was very nostalgic to edit the old code again.  By the way: to fixi it was a simple matter of changing the number '90' to '89' in the initialization...

Speaker Grille

Also, if you remember back to last week, I made a new, wooden speaker grille for the Red Electric Eel at the Framingham Makerspace.  I sanded the edges of that grille to fit better inside the instrument this evening.  With the edges sanded, it fits nicely, a tight fit.  This will protect the speaker from unusual foreign substances I have discovered inside there, like popcorn, both stryofoam and the kind made from corn kernels.


I Broke a Wire!
During all of these Electric Eel operations, I managed to break a wire on the keyboard.  That took a few minutes to fix, but the news here is that the terminal on the keyboard switch itself had worn itself off!  I guess the light brass-like material gets brittle with vibration over time.   I'm not surprised, this keyboard didn't have sufficient strain relief like most of the others built after it.  At some point, I'll overhaul the whole thing, but it will hold for now, through the Christmas season.

Magnetic Field and Inductance
I also spent a lot of time reviewing material on fields and inductance. Each time I go back to this topic, I get a little more of an intuitive picture of how it all works.  I hope some day to understand it fully!  Or at least enough to make highly efficient generators, motors and speakers. 

General
Speaking of the Christmas seasons, today Tanya bought a set of 10 mini Christmas Carol books with lyrics and sheet music.  I'm delighted we'll go caroling with friends! 





Wednesday, October 15, 2014

Activities of the Evening

Well after the guest lecture I gave yesterday evening to students at UCLA on "Sound, Audio and Music in Media and Video Games," I was very tired, so I didn't really get much done on music instruments:

I updated the mechanical drawing for Bass Stick a little bit on the battery holder. 

I also started to saw the wood for a speaker grille for the Red Electric Eel, but it was making a lot of noise late at night and I didn't want to disturb my neighbors. 

All in all I went to sleep early...  and while it was not very restful, it at least produced some interesting dreams which I attempted to interpret.  My girlfriend Tanya had a very different interpretation of them, so that was something fun for us to talk about.

Then onto this evening!  It was the second Open House night at the Framingham Maker Space!  So I brought my saw, wood, clamp and drill to complete the Red Electric Eel Speaker Grille. 

It went extremely well!  The huge open space was perfect and I got it done.  It was also nice to have a shop-vac available for clean-up.  That's one solid advantage to working at my own apartment!

It was especially interesting, because I knew something was off in the coping saw I had just bought, but I couldn't put my finger on it....  Luckily, one of the other people there that night, Dave Pogue, brother of Core Member Dan Pogue, pointed out that the saw had arrived with the blade backwards.  Yes!  That's why it was working so poorly!  So he and I figured out how to reverse the blade and I sawed through the wood in record time :)  yay!

That's the benefit of working in a co-working space!

I also remember just how informative it can be to show people how the Electric Eels worked.  I spent about 10-20 minutes discussing the various aspects of the musical instrument to Dan and Dave, bright people who listened intently, interrupting only when they burned with curiosity to ask a question.

On the way home, my old friend Kristiaan Vaarnik called me!  He's a mysterious figure who's been out to see me perform several times in the Boston area, back almost 10-12 years ago!  I assume we first met through the underground scene around Hrvatski, but who knows!  Anyway, it was brilliant to talk to him again about his new ideas for an instrument and I was especially surprised to learn that he is the mastermind behind the ShapeChangingInstruments blog!  Yes, I've been reading it for about a year now and I'm delighted to find out he runs it!  Check it out if you get a chance, especially his concept for a "Modular Acoustic Instrument."

So after doing all that, I went through my first little tutorial on the Rust programming language.  It certainly starts you off very underwhelmingly.  I found a few issues:
  1. The Rust installer doesn't actually install the package manager "cargo" as it says it does when you install under windows (yes, I know, why windows?  cuz, I need to run lots of Windows apps to do electrical engineering, so I keep a cheap Win 7 laptop)
  2. The cargo package manager doesn't tolerate whitespace in its table names.  Seriously?  Why not!  Geez and it essentially silently fails.  That's pretty weak, b/c whitespace seriously helps keep code organized and readable... so I hope that changes
  3. Man what a boring tutorial.  Ok, sure the first step is Hello World, that's good.  The second step is the package manager, ok I like it.  But the third step: make a program that uses a variable and string interpolation but never even compiles?  Come on!  That's pretty drab.  I know, I know, again it's up to *me* to do something interesting with it... so I guess I'll let it slide.  Still, if they want to get more beginners, like my Mom and girlfriend, programming, they'll probably do better to have some interesting examples.  Gosh!

Monday, October 13, 2014

Activities of the evening

It was a short night due to working late, but I managed to get some progress on the Bass Stick:

I drilled four slits into the top of a cigar box for the new pressure pads.  It was scary doing this because the surface was otherwise so pristine, so seeing even small gouges on it looks violent, but it's really just part of the creative process.  They will be smoothed and finished and ultimately, these holes have an important purpose:  That's how the pressure pads connect to the rest of the instrument!

The pressure pads themselves are larger than the old ones.  I found the old ones, when playing, became tricky to focus on.  People often missed the tiny target spot in their centerthat produced the sound.  One the new pads, the target patch for making a sound should be much larger!

Also, I'm choosing four pads instead of the older instruments which had two.  Why?  For flexibility and more sonic diversity.  For example, I can dedicate one pad for major chords/sounds, one for minor, one for a single note lead, and one for a background pad.  Do people really need all those options?  Does it take away from the simplicity?  We'll see in play-testing, but I believe it will lead to a greater diversity of sound, which is part of what electronic music is all about!

I also temporarily mounted the pressure pads using scotch tape.  This allows me to re-position them to match their locations to players' fingertips.  Once I complete the electronics and software tasks that make these new pressure pads work, I'll be able to play the instrument and fine-tube the pads' locations.

Also, I decided to exchange some late night time-wasting for going through the tutorials for that new computer programming language called Rust.  My first step was to install Rust on my windows laptop.  I verified the compiler executes from my Cygwin shell and then went to sleep.  Tutorials can now begin immediately!  I'm excited to learn Rust because it's a logical next step from programming in C/C++ for people like me who want to go in the direction of high-performance without going in the direction of huge, clunky APIs and run times (Java, Python).