Keep em tidy

As soon as I started milling multiple materials I understood I had to find a solution for keeping my milling bits organized.

It wasn’t straightforward for me to understand I can’t use the same 1.0mm endmill for aluminium and plexiglass, but once you see the finishing that becomes clear. Then my 10 pack of 1.0mm endmills got rapidly messy.

I then thought I could literally build a milling bits holder, but I wasn’t satisfied with the designs out there:

BitBox

Made out of wood and using some readily available hardware (M3 nuts and screws), it’s a handy and simple design capable of housing 40 endmill types, each one in multiple instances, so to always have backups, plus some spare space for additional items and non-standard bits.

Bit_Box_2017-Oct-13_09-23-22PM-000_CustomizedView32598991534_jpg

But when I was mid through the build process, I realized the number of endmill types I would have needed to store was more than double!

I then went for a completely different solution, this time buying something already existing, but definitely much more compact and sturdy:

Each holder in the picture can safely host fifty 1/8in endmills and I got three of those for a grand total of 150 endmill storage/indexing capability: a lot more than I need right now.

But now finding the proper endmill can be a bit difficult unless I use a little grey matter to fix that: a proper index table for my holders.

As you can see on the table I have the endmill number (matching the number I have configured within Fusion360 tool library), the bit dimensions and, on the right, the bit shape and number of flutes (when applicable).

It took me quite a few iterations to get it right, but in the end, I got a very satisfying result, both in terms of alignment/sizing and readability: here is the spreadsheet I created.

I used a colour laser printer, some heavyweight paper and a good cutter: now all my bits are nicely classified, indexed and secured!

 

Advertisements

Combine Maven profile properties

I have fought with this problem a couple of times, but now I found a way out.

Let’s say you have a Maven POM and, depending on the active profiles, you want to set a property, like:

<profiles>
  <profile>
    <id>ci</id>
    <properties>
      <spring.profiles.active>something</spring.profiles.active>
    </properties>
  </profile>
  <profile>
    <id>dev</id>
    <properties>
      <spring.profiles.active>another</spring.profiles.active>
    </properties>
   </profile>
</profiles>

You should know by now that using mvn package -Pdev,ci is not going to produce the outcome you would expect: the spring.profiles.active Maven property will have a value of something, the last one of the activated profiles.

You actually have no straightforward way to concatenate properties in Maven, but the following will do:

<plugin>
  <groupId>org.codehaus.gmavenplus</groupId>
  <artifactId>gmavenplus-plugin</artifactId>
  <version>1.6</version>
  <dependencies>
    <dependency>
      <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy-all</artifactId>
      <version>2.4.9</version>
      <scope>runtime</scope>
    </dependency>
  </dependencies>
  <executions>
    <execution>
      <id>excludedGroups</id>
      <phase>initialize</phase>
      <goals>
        <goal>execute</goal>
      </goals>
      <configuration>
        <scripts>
          <script><![CDATA[             def value = ""             (project.activeProfiles).each{ profile -> value += profile.properties.springProfiles + "," }
            project.properties.springProfiles = value.substring(0, value.length() - 1)
          ]]></script>
        </scripts>
      </configuration>
    </execution>
  </executions>
</plugin>

The plugin, activated at the very beginning of POM processing, will create a property springProfiles with a value resulting by concatenating the properties defined in the active profiles.

The same configuration, with a slight variation, is also usable to concatenate JUnit categories:

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-surefire-plugin</artifactId>
      <configuration>
        <excludedGroups>${excludedGroups}</excludedGroups>
      </configuration>
    </plugin>
    <plugin>
      <groupId>org.codehaus.gmavenplus</groupId>
      <artifactId>gmavenplus-plugin</artifactId>
      <version>1.6</version>
      <dependencies>
        <dependency>
          <groupId>org.codehaus.groovy</groupId>
          <artifactId>groovy-all</artifactId>
          <version>2.4.9</version>
          <scope>runtime</scope>
        </dependency>
      </dependencies>
      <executions>
        <execution>
          <id>excludedGroups</id>
          <phase>initialize</phase>
          <goals>
            <goal>execute</goal>
          </goals>
          <configuration>
            <scripts>
              <script><![CDATA[                 def value = ""                 (project.activeProfiles).each{ profile -> value += profile.properties.excludedGroups + "," }
                project.properties.excludedGroups = value.substring(0, value.length() - 1)
              ]]></script>
            </scripts>
          </configuration>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

