Posts

Showing posts from 2011

Direct drive extruder

Image
Once I have got my Prusa Mendel 3D printer working, I have started to look around for improvements. The thing I was less happy with was the clunky extruder, made of a geared drive with printed gears. People in the forums mention it has a limited life of maybe one hundred hours before one or more teeth give in.

I thought a direct drive was an obvious choice only if extruder stepper might have enough torque. Then I learned that Orca v0.3 is using a direct drive using a brass insert. I looked for available designs on the Thingiverse for NEMA 17 motors and I have found this one. With some changes I have made it work.

But not before I replaced one StepStick by a Pololu stepper driver on my RAMPS board. The reason is that to achieve the required torque, the motor needs to be driven slightly above the 1A limit of StepSticks. The other required change is to add some cooler to the A4988 chip so it can properly dissipate the additional heat.

I guess 3mm filament is quite more challenging to mak…

Arts exhibit

Image
I've been quite busy lately so I've not been posting news but doing new stuff. A few weeks ago a new exhibit it the City Museum of Valencia by local artist Rubén Tortosa stated and one of the pieces was this one, which I designed and programmed.



It is an interactive installation that grabs the visitor silhouette and then it draws it onto the wall at a random location. Drawing accuracy is not intended (or so I was told by the artist). We went for a very simple design, based on my vertical plotter, and a Kinect device was used to gather the images. You can see below a sample of some the drawings of the very first days of the exhibit.



The exhibit will be open till the end of this year and there is no entrance fee. Together with the installation there is a set of interesting pictures I have nothing to do with.

Update: Wow, we're on the Arduino blog now. Arduino code is quite unremarkable as we use a couple of Pololu motor controllers driving the stepper motors. Processing code

The beauty of OpenSCAD

Image
All the CAD software I have used in the past was based on a GUI. AutoCAD does include a language so you can type commands and create macros too. But the way OpenSCAD is surprising (to me) and very useful: You "program" the objects you want to create. It is all based on a scripting language and the concept of constructive solid geometry. You can define basic shapes, like cylinders, spheres or cubes and then operate them to obtain the design you need.

You can experiment with this technology in Java3D too.

Once you have created your design, you can save the result as a variety of file formats, including STL. STL format is supported by most 3D printing tools, including Reprap project software tools (and Skeinforge). Many of the objects available in Thingiverse.com have been created this way.

Calibrating RepRap Prusa

Image
I thought my troubles were over once I've got all the parts for building my 3D printer, including the replacement for some defective parts.

As usual, I was wrong: Once I have finished building it and tested all the electronics it comes the moment to select a working firmware. There are several choices for RAMPS hardware but I selected Sprinter firmware as it includes acceleration control plus many people use it. But firmware alone is not complete till you've added all the different adjustment parameters so your hardware works together with the firmware the expected way (ie. a 10 mm move in the G-CODE causes a 10 mm move in your printer).

I was excited because once I tested with a thermometer that the hot-end heating and temperature reading was working nicely I thought it will be easy. I used RepSnapper for this basic tests, and next I tried to print a text object. Result was ok, but measurements were still a bit off. But when I attempted the design in the center of this pictu…

Finishing my Reprap Prusa 3D printer

Image
It's been a long wait to finish building my Reprap Prusa Mendel, to source all of the different parts and then to wait for some replacements of defective electronics. The building time has not been very long as I have had long waits in between, but I'd say it can be easily done over a weekend if you have all the parts.

Now I have to configure it and to master into the use of the system. My total cost is near 500€ and I have chosen some hardware to be better than average, so I guess cost can be driven down a couple hundred euros if you really push it to the bare minimums. I do not have yet any printed samples to show you though.

I can mention the companies I bought from that have given me a good service: XYZ printers (hardware), reprap-fab.org (plastic & extruder), RepRapWorld.com (electronics & PLA filament), Zapp Automation Ltd (stepper motors).

One of the things that have worked for me that can allow you to save so cash is to use both, the stepper motors and the belt…

A bit more RSA

