Tuesday, November 22, 2016

Bench Power Supply Panel - Create CNC GCode from .STL file

I'm building a Bench power supply from a leftover PC power supply.  It will initially have +12 -12, +5 and +3.3 volt outputs, with a voltage and ammeter available for each output voltage.  Later, I'll be adding other outputs, powered separately by a transformer.

The front panel will be cut out using a Linux based CNC router.

Current status of this page:  Not quite there yet.

When viewed in LinuxCNC, the .ngc file has only data on the x axis.  I don't think we're ready for 1 dimensional physical objects yet!

Software to convert STL to NGC format.


On problem I needed to solve is the creation of a Linux CNC GCode file for the panel from the downloaded STL file from Onshape.

I've installed LinuxCNC's distribution in virtualbox.  In this virtual machine, I'm attempting to install stl2ngc from github - stl2ngc README.md

Before executing the opencamlib and stl2ngc build instructions on that page,  there's a number of pre-requisites that need to be installed.

 Here's the list of commands for installing the pre-requisites:

apt-get -y install cmake
apt-get -y install doxygen
apt-get -y install libboost-all-dev

Now you can follow the instructions in the stl2ngc README.md file:

git clone https://github.com/aewallin/opencamlib && cd opencamlib
mkdir build && cd build && cmake ../src && make -j4
sudo make install

git clone https://github.com/koppi/stl2ngc && cd stl2ngc
make
sudo make install
sudo mv /usr/local/lib/opencamlib/libocl.so.11.10.66 /usr/lib
 
See Note 2 below...
 

Get the .STL File from Onshape.com


Here's the Onshape page for the Bench Power Supply Design  the panel's STL file can be downloaded from there.  see note 1 below if your browser doesn't have WebGL enabled.

In the Onshape page for the power supply,
  • click on the Front Panel Tab.  
  • right click on the Front Panel Tab and select Export.
  • Choose Format:  STL
  • Choose STL Format: Text
  • Choose Resolution: Fine (might as well)
  • Click OK
Front Panel.STL will be in your Downloads folder.



Using stl2ngc:

 
cd ~/Downloads

cat "FrontPanel.stl" | stl2ngc > "Front Panel.ngc"


Note1: 

Onshape uses WebGl, which is not enabled by default in iceweasel, the browser in the LinuxCNC distribution.

from stackoverflow: How to enable WebGL on Iceweasel
  1. Enter into URL about:config
  2. click continue.
  3. search webgl
  4. find webgl.force-enabled right click and left click Toggle
  5. verify webGL works by visiting website get.webgl.org

Configuring LinuxCNC

 

 


Note2:

I had trouble running stl2ngc, so I added the move command above.


While both opencamlib and stl2ngc build correctly, the opencamlib ends up in /usr/local/lib/opencamlib.
This is not in your library path unless you add it, either for a single invocation or permanently. 
 
See Stack Overflow for an explanation that doesn't seem to tell the whole story covering this case:
Is /usr/local/lib searched for shared libraries?
 
One thing that works is:  

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib stl2ngc 

which will set it only for that invocation.

While this works, the permanent way is to get the library into the load library cache.  I was not able to do this correctly so I did ta bit of digging. 
 
/usr/local/lib/opencamlib contained libocl.so as a link to  libocl.so.11.10.66.  My hypothesis: This may be an error and it needs to be  a link to /usr/local/lib/opencamlib/libocl.so.11.10.66  or alternatively libco.so.11.10.66 needs to be moved to /usr/lib.

Moving it to /usr/lib seemed like the easy way to go, so I did that.  Now stl2ngc runs without complaining that it cannot find the library.
 
Ah the mysteries of linux....
 
Maybe someone can explain what I really should have done.





Monday, November 21, 2016

Air Coils

One of the most basic parts of many flight instruments is a device called an Air Core.  Air cores can move indicator needles of various types to a specific position based on two input signals that are 90 degrees out of phase, a sine and cosine wave.  The relative strength of these two signals determines the position of the indicator.

Mike Powell, the author of a now out of print book on building simulated flight instruments has a web page dedicated to construction of air cores: http://www.mikesflightdeck.com/instruments/diy_aircore_instruments.html

In looking at Mike's work in light of today's opportunities with 3d Printing, I came up with a nearly identical design for a hand built air core.  This so far untested design was created using a free account at Onshape.com and can be viewed using this link.

https://cad.onshape.com/documents/bdb91a1db5071919b3f06d12/w/1df14a84c751a7ce78a21975/e/d75c2da92298d8f9ce8b478c

At this point I am just beginning construction, so the design may change.

Like Mike's design, the mine fits inside a 1" long piece of 1" EMT tubing.  Some minor adjustments will be needed because some of the parts will be slightly different.  The Armature of the air core will be 3d printed.  I'll be using a slightly larger piece of Music wire for the shaft.   Mike uses Brass for the bearing at the front and rear of the shaft, I'm going to try nylon instead.

I'll be trying to drive the device with an arduino and an H-Bridge.  No doubt I'll be getting a lot of help with this part of the project.  I also expect to learn a lot more about electronics in the process.

I've joined the local Framingham, Ma - Makerspace to get access to various machine and electronic tools. 

Parts:

1" EMT
9/16 Brass Tube
Armature (3d Printed)
38 AWG magnet wire
.032 Music Wire
1/4 Nylon Rod
Tubular magnet magnetized across the diameter
1" fender washers (for additional shielding)



The first 3D printing of the armature was less than spectacular, but the Outer housing came out great.

Lessons learned:
  • Printing took 1:30.
  • Kyle Rivers at Framingham Makerspace advises trying slower print to get the small features to come out better.
  • Since the center of the armature came out well, try making the armature as stock, without the cuts for the winding at the top and bottom.
  • The outer housing was made using a band saw for the initial cut, with the first edge milled flat on a lathe.
  • The second edge was cut 60% on the lathe and finished with a hacksaw.
This Blog follows: The Flightgear Wiki - How to Build Your Own Panel or Cockpit