<profiles>
  <!-- Exclude any tests in `SlowTest` category when profile 'skipSlow' is specified. -->
  <profile>
    <id>skipSlow</id>
    <properties>
      <excludedGroups>SlowTest.class</activeByDefault>
    </properties>
  </profile>

  <!-- Skip any tests in 'WindowsTest' category when not running on Windows. -->
  <profile>
    <id>skipWindowsTests</id>
    <activation>
      <os><family>!windows</family></os>
    </activation>
    <properties>
      <excludedGroups>WindowsTest.class</excludedGroups>
    </properties>
  </profile>
</profiles>

Launch the above as mvn test -PskipSlow on a non-Windows machine to have both SlowTest.class and WindowsTest.class JUnit categories excluded.

Happy concatenation!

Git Tricks

Git is a great  SCM / VCS, but sometimes it can be scary: unless you start keep trace of those useful commands which can save your day!

basic-remote-workflow

If your git knowledge is a little on the beginner side you might start with the following tutorials:

Stash

Ever needed to get back to a clean repo to apply a quick fix while you are in the middle of something and plenty of changes waiting to be committed?

# stash any changes to tracked files
$ git stash

# stash only unstaged changes to tracked files
$ git stash --keep-index

# stash untracked and tracked files
$ git stash --include-untracked

# stash ignored, untracked, and tracked files
$ git stash --all

Merge

The default fast-forward merge strategy is not always the most advice-able with regards to your repo history tree:

git merge ff.gif

Often a non fast-forward merge strategy generates an easier to follow history tree:

git merge no-ff

# merge with no fast-forward
$ git merge --no-ff

Condensed status

Git status is quite verbose, but it’s easy to make it condensed, if you can handle the compressed display format:

$ git status --short --branch

Proper init

Creating the central repo is an administrative task you don’t want to leave to the occasional developer: git first commit cannot be rebased.

$ git init
$ git commit -m “root” --allow-empty

Fix last commit

How many times you discovered you missed something in your last commit? This will fix it without adding a new commit to your history and messing it up.

$ git commit -m 'fixed stylesheet'
# (facepalm)
$ git add css/main.css
$ git commit --amend --no-edit

Force, delicately

It’s sometimes inevitable to force a push, but you can try to do it in the most delicate manner possible:

# force your push, but first ensure you are up to date with the remote
$ git push --force-with-lease

Aliases

Make all the above commands shorter using aliases:

# git `please`
$ git config --global alias.please 'push --force-with-lease'

# git `commend` aka commit and amend
$ git config --global alias.commend 'commit --amend --no-edit'

# git `staaash`
$ git config --global alias.stsh 'stash --keep-index'
$ git config --global alias.staash 'stash --include-untracked'
$ git config --global alias.staaash 'stash --all'

# git `st` aka short status
$ git config --global alias.st 'status --short --branch'

# git `grog` aka graphical log
$ git config --global alias.grog 'log --graph --abbrev-commit --decorate --all --format=format:"%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(dim white) - %an%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n %C(white)%s%C(reset)"'

Docker on RaspberryPi

Installing Docker on a RaspberryPi might seems overkill, but it actually works pretty well, even if installing the tools can be a little messier if you don’t know how to do it and you start searching the Internet for clues.

After being intimidated by the many alternatives given to you to overcome the lack of a docker package on the official package repositories you’ll start wondering which might be a secure way to start playing with Docker without compromising your system security: here is what I have done.

The Client and the Server

First thing you need is to have the Docker server along with the command line client installed.

