Marco Di Feo – Blog Development, Hobby, Everything

15Mai/130

DIY CNC Fräse – The Milling Project – Part 1

Es ist mal wieder so weit, ich wage mich an das Thema kleine selbst gebaute CNC Fräse. Das Internet ist voll mit Informationen und über die letzten 2 Jahre in denen ich mich mit dem Thema beschäftigt habe wurde ein Entwurf nach dem anderen erweitert und wieder verworfen.
Ich hatte damals die Idee eine kleine, kostengünstige CNC zu bauen. Nichts verrücktes, so günstig wie möglich. Dann kam ich vom hundertsten ins tausendste. Aus den normalen M6 Gewindestangen wurden schnell Trapezgewindestangen, aus Schubladenführungen high end Linearführungen und aus meinem Dremel als Bohrkopf eine profi Lösung für mehrere 100 Euro. Liest man sich weiter durch diverse Internet Foren kommt man auf allerlei Schnickschnack. Da fragen User nach eine DIY CNC und werden erstmal mit der Ungenauigkeit der eigenen Idee gefolgt von verschiedensten Fachbegriffen und "MUST HAVE"s (wie z.B. Gravurtiefenregler) geplättet. Von der Ansteuerung und den Schrittmotoren ganz zu schweigen.

Kurzum, mir ging das alles ziemlich auf die Nerven. Ich mag es ein Projekt so kostengünstig wie nötig und dafür so gut wie möglich zu bauen. Ich habe aber keine Lust für eine CNC Fräse 1000€ auszugeben (selbst das reicht ja nicht) um damit 10 kleine Fräsprojekte die mit einer kleinen Toleranz auskommen. Das ganze gelese über Fräsen hat mein Hirn einfach überfrachtet, so dass mir die Lust darauf verging. Alleine die Vorstellung einen CNC Community Shit Storm wegen meiner schlechte Kenntnisse über mich ergehen zu lassen, weil ich an einer Stelle nicht weiter komme erregte in mir das Grauen.
Letztens habe ich dann aber doch wieder das Thema CNC Fräse aufgegriffen und habe mich ins Internet gestürzt.

Meine Vorstellungen waren diesmal klar definiert. Kein Schnickschnack, keine Trapezgewindespindel, keine Linearführungen, keine speziellen Motoren etc... Also wirklich eine CNC Fräse als DIY Projekt, ohne Technologie Kram von dem ich keine Ahnung habe. getreu dem Motto "Learning by doing". Erst wenn ich in meinen Ergebnissen sehe, dass ich keine Platinen Fräsen kann, oder dass 1-2mm Toleranz für alles zu viel ist, was ich mit der Fräse vor habe, dann will ich die nächsten Schritte vornehmen und mich mit dem ganzen Zeug befassen, von dem ich gelesen habe.
Vorerst bleibt es bei normalen Gewindestangen, Nema 17 Motoren usw. Das genaue Setup wird hier peu a peu veröffentlicht werden.

Also hoffen wir auf gutes Gelingen und harren der Dinge, die da kommen

25Apr/130

Step aside commandline, this is a job for Powershell

After i saw a slogan "step aside coffee, this is a job for alcohol" I came to this geeky version :)

coffee alcohol step aside commandline this is a job for powershell

coffee alcohol step aside commandline this is a job for powershell

veröffentlicht unter: Allgemein keine Kommentare
21Feb/131

Drive Max7219/Max7221 with common anode displays

As you maybe already know, the max7219 and max7221 chips are serially interfaced (SPI) 8-bit LED drivers. These chips work perfect on 7 segment displays if they have common cathode pins, because they are designed for those display. If you have common cathode 7 segment display you get in touch with the benefit of these led drivers, because they handle the multiplexing in an easy way. They have built-in bcd decoder for easily displaying information and if you don't want to use the decoder you can byte-wise set every digit of your display. For example, if you want to display the number "0" without bcd decoding, you create the bit mask as follows:

7bit-segment

7bit-segment

The bit mask for number "0" is: 0x0111111
To display this number you have to address (e.g.) digit1 and send your "number byte" afterwards. That works perfectly.

3Dez/122

Publisher 2010 PTXT9.DLL problem – solution