I really don't like when I do not understand anyone's code, so it takes me a bit of effort till I do my own homework to create my own version of things I can understand. Being a teacher, I always find troubling not to be able to explain things to my students, so I used some time to create my very own RSA implementation. I've found a very good reference text here.

My perl program takes three parameters data, encryption (or decryption) exponent and module and it returns the encrypted (or decrypted) version. As it uses BigInt library it should be happy dealing with any of your big numbers. You can find a Java implementation in the above mentioned text too.

#!/usr/bin/perl use Math::BigInt; if($#ARGV<2) {print "Usage: exp, module\n"; exit 2;} $a = Math::BigInt->new($ARGV[0]); $b = Math::BigInt->new($ARGV[1]); $c = Math::BigInt->new($ARGV[2]); print "out=".($dec = $a->bmodpow($b,$c))."\n"; Contrary to what may look, bmodpow ha…

Playing with RSA

A recent assignment required me to dust off my knowledge of RSA (public-key encryption algorithm). While it is something I do teach every year, I usually do not have to fiddle with the code. So when I was needing a pair of keys (public+private) for some test I needed to look around for some  key-generation code.

Once I've got my pair of keys I was surprised with this implementation of RSA encryption in perl:
#!/bin/perl -sp0777i However, the fastest way to get you working is using OpenSSL's genrsa command.

Remote Desktop is gone

Image
Last year I bought a small notebook to keep me updated of what was available in Windows 7. Being a small computer, using it for a long session and, in particular the mouse pad, is not very pleasant. So while I am not on the go, I rather would prefer to access this computer remotely to use my desktop's bigger screen and more comfortable mouse.

I was shocked when I learned that Microsoft had "streamlined" some versions of Windows 7 so some features were missing for some of them. I later learned that Windows 7 Home Premium does not include the Remote Desktop server that was common in Windows XP.

I occasionally use remote control tools like TeamViewer with great success (or other variants of VNC) but the main problem is they do not work as smoothly as Remote Desktop Protocol (RDP) nor they allow you to resize the desktop area at log-on time.

One colleague of mine mentioned, while I was complaining about the missing Remote Desktop on my notebook, that there was a hack to get…

Feeling the RepRap itch

Image
Not that the RepRap project is something new, but for a set of reasons I am now getting quite interested on it. Still, since my last post, there is a lot of information to process, but this time I am more willing to use some time reading the forums.
There are also some companies that are selling complete kits of 3D printers inspired by RepRap guts (but that claim no percentage or self-replication feature).
The basic idea is to have an XY-table where a plastic extruder can deposit layer after layer on what becomes the Z-axis. Current versions of the control electronics receive and interpret commands in g-code format from one of several possible control programs (Skeinforge, RepRap, SuperSkein, ReplicatorG, ...).
Now I need to learn a bit about 3D design software, though I have discovered a few interesting programs, like MeshLab, Wings3D or OpenSCAD. The latter being a script-oriented design approach, very interesting and useful.
For the moment I am still considering what printer or kit t…

Your phone is your 3D scanner

Image
Or it can be, with the amazing ProtoFly project. In short it allows you to take a few pictures of an object and using their Windows-only software pictures are uploaded to Autodesk servers and a 3D model of your scene is obtained.
Either small objects, the interior of a room or the outside of a building can be "scanned" just with a cellphone camera. And don't underestimate the power of this technique (photogrammetry). I have been more than impressed with the quality of the output mesh. And given that the service is free of charge I cannot complain about the price :-)
Once you've got the 3D model of your scene the next problem is how can you start editing it and showing it to others. I have found a very nice piece of software called MeshLab that does a great job and it is a multi-platform open-source solution.
But the coolest thing is that there are some cellphone apps that can show a 3D object too. I am still fighting with one of them called "Shader Devel and 3D Vi…

Location recording Big-brother style