The RaspberryPi Foundation, within their blog, recommend to simply use:

$> curl -sSL https://get.docker.com | sh

That’s an official shell script which will identify your operating system and architecture (don’t forget we are on an ARM processor) and install the most appropriate binaries.

The Compose

After playing for a while with Docker you’ll start to feel the urgency to use the docker-compose tool, which sadly is another missing element.

I’ve found the simplest way to have it running is by executing the following two commands:

$> sudo apt-get -y install python-pip
$> sudo pip install docker-compose

Othermill Pro – Plastic

It’s a couple of months now the Othermill Pro is beautifully sitting on my desk and after having milled a few PCBs and showed off with my family and friends I feel dauntless enough to try something new.

I’ve got a small selection of end-mills and I didn’t want to break them all straight away with some tough material, so I opted for creating something out of plastic: a few key tags with a name on it could have done the job and milling a softer material should have be painless, right?

Sadly, I couldn’t have been wronger! As you can see from the result shown below, plastic has this unpleasant desire to melt when thermally stressed… As any other newbie I’m in a learning process.

image

Looking at the outer border it should be clear the end mill was going clockwise and melting begun at 2 o’clock.

When milling plastic you must keep the material as cool as possible, meaning you need to reduce the end-mill friction with the material as much as possible and also add any possible cooling. If the plastic starts to melt it will clog the end-mill, reducing the end-mill cutting efficiency causing an increment in friction and a consequent rise in temperature: a spiral process which results in a very bad milling and also a potentially unrecoverable end-mill.

So this is how I started learning about chip load and chip load chart tables:

chip20load20graphic chip20load20for20common20tool20diameters20inches

I’m not going to lecture you on the subject, mostly because I don’t know enough on this topic. Briefly, in order to minimize temperature rise you want to maximize the chip load thickness, reducing the rubbing effect of the end-mill on the material, which causes temperature raise without any benefit.