It stumble across a weird problem with Microsoft Publisher 2010. After we installed Publisher 2010 at some computers, the users responded, that it doesn't work. They could open Publisher without any problem, but if the click on a tab at the Publisher start screen, a message appeared, that ptxt9.dll could not be loaded.
After some research I found different KBs about replacing a corrupted PTXT9.dll and how you could extract it from the Publisher 2010 CD and so on. That didn't help me, neither did regsrv32.exe PTXT9.dll help.
So I did the usual analysis with sysinternals procmon and procexp. I saw some strange access denied messages from the registry. After updating the registry ACL the problem still exists. Publisher was some kind of broken. So I went to the installed programs. After scrolling to Publisher I recognized, that Microsoft Office 2010 Professional Plus was installed as well. So I tried to uninstall Office, because Publisher is Part of the Office package (but was installed as a stand alone version). Maybe that has something to do with this problem. I was wondering, because Publisher worked like a charm after a reboot.
Happy about this I reinstalled Office via SCCM and started Publisher again... and it was broken again. Our Office installation had something to do with my broken Publisher. The first step guided me to the installed programs -> Office 2010 Professional Plus. I clicked "modify" to change the features that come along with Office.
After searching for Microsoft Publisher at the installation options I recognized, that Microsoft Publisher was installed correctly (because I did a stand alone installation), but the .NET programming support underneath was not installed.
After I added .NET Support and finished the setup Publisher was working again and the Problem was solved, YaY!

Your Office installation should look similar to this:

Office - Publisher 2010

Office - Publisher 2010

22Okt/120

Powershell – Script automation with jobs (AD Quota)

After working a while with Powershell and doing some time expensive jobs like getting the quota of all Microsoft servers I came to the point when i was looking for some parallelisation in Powershell. My problem was the quota script, that executes the following command for each file server:

dirquota Quota List /Remote:$server

Actually we have a couple of servers and need to get the quota from all servers to calculate the file system usage and built a daily statistic.
The first script collected the data from each server. Since this is a boring job, because reading a file stream and writing it to a local file is really boring, even for a computer. I wanted to accelerate this step. So i got in touch with Powershell and jobs.

Jobs are (dont kill me) distantly related with multithreading in .NET. Indeed, multithreading in .NET has many more advantages and features than in powershell, but as a beginner (some years ago :) ) in development i didn't do anything more than just starting threads and wait until they are finished (Yep, invokation was a foreign concept to me). So this relation is not so far out.
Anyway, jobs do a great job if you have time consuming actions over and over again.

First of all I declaered a global array for my fileservers.

$global:DomainFileservers = @("fs1","fs2",...,"fsX")

The next step was to call the dirquota command for each server at the same time. The first problem i ran into was the parameterlist of fileservers, because a Powershell job executes only commands in a scriptblock. But after a little research i found the solution.
So i defined my scriptblock like this:

	$GetQuotaList = {
		param($server) 
		write-host "Get Quota From $server"
		dirquota Quota List /Remote:$server >> "C:\temp\Quota\data\QuotaFromQuotaList$($server).txt"
	}

As you can see, there is a param function inside the scriptblock that handles my submitted arguments. The final foreach for this example call look like that:

foreach ($server in $global:DomainFileservers){
	Start-Job $GetQuotaList -ArgumentList $server
}

It's important to submit your parameter with the start-job flag "-ArgumentList". So every scriptblock gets it's own server parameter. Now we have to wait until every job is finished. With the command "get-job" you get every started job. The only thing we have to do here is to set a filter for the running processes within a while loop.

While (Get-Job -State "Running") 
{ 
	write-host "." -nonewline
	Start-Sleep 5
}

Powershell loops here over and over again until every job has the state completed, or failed (maybe not a really good idea, but.. :) ). After all jobs are done we remove the complete joblist with the command:

remove-job *

The next step I've done was putting every quotalog into one big file, and split them into 10 equal pieces. After i had 10 quota files with the same size i started 10 powershell jobs which evaluate the data and generated me an output file for our statistic software.

As you can see, jobs are very easy to handle and can speed up your automation process extremely. I decreased the runningtime for quota evaluation process from round about 2 hours down to 25 minutes.

Here is a little statistic insight of my home directory. :)

Quota Statistics

Quota Statistics

22Mai/120

Running OwnCloud 4.0 at your server

Owncloud was released today, so I installed the new version instantly and get some error messages. Here are some of them and how you can fix them.
First of all, my server is hosted by all-inkl.com, and the first thing I had to do is telling the apache, that I want to use php 5.3 instead of php 5.2.

You can change this in your .htaccess by adding the following line:

AddHandler php53-cgi .php

Make sure to edit this file again after setting up the database, becaus it seems to be rewritten by php, after the installation.

Next step was the session problem, because I don't have permissions to write to /tmp/. I changed my session.save_path variable via .htaccess with the following line:

php_value session.save_path "/www/htdocs/your/path/to/a/writeable/folder/outside/of/your/via-web-accessable/directory/"

And last but not least, the file apps/files_odfviewer/appinfo/app.php has an empty space at the end of the file, that interrupts the header information that is send.
All you need to do is opening the file and delete everything after the last ?> command.

Now OwnCloud should run... Hopefully :D