Image
A few weeks ago there was a lot of noise on the news about how different providers were handling the location information obtained from smartphone users. I had a look at what was available (user level) on the Android platform. Latitude is a software from Google that allows you several types of location information storage and processing that can be fun, scary or terrifying depending on how you think about it.
Most of the recording is disabled by default (at least this is what we are told) so you do not have to worry. Whether some recording is done on the provider's side or not I do not know. We all know, however, that cellphone carriers do collect location information of all their customer's cellphones.
What Latitude offers you is the possibility of using your smartphone location capabilities (GPS+GSM+wifi based) to provide updates to your Google account so you can: Check your (cellphone) location anytime on Google Maps. Check the location of other users that willingly share it…

So what is this Google+ thing?

Image
I've got an invite from a former student to join Google+ social network. Yes, I'd say it is a social network which, as Buzz was an attempt to mimic Twitter, tries to mimic Facebook (others may use a more agressive term).
I like the idea of having a way to create more categories than just the "friend" relationship of Facebook and the fact that this categories (they call circles) are not closed but you are free to open as many as you want. I like the idea of this circles to be able to intersect. For example you may have a coworker that happens to be a friend too, so you can have her in both circles (work + friends).
Android Google+ application includes a cool feature of automatically uploading pictures taken with your cellphone (and videos). Ok, maybe the latter may deplete your battery quickly, but you have the choice of limiting when uploads may or may not happen.
The number of invites you have initially is not high, but as soon as you start adding people to your cir…

Apple knows how to make friends too.

Image
Sony has presented itself during the last years as a company that has no problem suing their own clients and fans. Several lawsuits against hackers that unlocked previously existing features on some Sony products were dragged to court. I do not think this is a smart move.

Corporations need to understand that customers are a blessing and not a curse. Even if they do not plan on using the product they are buying the way the corporation wants them too. I do not think a company would be offended if I am buying a TV set just to use it as a door step. But even if the are, they can keep that feeling to themselves as they are keeping my money too. Business is more about making money and less about exerting power over your user base.

Apple has been involved in several lawsuits recently to prevent other corporations (i.e: Amazon, Microsoft) to use the term "App Store". It is unclear whether the term is too generic to be protected or not, but it does not look good for Apple at the moment…

Splines for smoothing a shape

Some code for smoothing out a shape, as a curved appearence works better than the shape made of straight lines. 2D splines code was found in processing.org forums. Base points of the shape are marked by red dots. Kinect was used to extract the outlines.


type="application/x-java-applet"
archive="splines.jar"

standby="Loading Processing software..." >













Source code: splines
Built with Processing

Use Processing and Kinect in Ubuntu

I'm working on a project that uses Kinect depth camera to detect a person silhouette as I have mentioned before in this blog.