As clearly displayed on the diagram above, chip load thickness is determined by axial speed (rpm), radial speed or feed rate (in/m or mm/m) and number of flutes (# teeth):

CLT = feed rate ÷ rpm × teeth

Now, luckily for me, the CAM software I’ve adopted (Fusion 360) already performs those calculations and automatically adjust the parameters accordingly.

So I opted for the thickest suggested chip load on acrylic (0,13 mm) for my end-mill (a 2 flute 0,8 mm) and a very slow rotation speed (100 rpm) in order to give a little breath for the plastic to cool down: to my surprise the end-mill got clogged immediately, even worse than my previous experiments!

Apparently the just acquired knowledge is misleading, or… Should I trust my ears? Even just considering the pitch of the gentle sound emitted by my Othermill Pro I can tell the spindle is not going as slow as I planned! A quick check at the technical specs just to discover the slowest spindle speed is 8500 rpm!

That practically means the chip load was 1/85th of what I was expecting, resulting in my end-mill gently massaging the plastic surface until it turns into a smoking hot glue-ish material perfectly mating with my end-mill!

It’s time for another try, but before ruining my last end-mill (yes, the last run turned my end-mill into a glowing ball of plastic around a metal rod) I wanted to verify how accurate is the spindle speed control on my device.

Surprisingly the Othermill Pro spindle is an open loop circuit. If you are wondering what that means don’t be too ashamed, it was my very same reaction, but a little googling and you discover it means there is no feed back circuit: simply put, the machine doesn’t know how fast the spindle is actually going, it only knows at certain voltages the spindle should run at a certain speed.

Not that it is a crucial information, but given the high quality and accuracy of this CNC I was expecting some feedback, but at a second tough and considering the main aim of the Othermill Pro it does make sense why Othermachine Co. didn’t think about it.

May be I can do something about that…

Github project website

This is nothing new, but apparently not many Github users know about this feature and I’ve recently learnt an easy way to set it up.

But let’s step back for a second: what are Github pages?

it’s a web space granted to each Github user and project where you can publish anything related to the subject: users might decide to publish their curriculum/resume or contact information while a project might publish a nice looking documentation.

A good set of information is available via a mini site which already guides you through the setup process, so I’m not going to reproduce that here.

Briefly, for a project site, the site contents are going to be hosted withing the project git repository (it does make a lot of sense to me) whitin a dedicated branch gh-pages.

What I wish to share is the set of git commands you can use to setup an existing project to host a clean Github pages setup.

Within the project folder you want to run:

git checkout --orphan gh-pages
git reset
touch .gitignore
git add .gitignore
git commit -m "gh-pages setup"
git push -u --all

You will end up with an almost empty folder (don’t panic, your project is not gone!) apart for the empty .gitignore file.

The project is now displaying what is published on your project’s Github pages, which is nothing at start. You can easily switch between the project contents and the project website by using the git checkout command:

  • git checkout master re-populates your project folder with your project contents
  • git checkout gh-pages brings you back to project website editing

The nice part of the above sequence is the newly created gh-pages branch is not going to share anything with your code branch structure or, if you prefer, master is not a parent for gh-pages!

You can now populate the website with your content using your HTML5 or MarkDown skills, or you can use one of the readily available templates from Github to get a nice looking index.html page to start from.

Also, additional and advanced features are available for multi-page websites via Jekill, but that’s another story.

FlexiPower: the interview

Following the enthusiasm of my previous post, I wish to share an interview a good friend of mine gave to me the latest days of August for his own blog.

The original interview run in Italian, but here I’m posting an English translation: thank you Francesco for pushing me into learning Arduino! 🙂


Zeirus: Hi Roberto. Can you explain with few words what FlexiPower is and which use, us mortals, can do of it?

Roberto: Hi Francesco, I’ll be very glad to do so! FlexiPower is a tool thought for electronic enthusiasts, being newbies or advanced. It is a portable power supply providing two independent channels, both voltage and current controlled. It might seem a niche instrument, but it’s not: anybody playing with an Arduino or a Raspberry Pi, but also those very beyond that phase, know it is an important tool. Usually they are bench instruments, heavyweight, powered by mains e quite expensive, in the order of thousands euro. Normally a newbie would look for cheap Chinese clones, but those have important culprits and might be extremely dangerous.
I wanted to keep costs down in my project, but I didn’t want to sacrifice anything in terms of quality, so I went for an headless instrument, without a screen or any physical user interface, but a remote control via a smartphone and a WiFi connection, with the advantage FlexiPower can be remotely controlled from the other side of the world! Going for a smartphone also allowed me to introduce a feature only the most expensive versions of these tools provide: continous and prolonged logging of current output, and the ability to plot a diagram.

FlexiPower_00

Zeirus: Did you base FlexiPower on some already existing project? If so, what have you specifically added/tweaked to make it “better” than the original?

Roberto: Obviously I hardly copied from another project made by somebody much more experienced and knowledgeable on electronics than I am: Dave Jones, author of a popular electronics channel on YouTube, did publish multiple videos describing, step by step, his own project uSupply. From an end user perspective FlexiPower adds a second channel a completely drops the physical UI, originally consisting of two rotary encoders and an LCD screen. In reality I had to face multiple little and less little problems, many of which I wasn’t aware of until I broke my nose on them.

La schermata di settaggio con presets La schermata del canale #2

Zeirus: How many hours/days have you spent so far developing FlexiPower?

Roberto: To be honest I’m not sure I can quantify it. If you consider I first had to learn how to create such type of instruments… actually I’m not sure I’ve understood all the secrets. After  had to learn the details of the starting project, study each of its components and understand their characteristics. From that point I started to believe it would have been easy, after a few months I undestood how much I was wrong. I don’t think it’s a lie to say I did spend no less than 10 hours a week for the past 18 months working on FlexiPower. Clearly most of the time was during the weekend and holidays, for the greatest joy of my partner!

Zeirus: I can only imagine her Posso solo immaginare la gioia immeasurable joy!🙂
Do you believe your senior experience on the Java programming language has anyhow helped you? 

Roberto: No, I don’t think so, to say the truth. Micro controllers are commonly programmed in C and even the smartphone user interface has been developed as an hybrid application, so based on JavaScript…. I would say Java has little to do with the whole project, but my software developer background has definitely guided me toward the remote interface and, maybe toward a new perspective on those type of tools, with characteristics reserved to more expensive ones.

Zeirus: Which open-source softwares did you use to develop your project? Do you believe they are up to the task or is there still something missing?

Roberto: That’s truly an interesting question because I did try many EDA softwares (CAD dedicated to electronics) for this project, but many were under my expectations: rough, impractical or extremely limited. Then something turned around my opinion: almost a year ago, during the Rome Maker Faire, I met somebody from the company producing the market leader software, Altium. Clearly their top of the line product , you can easily imagine that, is priced comparable to a car, but they had recently released a free version of their software called CircuitMaker. The only real limitation is you have to share your creations.
As a truly convinced supporter of open source I couldn’t avoid a try and I was really impressed by the tool quality: no surprise they are the market leaders. Up to now I believe it’s the best free tool for creating electronic projects, way above the old classic tools like Eagle CAD!

CircuitMaker_Editor_Ubuntu_Wine

Zeirus: That’s great! It’s a pity CircuitMaker is not – yet – available on non Windows platforms (even if you can actually make it work in Ubuntu via Wine). Anyway, do you believe electronics nowadays is simpler than in the past? Let’s say twenty years ago? If yes, what do you envision for the new twenty years? 

Roberto: Absolutely! Arduino has turned the micro controllers and digital electronics into toy, accessible to practically anybody. Just follow an online tutorial and you’ll learn how to burn a few components and get addicted. I still remember when my older brother was learning PIC micro controllers, spending hours to program them to blink an LED using an UV lamp to erase the chip!

Now you can get the  same results with 5 lines of code, an USB connector and you don’t even have to know the principles of electronics. Sure, after burning to death a few LEDs you might start to learn you need a series resistor, but isn’t a pleasure to see those bright little bastards die into smoke?

Zeirus: With the exclusion of the merciless genocide perpetrated against “those bright little bastards”, would you know consider yourself a true maker, or do you still miss “something” to be one?

Roberto: Everybody decides to build something starting from little or nothing can consider himself a maker, in my opinion. I believe I became a maker when i built my first LED cube, a miniscule 3 x 3 x 3 still sitting on my office desk which I’m really proud of!

perfboard

Zeirus: What is the tool you still miss in your maker “lab”?

Roberto: I don’t know where to start. To be honest my lab is contained inside 3 drawers of my home desk, including all the electrical components collected so far, the numerous boards and a certain amount of prototypes.

I don’t have much space in my house as I don’t own a garage or a room dedicated to myself only, so anything I use must hidden to sight when not in use (Zeirus’ note: that means hidden to his partner’ eyes! 🙂) . I own a little oscilloscope, with ridiculous characteristics, but adequate to my current needs. A multimeter, pen style soldering iron, a set of tweezers and screwdrivers, a caliper and little more. A tool I am aiming for is a CNC milling machine to quickly realize PCBs for my prototypes…

Zeirus: I know FlexiPower is going to participate as best project of the year on Circuit Maker and the competition will close in a few days! Are you near project completion? What is still missing?

Roberto: In reality it’s Project Of The Summer 2016, a competition closing by the end of August for which I spent a lot of time to refine FlexiPower. The project is at a really good stage, I just sent out an order for the second round of PCBs (10) as the first ones were unusable: I have made some mistakes, it was my very first time… I already have the components to build 4 prototypes of the FlexiPower, even if I believe a couple of tries to realize the next round of improvements.
The software is only in a very alfa status at this stage, but that’s not my top concern as that is my daily bread. I’m more concerned about the PCBs, I hope I didn’t made any other silly mistake this round: I obviously underestimated the complexity in such task and I wasted a lot of time in trial and errors… but I believe I’m there now!

Zeirus: Well, as we say: practice beats theory!😉 … The final question! Be honest: do you believe your project is a first place one?🙂

Roberto: Sincerely I can’t evaluate that, but I threw in all my enthusiasm and energy so that others, more knowledgeable and experienced then me, might consider it worth for the competition.

I would be really praised to receive a recognition for my project, but that’s not the reason why FlexiPower exists. I hope it will become the most forked project, possibly with great contributions from the CircuitMaker community… and it’s in a good shape so far!

Zeirus: Wonderful! Than there’s nothing left other than wishing you the best for the final result!

Roberto: Thanks a million buddy!

Am I a Meta Maker™?

Yesterday has been a special day for me.

It started as any other day of my recent life, with a late alarm after a too short sleep. As usual I had my morning shower and rushed into the office were I spent my day working together with the other members of my team and running meetings with my partners abroad: a day as many others, as I said.

It was quite late when I finally returned home, but I knew my day was not over yet: an electronics project is waiting on my desk, expecting somebody to troubleshoot the issue currently preventing the I2C bus communication.

I have spent countless nights working around this project, with great joy for my partner!

It all started because I wanted something compact to power my electronic projects, an hobby that caught me unarmed a couple of years ago, may be three.

Now I have this splendid (to my eyes) circuit board on my desk: a couple of plastic arms keep it suspended, while few wires depart from it to reach diagnostic interfaces, in an attempt to provide the information I’m seeking for.

In July and August my work on this project got an impressive boost: I decided to enter the CircuitMaker Project of the Summer 2016 contest.

img-about.png

I knew there were many, and much more experienced, people going to participate, but I wanted to be part of the game nonetheless: you need to test you abilities to know where you stand and you can improve.

Obviously, I must admit, I had hopes when I threw myself into the competition: I really wished to win the prize, that precision CNC looked so cool! Not to mention it’s a tool I would definitely wish! But before competition closing I had a look at the top projects and they looked so amazing…

maxresdefault

Well, I don’t stand a chance, but it was the opportunity to finish the project! I won already! Now I just have to solve this damn I2C issue…

So, yesterday I received an email…. The email contained a link to a blog post… but my name wasn’t in there. That didn’t surprise me much, I thought

Hey, look how cool are the runner up projects! I wasn’t even aware of that one…

There was also a YouTube video embedded in the post, so to discover my project was among the finalists! (Hey Ben, click on this link, please! smiley-10225)

Really? Did you really took my project into consideration for the final? Is it really so cool?

That was exactly my thinking while I was getting excited, now calling in my partner to join me and share with her the news.

 

Can you imagine my reaction when we got close to the end just to discover the big suprise? Well, something like…
celebrate.gif

Can you imagine how good it feels to get a recognition for your hobby, the thing you do just because you like to do it? And suddenly somebody tells you Well done buddy, this is really good!

It is just amazing guys, really amazing!

I wish to say Thanks! to all those who voted my project on the CircuitMaker community: you have been the ones who pushed me into the competition in first place!

Also I wish to Thanks! Dave Jones, the author of the uSupply, the design the FlexiPower is based on: you have thought me, you have inspired me and I know I have just made a few modifications to a great design!

I wish to say Thanks! to you guys at CircuitMaker for your great tool, it really feels great working with it: I finally feel like I have a professional EDA in my hands and the community and support is just great! Keep going lads, you are doing great!

Obviously I wish to say Thanks! to the young pretty lady from Othermachine Co, Danielle Applestone, for selecting FlexiPower as winner: I swear I didn’t bribe her!

Finally, but certainly not least, I wish to say Thanks! to my family and friends, who supported me along the route, with a special mention to Annamaria (my partner) who had to go in bed alone, in the cold winter nights of Central Italy (?!?!), so many times, while I was chasing my maker dreams sitting at my desk…

Thank you!
Thank you so much!

thank-you