This week’s lesson is to learn embedded programing. I am familiar with Arudino, UNO, mini pro, digispark or ESP8266 wifi module. This time, I tried to learn something new. So I chooose MBed this time.
What is mbed
From wiki, I got this description: Mbed is a platform and operating system for internet-connected devices based on 32-bit ARM Cortex-M microcontrollers. Such devices are also known as Internet of Things devices. The project is collaboratively developed by ARM and its technology partners.
It’s an online IDE, a little different form Arduino IED platform. I hope it’s a start point for my final project.
First open https://developer.mbed.org/ and created an account. You need an account to begin your exploration of MBed. Create an account or signup with the accout you have created. Click on the right-up button to proceed. mbed_signup
After Login, click the compiler button to the IDE UI. You may need to add platform when you first login. mbed_signup
When a dialog popup, you can change the platform or add new platform as you wish, click the Plus button to proceed. mbed_signup
Choose from the board form multi-vendors, and click it. mbed_signup
It’s a detailed description of the board, of cause there are detailed pin mapping you can refer to. Click add to your mbed compiler and return to the compilter UI. mbed_signup
Then create a program from the template or choose the empty. mbed_signup
At the IDE, you may change the code, compile it or export it out for offline development. mbed_signup
This week’s lesson is to redraw the hello-world board. What I got is the CAD file and some pcb graph. I have played with eagle for some time, so I decided to to use Eagle to finish this homework.
I download the eagle software from cadsoftusa site. There are different platform for Windows, Unix and Mac. You can use it for trial (30 days) or free (non commercial use only). For fab users, 10cm*10cm size and 2 layers of PCB limitation of free use is not a big problem, because our assignment is only require one layer, for most of the task, two layers is OK.
Eagle library
For fablab we have fab.lbr file. Just copy the fab.lbr file to the eagle’s lbr directory. You may need to use fab.lbr from the control panel manually if not. There are more commonly used lib file can be obtained from Adafruit and sparkfun. Here is the link:
Also you can change the eagle’s library settings, add a path to the library files.
Prepare the PCB
The original hello.ftdi.44.png are here. To add a button and a LED, we need to redraw the schematic file first. I googled some simple schematic file for reference. The main part is attiny84, to make it running, we need to add VCC, GND, capacitors, resistors, and resonator, a button and a led to get it work.
hello.ftdi.44.png hello.ftdi.44.components
Add a button and LED
Finally I got a sch like this. I connect LED to PA7 and BUTTON to PA3, let the button input to stay high.
schematic_1
I want to use autorouter fuction to finish the work, I had never tried a single pcb layer before. I change the layer 16 to N/A, and pressed the autorouter button, to my surprise, I got a single layer pcb file.
auto_route_pcb_1.png
I change the global setting, setting the clearance all to 12mil (0.3mm), which can make sure the copper lines are not to closely.
clearence_settings.png
It is not look very terse like the original one, so I decide to manual route it. So I made some change to the schematic file, change to port of button and led, and using internal pull up function of attiny85, the modified schematic looks like
schematic_2
and the manual routed pcb is more beautiful.
manual_route_pcb1.png
extra credit: simulate its operation
I just noticed eagle 7.5 has the simulation function. It’s worth to have a try.
Kicad Fab lib files
In this week, I converted the fab.lbr file to kicad format using eagle’s plugin, and I’d like to share it.
My 3D printer was bought in the mid of 2015, which was based on delta struture, it was made my DFRobot, a wellknown robot module and 3D printer company.
overload_pro_printer
It’s printed object size : Cylinder : 170mm x 260mm Height. I once test it with a status like this, it looks fairly good.
overload_pro_printer
It has many advanced feature such as:
– Dual color print. – Break point resume – Auto/Manually calibrate buildplate – Heater bed
Cura
Cura is developed by Ultimaker to make 3D printing as easy and streamlined as possible. It includes everything you need to prepare a 3D file for printing and to print it. Cura is fully preconfigured to work on the Ultimaker. Cura comes with a friendly setup program that help you install the latest firmware as well as calibrate your printer.
For the overload pro, dfrobot provided a detailed setup manuan which can be download here: overlord user manual(pdf) . I will not repeat all the settings here.
STL TEST FILE
From thingiverse, I download an “Test your 3D printer” from web.
ctrlV_3D_test_preview ctrlV_3D_test_preview
Cura’s quick print provide 4 options of printing:
Object size is : 505014
Fast print Layers:92 0.15mm
Nomal print Layers:138 0.10mm
High quality Layers:229 0.06mm
Ulit quality Layers:344 0.04mm
I printed 3 version of this model, fast, normal and high: ctrlV_3D_test_preview
It takes less than an hour to print the fast one, and takes 2 hour to print the normal one, the third one uses 3.5 hours. The third one has a lot of very very thin filaments between the cylinder and cubes. The normal one seems good in all of the three. The fast one has many large end points on it.
I think there maybe a lot of parameter to adjust, such as the temperature, fan speed and the nozzle temperature. For our overload, I think 0.1mm fairly good for printing. If need to print larger objects, I can try the 0.15mm settings.
Design and 3D print an object (small, few cm) that could not be made subtractively
The second objective for this week was to design and 3D print an object that cannot be made subtractively. I highly enjoyed this assignment because it allowed me to think creatively, develop an idea, and then turn that idean into reality - in the span of a week. Since the objective was to design something that could not be made subtractively, I thought I would design some structure that is trapped inside a larger structure.
At last I found one thing, it’s the sample object of overload pro, A whistle. Inside a whistle there is a ball in it. when blow the whistle, the ball will vibrate and make the sound. It’s not easy to make it using subtractively way.
a_whistle a_whistle_inside
Another interesting is the Jellyfish. It has long hands, by randomly print 16 line beam without support, it will fall to the ground like the hands of Jellyfish. The randomness is because we are deliberately “printing in the air” to create the “drooloops” (droop+loop) that make these jellies look so amazing.
jelly_fish
The model: jelly_fish_cura
jelly_fish_single
3D scan an object (and optionally print it) (extra credit: make your own scanner)
Traditionally, there are two ways of hobbyists making custom PCBs:
Using toner transfer and chemical etchant – can be tricky to get the right materials, and the chemicals are nasty and messy
Paying a service in Taobao – fairly inexpensive, but usually have to wait a long time, like 5-7 days in China, but It will 2-3 week worldwide.
Milling them on a CNC is a quick way with a different set of pros and cons:
The good:
Quick turnaround - don’t have to wait days or weeks for it to ship
The mill does the drilling
No messy acid to deal with
Once you have good settings, the process is easily repeatable
Two sided boards are possibly slightly easier than with etched boards
Inexpensive - you’re just paying for blank circuit boards which are a couple bucks each
The not so good:
Bits and end mills can be expensive and they wear out.
Bits of copper clad fiberglass get all over the place
Milling a board can take a while
Board stock and mill bed flatness will present a challenge
Isolation size is a function of bit size and mill accuracy. Check your design carefully before you plan on using fancy SMT parts with densely packed pins.
How I’ve Made Things Work: I’m a CNC newb and an electrical engineering disaster so my milling process and the following outline use what I’ve determined to be the most common (though not necessarily the best) tools.
Those tools are Eagle CAD, pcb-gcode, Mach 3 CNC, 30deg V Shaped Engraving Bit.
CNC Machine was an DIY machine, the xyz of the machine 400300150mm, the spindle speed can reach 24000rpm.
cnc_machine_01
I ordered 20 V-shaped engraving bit, I like the dual blade V shape engraving bit, with 30 degree,and 0.2mm of the pin head. With the speed over 10000rpm, it can cut pcb easily.
V-engravers not only have different tip sizes, but different angles. The larger the angle, the less it widens as depth increases.
0.2 mm, 30 deg V-engraver, 3.175mm shaft. I also got 0.2mm, 20 deg ,and 40 deg V-engraver. Endmills can go down to as low as 0.3mm, which is very expensive and prone to break and the speed may be very limited.
v_shape_engraving
Board Parameters:
1oz copper is “standard” PCB. That’s 1.4mil of thickness. If using PCB Leveler, 0.1mm is plenty of cutting depth below the surface. FR4 thickness is 0.060” for standard PCB. Thicknesses of 0.031”, 0.017”, and 0.010” are also common. Thinner boards are lighter and fit into tighter spaces. In some cases, the flexibility of a thinner board may create a risk of cracking components off it when the board bends.
4”x6” 0.060” (100mm x 150mm x 1.5mm) PCB is a good general-purpose size, and fits on the Taig easily. You can get thicker copper, 2, 3, even 4 oz is available, but these are where exceptionally low electrical or thermal resistance is needed. In the case of thermal resistance, note that it has no greater surface area, but 1oz copper foil can only conduct heat away from a soldered thermal pad for about 1/2”, past that, more copper may exist, but the lateral thermal resistance is so high that it contributes to improved heat dissipation only marginally. If the thermal pad is only 1/2” past the component, then a heavier copper won’t improve things, but if a very large board area is used as a thermal pad, then heavier copper can be much better. In most cases though, for higher dissipation, heatsinks are used.
FR1 is much cheaper than FR4 and easier to be milling. In this lesson I used FR4 double side and FR1 one side to do the test.
Generate Text: NO (you can if you want, if your board doesn’t have a lot of text)
Spot Drill Holes: NO
Isolation: (this is where it may require tweaking, esp for V-engravers)
Default: 0.0254mm (the program starts by moving out 0.5* “Etching Tool Size” from the traces, PLUS this number. This allows you to add to the tool radius to account for the wider path of a V-engraver as it cuts deeper and thus wider, but really doesn’t make much sense instead of adding that to Etching Tool Size, they both do basically the same thing)
Maximum: 0.508 (how much clearance we cut before stopping. PCB code will NOT wipe all the copper out by default, it’s a waste of time. Takes Etching Tool Size into account. Steps are always full Step Size, so the last step will generally create more clearance at the end)
Step Size: 0.127mm (after the first pass, how far out is the next. Can potentially be as much as Etching Tool Size, but usually “less than half” is a good idea)
Etching Tool Size: 0.2mm (tip size)
Machine:
Z High: 12.7mm (position for rapid travel)
Z-up: 2.54mm (where to slow down to plunge-cutting speed)
Z-down: -0.1mm (engraving depth, foil is only 0.035mm itself, but board warpage makes this unpredictable)
Drill Depth: -2.2mm (to drill all the way through 0.060” PCB)
Drill Dwell: 0.25 sec (how long to wait before pulling back out).
Tool Change: X0,Y0, Z25.4mm (where to lift the head for manual bit changes)
Units: Millimeters
Spindle Spin Up Time: 0.5sec
GCode Style
Mach3-EMC for windows Profile
Feedrates:
The feedrate guideline charts totally break down with tiny cutters. The spindle of CNC at high speed is 15,000 RPM, I set all the speed to 254mm/min, and it works good.
Machine Calibrations
It’s very importand to make the single-side pcb board as flat as possible. I use a Electronic digital indicator digital indicator scale measurement tools,from Masterproof, which can make sure the platform is very flat.
v_shape_engraving
And using 4 blots the fasten the PCB board on the CNC platform. v_shape_engraving
Milling and Cutting
When prepare the pcb board, add layer 46 milling with the border of the PCB board. Then we will have two top-layer cnc-gcode. One is for etching and one is for milling. “fabisp.top.etch.tap” is for the etching and “fabisp.top.mill.tap” is for the cutting.
First load the fabisp.top.etch.tap file and do the etching and after that change the tool and load the fabisp.top.mill.tap to seperate the pcb from the whole board.
The most important thing when do the etching is the set the z height. The height of the level touch is 8.85mm. Usually we need add 0.1mm to that, to adjust the Z-level to make it perfect on the PCB board. That what I learn from the learning progress.
Hit http://security.ubuntu.com wily-security/universe Translation-en Fetched 543 B in 7s (68 B/s) Reading package lists… Done W: GPG error: http://archive.ubuntukylin.com:10006 trusty Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY D259B7555E1D3C58
When do the software update, prompt GPG error NO_PUBKEY, there is a common methods to solve this problem.
design, make, and document a parametric press-fit construction kit
Using Inkscape to Create a Inkscape Flourish
It will be using variations of freehand and Bezier(pen) tools.
There are five steps to follow :
Make Branch
Make Stems
Make Leaves
Make Flowers
Position parts
First set the Documents properties to Landscape, and click Draw Freehand Tools, setting smooth to 44 and shape to Triangle in, and draw a curve like this:
inkscape branch
Second draw more curves as stems, and click the curve, drag the pink square at the curve beginning to change the width of the curve. You may try this several times and delete unwanted curves. In the end got something like below. In the end we will rearrange the stems.
inkscape stems
Then we prepare leaves and flowers. First draw two eclipse, and resize one to form a leaf.
inkscape leaf
Then move a stem to the leaf, and using Path –> Deference to cut the stem from the leaf. inkscape leaf inkscape leaf
Using duplicate function to get bunch of leaves. And add two small eclipse to the leaf, forming a petal of flower.
inkscape petal inkscape petal
For parametric desgin, I first insert a polygon as the center of the flower. and resize the petal close to the center of flower. I using Creat Tiled Clones to other 5 petals, and rotate each petal the right position.
inkscape petal inkscape flower
The petal can be easily changed by modifying the orginal petals. inkscape flower
The last thing is to place flowers and leaves, reposition the stems, make it beautifuly. inkscape flower
For the laser cutting, I plan to cutting an easy object. So I choose to make a small round table and a few bench. The diameter of the table is 10cm, the height is about 8cm. With two cross connected boards to do support. If I scaling down the table, it can be treated as bench. The board is about 3mm thick, considering the laser cutting gap. The real slot width is set to 2.6mm. I add one more round board to hide the connection of the base support.
Autocad Small Table
Autocad Small Table
The laser cutting is perfect, the table is like this
Autocad Small Table
For the little bench, I make it a quarter of the round table. It can be hidden under the round table. So I make four bench. All move out:
Autocad Small Table
It’s looks great! Autocad Small Table
When put all of bench under the table: Autocad Small Table
Inkscape is an open-source vector graphics editor similar to Adobe Illustrator, Corel Draw, Freehand, or Xara X. What sets Inkscape apart is its use of Scalable Vector Graphics (SVG), an open XML-based W3C standard, as the native format.
Vector design is often the preferred method of image creation for logos, illustrations and art which require high scalability. The Inkscape application is used across a wide variety of industries (marketing/branding, engineering/CAD, web graphics, cartooning) and individual uses.
This year is the Chinese Year of the Monkey, I’d like to engrave a monkey logo on the base station of the the final project. So I decide to use it.
First, I find a image from goole advanced images search, with keyword monkey. I got a colored toy monkey image as this:
monkey_from_web
Then I copy a block of image to the clipboard and past it to Inkscape.
monkey_to_inkscape
By adjusting Trace Bitmap and set Brightness cutoff to 0.46. I got a black and white image.
monkey_to_inkscape
Then reduce the nodes using path simplify tools, it will reduce the points of the vectors and retain the outline of the original picture.
monkey_to_inkscape
monkey_to_inkscape
Change the stroke type with Fill none, Stroke paint no color, and Stroke style with 1.2 mm width.
monkey_to_inkscpe
Duplicate the path with alternative using CTRL+L and CTRL+9, adding more inset vector path to form a picture like the original raster picture. And this file will be ready for print.
monkey_to_inkscape
ImageMagick and GraphicsMagick
On Mac OS, first need to install brew. Then get imagemagick and graphicsmagick via brew.
GraphicsMagick is originally derived from ImageMagick 5.5.2 as of November 2002 but has been completely independent of the ImageMagick project since then. Since the fork from ImageMagick many improvements have been made (see NEWS) by many authors using an open development model but without breaking the API or utilities operation.
So it’s roughly same as imagemagick, just add gm before the imagemagick command like this:
During the first week of the Fab Academy, we were also asked to present our final project idea, detailing it as much as we could. The aim was to have a first idea, not very complicated, and could be improved and modified later, so that, in the end, it uses as much techniques learned during the assignments as possible.
My idea so far, is to build a rotating led strip around a pod, which driver by a high speed motor. When it rotating at 1800rpm, it will be looked as a globe. By controlling the leds on and off. It can display a scrolling text or an static image.
rotating globe
I want to put an ESP-12 wifi module in it. So it will be controlled by an android app. It will receive the text and image from an ardroid phone. Either you write and message or take a photo, after a few seconds, it will be displayed on the rotating globe.
During this first week, the goal was to familiarize ourselves to web development and in order to achieve that, to create our own website to present ourselves, our final project idea and to document every step of our training.
I used to using Sencha extjs to create some apps, but extjs is a little heavy for blog type web pages. So I decided to find a small and easy using framework. After a few baidus and googles, and following the advice of Marvin Felix, one of our Shenzhen co-students, I chose HEXO for the framework. It’s really easy to use and deploy, I keep the hello-world page for the reference of init and creation of new post.
For the html editor, I use my favorite tool, TextMate. I like the cobalt color scheme. I even change my Arduio IDE color scheme the same with TextMate. To my surprise, it support markdown type syntax. I can preview the page directly in preview mode. It’s realy a good tool to recommend.
Here’s Hexo’s website : [hexo] (https://hexo.io/) It’s only a few steps to create a blog template like this :
install Xcode if not, and install brew, and using brew install npm and nodejs
install hexo: npm install -g hexo
init a hexo workspace : hexo init fabwork
start hexo server : hexo server –debug
new post : hexo new “01-project management”
generate static page : hexo generate
After this, the default blog is ready for you to modify.
Edit Tool Textmate
01-project-management.md file is on the _posts folder, and on the foot bar, the syntax format is set to Markdown.
To reduce the photo size. I use imagemagick’s posts command line tool to do the trick. When I got a image from screen cap, it was png format. I need to change it to jpg with quality 80% and resize to 75%, which can reduce the file size round to 30%-40%.
The other main subject of this first assignment is to learn ho to use GIT, which is a source code management system for software development. Source code management is very important because it allows you to keep history of every version and every changes that you have made on a particular file or set of files. With the help of git, everything will recorded and nothing will be lost.
For me, GIT branch command was a little bit uncomfortable to use at the beginning. I used to directly push the files to the master. But with the help of @00, the article on git introduction, I finally was more comfortable with the whole thing.
Basically it is quite simple because it only consists on passing lines of command into the Mac Terminal to communicate with the Git Lab once it is configured.
Copy the Hexo generated files to fablabnanjing directory
1
liujun-mac:fabwork liujun$ hexo generate
INFO Files loaded in 416 ms
INFO Generated: 2016/02/02/01-project-management/index.html
INFO Generated: 2016/01/31/Week-01/index.html
INFO Generated: 2016/01/31/hello-world/index.html
INFO Generated: archives/index.html
INFO Generated: archives/2016/index.html
INFO Generated: archives/2016/01/index.html
INFO Generated: archives/2016/02/index.html
INFO Generated: index.html
INFO 8 files generated in 132 ms
liujun-mac:fabwork liujun$ cp -r public/archives/2016/fablabnanjing/students/203 \
../fablabnanjing/students/
Go to fablabnanjing dir and show git status
1
liujun-mac:fablabnanjing liujun$ git status
On branch liujun_dev
Your branch is up-to-date with 'origin/liujun_dev'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: students/203/2016/01/31/Week-01/index.html
modified: students/203/2016/01/31/hello-world/index.html
modified: students/203/archives/2016/01/index.html
modified: students/203/archives/2016/index.html
modified: students/203/archives/index.html
modified: students/203/index.html
Untracked files:
(use "git add <file>..." to include in what will be committed)
students/203/2016/02/
students/203/archives/2016/02/
students/203/css/images/textmate_03.jpg
no changes added to commit (use "git add" and/or "git commit -a")
Push the file to the git server
1
liujun-mac:fablabnanjing liujun$ git add students/203/
liujun-mac:fablabnanjing liujun$ git status
On branch liujun_dev
Your branch is up-to-date with 'origin/liujun_dev'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: students/203/2016/01/31/Week-01/index.html
modified: students/203/2016/01/31/hello-world/index.html
new file: students/203/2016/02/02/01-project-management/index.html
modified: students/203/archives/2016/01/index.html
new file: students/203/archives/2016/02/index.html
modified: students/203/archives/2016/index.html
modified: students/203/archives/index.html
new file: students/203/css/images/textmate_03.jpg
modified: students/203/index.html
liujun-mac:fablabnanjing liujun$ git commit -m "<< >>"
liujun-mac:fablabnanjing liujun$ git push
Everything up-to-date
Presentation of my Final Project During this first week we were also invited to present our ideas for a final project. You can find this presentation in the final project post on the right side.
My final project is Rotating Globe. A high-speed rotating acrylic circular plate, embedding with an WS2812 led strip. Using phone app to control the display text or images. Be able to identify gestures, switching the contents of .
My Lab
I’m taking the Fab Academy at Fablab Nanjing (FNL) in Jiangsu, China. Fablab Nanjing
About Me
Hello, I am Liu Jun, from Nanjing. I’m also one of the co-founders of the Fablab Nanjing. I like machinery, electronics and programming. My hobby is long distance running and swimming.