Part of the development was done using a Mac because I found a library that enabled me to use Kinect directly from Processing (which I've found very convenient for prototyping).

It did not hurt that an OpenCV library for processing was also available.

What was missing was a version of the Kinect's Processing library to be used with GNU/Linux. Fortunately, someone took the time to tweak the Mac version to make it work and to post the process online. It did not work for me exactly as it was but it was close. So just in case you want to experience with it, here are the steps that worked for me:

Get a copy of the library:
git clone git://github.com/shiffman/libfreenect.gitCreate a and move to a build directory inside libfreenect folder
cd libfreenectmkdir buildcd buildcmake ..make sudo make installGo to wrappers/java and edit build.sh file (remove -m…

Fixing a broken compact-flash socket (sort of)

Image
A few days ago an incorrect manipulation of the compact flash memory broke my Canon reflex camera memory socket. It was a very bad moment as I was not able to use it in my recent trip to China.

Though I was able to get some thin tweezers I was only capable of breaking the bent pin. So my camera was useless now.

Once back home, I've tried a simple solution that worked nicely, so nicely I want to share it with you: I just took a strand of copper from an electric wire and I stuffed it in to the hole of the compact flash memory that corresponded to the broken pin. It created kind of a small copper wire brush that makes contact with the broken pin once the memory is inserted. It is a cheap solution to the problem that I've found surprisingly good.

If you have several broken pins you may try this, but I am not so confident you'll get a decent contact for all of them at the same time.

Wireless missunderstandings

Though we bring an iPad to China, we ended up not buying a SIM card for it as we were told we could borrow one. But then the card we borrow was to be returned and we could not cut it down to fit into the iPad. My new Samsung Galaxy S could not accept the card as it was SIM-locked so we ended up using the SIM on our Nokia E71. Thus, iPad could use the GPRS access of the phone thanks to JoikuSpot software.

Unfortunately, the access JoikuSpot provides does not seem to work for the Galaxy S.

Another problem I faced was that the few wireless networks I can access are protected by a captive portal that, once a valid username and password is provided allow clients to access the Internet. My Eye-Fi Geo SD card performs the geo-location for my pictures but only if pictures are downloaded wirelessly to the computer. But Eye-Fi firmware did not support captive portal authentication so I could not use these wireless networks.

Unfortunaltey the Eye-Fi card cannot work with JoikuSpot either. A potent…

The other Great Wall

Image
Being in China for a few days is an eye-opening experience: both the future and the past are mixed together here in a curious combination. There are many good things beyond the food: A taxi driver may return your missing phone and the waiter will patiently wait for you to order. Other things are not so nice: don't expect queues to be respected nor all cars to stop at pedestrian crossings, even if there is a red light.
Internet experience is also special: Many sites just don't work. Others work like if something was wrong under the hood and finally, the rest work like in the rest of the world. It is not a problem of network speed (though some links could use some extra speed) but of the control the government imposes upon what can or cannot be browsed by citizens and visitors of China.
For some visitors like me, showing some pictures on Facebook for family and friends is a common activity when we are abroad. Not being able to even open Facebook or to make a blog entry (like thi…

Chinese language

Image
I am honored to have been invited by Beijing Institute of Technology and I am visiting Beijing in a few weeks and I have no previous knowledge of Chinese language.
Human languages, as many computer languages, are based on the use of an alphabet. But what if, like APL, you are not familiar with that alphabet? That would be the case should I try to learn Persian or Urdu languages.
However, Chinese language does not use an alphabet to build words with its symbols, but each word is represented by a logogram (ideographic or a pictogram or a composition of both). Learning a different alphabet has to be difficult, but learning a language based on ideograms looks a huge endeavor to me.
Of course I'm not claiming "I am learning (mandarin) Chinese", but I'm just looking at some of the basic ideas behind the structure of the language and I get the impression the task is not something easy to achieve for the written language. The spoken word is also challenging, but with the hel…

Galaxy S: a few months later

Image
A few months of use have given me some perspective on Samsung's Galaxy S. What I have liked is how easy it was to get Gmail working and configuration of services in general. But several things have been confusing and not so nice: for example the use of calendars or the contact lists. It seems you can maintain several calendars and there are different places where you can store your contact list.
The initial contact list synchronization was not easy as Galaxy S won't work with Apple's iSync. I used SyncMate application but I did not like either. But I can recommend Dropbox as it is a great tool not only to get content onto your smartphone but also to upload pictures from it.
While a do like Android, the system has a lot of room for improvement, the worst thing is the variability on the response time. Sometimes the system is just not interested on what you do. You may get a call you cannot answer for a few seconds because the system is busy doing something else. I do not like …

The rise of plug computers?

Image
A while ago I invited an old classmate over to give a talk on campus. He is working on a new project called Amahi. It is a Linux-based server software. But instead of aiming at the regular PC --maybe the old computer you might have at home-- they are focussing a relatively new breed of computer that some have called "plug computer". But ... what is a plug computer? They are small low-power headless computers that are built inside a power supply. Usual connections are USB ports (to enable external storage or other peripherals) and Ethernet network. These computers do not have a hard-disk drive but a small flash-based storage on board.
What these plug-in computers really shine for is as home servers. They need a really small amount of power, usually less than 10 watts, so keeping them on 24/7 is not going to have an impact on your utilities bill. The compact size and silent operation open up many interesting applications (ie. media server, download server, personal website serv…

Annoying Java behavior

Image
A recent class exercise required students to create a program that handle a list of scheduled events. While I was not suggesting a specific approach, I used java.util.Date for handling the time.
Events happening in the future can be scheduled by adding a certain value to the current time. System.getCurrentMilis() gives you the value of milliseconds since January 1, 1970 00:00:00 GMT.
When creating a new Date object, the default value is the current time, but any number of milliseconds could be used to create any time into the past or the future. I was using this approach for scheduling future events. Later, I was checking, every second, if any of the future events on my list was already due. Unfortunately, I was using .equals() function for that but only a few times worked as expected.
The problem was that .equals() function works on a millisecond time base. If the two values compared are not exactly the same number of milliseconds since January 1, 1970 00:00:00 GMT then the answer will …

It is the Android year!

Image
Well, I might be wrong but apparently Android shipments just overtook Symbian platform during the year 2010. I have been using for quite a while a Nokia E71, which I can wholehearted recommend, but I was told by my carrier that it was time for a change.

Of course the question to iphone or not to iphone was raised. Owning five different Apple computers over the years plus an iPad seemed to make me the obvious iPhone customer. Did I tell you we have our own share of ipods, including a couple of iPod touch? However, after buying our iPad it became clear that the way Apple wants customers to behave and use their expensive devices was not very customer friendly. I really hate to have to use iTunes to just add a file to my iPad (thanks Dropbox to make my life a bit easier here). And I find despicable that once I have sync my iPad to a music library I have to lose everything if I ever dare to try to sync with another of my computers at home. I am sure that Apple can make a long case about how…

Roomba: It does the work!

Image
This year we've got for Christmas our very first home robot. I was a bit reluctant to buy an expensive item just to figure out later it might work elsewhere but not at our home. This has not been the case. Since day one, our Roomba performed nicely and the only trouble we've got is that it does not like our low-profile doorstoppers.

We've made the comparison between them amount of dirt picked up by us and the one we remove from Roomba. I've to say the robot wins in the "who picked more dirt" game. The only extra work we're doing in preparation for Roomba to clean a room is to remove as many objects as possible that might interfere (i.e. chairs, trash bins, etc). I'd say it's been money well spent (as far as the robot keeps the performance level for a couple of years).

What is a plus is that the robot may return to the charge station by itself (sometimes) when battery needs to be recharged. I'd day this is not a feature to trust on, as I'm …

Geo-tagging with Canon Powershot S95

Image
No, geo-tagging is not a built-in feature on Canon Powershot S95. However, there is an interesting technology for doing that with your favourite camera. I was introduced to that three years ago by googler Mano Marks (of AppEngine fame) but I was not too impressed at the time (as I was not sure how to store that info). However, once I started using iPhoto I saw that application was aware of geo-location information and therefore it could be useful to have it in my pictures. This Christmas I've got a 2GB Geo Eye-Fi SD card as a present. I'm happy to report that it works nicely with my Powershot S95, where each image is shown as uploaded or not uploaded by means of an icon (Eye-Fi cards can wirelessly upload your pictures using wifi networks).
Uploaded images contain geo-location information, so when you import them into iPhoto they will include location information on where each picture was taken. This cards use the same Skyhook database used by other devices to pinpoint locatio…

Silhouette extraction algorithm

As shown in the video above I have been working on an algorithm to extract a person's silhouette for an arts installation I am working on. The main idea is to use the depth map provided by Microsoft's Kinect so only a small range of distances are used to identify the person standing on a certain spot marked on the floor. By discarding those pixels that are too far away and those too close what is left is the person or other obstacles placed a that desired distance from the camera.
It is a bit tricky to make depth and RGB cameras to match exactly the same image (as they are located a few inches apart) so video shows some discrepancy between the dancing user and the drawn contour line.
Code was written in Processing using Daniel Shiffman's kinect library for Macs, OpenCV library and MovieMaker library to create an output video file of the action. In the mean time I was developing this, Daniel updated his library and some changes were needed. Unfortunately, OpenCV for Process…