Uncategorized


For what the heck im talking about see Number Forms

Note that most glyphs portray these as 1/2 where the numbers sit to the left and right of the fraction slash.

However some fonts have what are called stacked fractions, nut fractions, or vertical fractions.

Here are some from the Google Fonts library:

I am currently working on a project involving QR codes and a Raspberry Pi.

I have QR codes printed on business card size media. When the card is far enough away for the camera to see the whole code it was out of focus.

Luckily I had some cheap ($1.50) lenses that happen to have a 4.5″ focal length laying around from a previous project.  These worked perfectly for me as the distance from the card to the lens was ~4″. The nice thing about this mod is that it does not require modification of the original raspberry pi camera lens.

Before and After:

testk_nolense

 

These worked perfectly. I am now able to reliably read the QR code using the zbarimg program from the repository.

sudo apt-get install zbar-tools

With this step out of the way I can get back to my project.

I just put up my first alpha version of BasicToGCode.
basictogcode allows scripting of of RS274D g-code directly into EMC2 using BASIC (Beginner’s All-Purpose Symbolic Instruction Code).

It allows you to draw geometric shapes programmatically.

I have been running into a problem when I am moving at really high IPM (inches per minute) using EMC2 Axis.

This image sums up the problem I was having:

Axis EMC2 was rounding my corners. I wanted it to go to that spot and then move on to the next line of G-Code. My friend Paul and I did a little research. He remembered that there was something on the emc2 list about CV problems. Where emc2 would try to keep a constant velocity.

As we researched we found out that emc2 implements “Trajectory Control” using the G61 and G64 commands.

So to solve the “problem” I was having. I told my Gcode file to use G61 Exact Path Mode. It got rid of the rounded corners I did not want.

Tonight I made two really cool things.

First up is the JavaScript G-Code Translate, Scale, Rotate tool.

http://www.unfocusedbrain.com/projects/2009/js-g-code/translate.html

I made this because sometimes I may get G-code from another generator or another person that I want to scale. This utility will scale all coordinates by a given value. X,Y,Z can be scaled independently.

It also can translate coordinates. Say you have a file that is 6″x6″ on the  XY plane starts at 0,0 and ends at 6,6. But you like to have objects centered at 0,0. No problem just paste the g-code tell it you want to translate X by -3 and Y by -3. Now the object will be centered at 0,0.

The second thing I wrote tonight was a Spoil Board Surfacing g-code Generator. I had written this before in php. So tonight I ported it to JavaScript and added input boxes to make generating spoil board code super easy.

http://www.unfocusedbrain.com/projects/2009/js-g-code/surface.html

I have started writing a little collection of functions in JavaScript that will generate g-code for me.

The idea is that I wanted an easy way to script gcode. For example if I want to drill a circle centered at X=0,Y=0,Z=0 and a radius of 1″, I wanted to be able to write drawCircle(x,y,z,radius); instead of the very unwieldy g-code:
(circle x=0 y=0 z=0 radius=1)
G0 X-1.000000 Y0.000000 (rapid to start)
G1 Z0.000000
G17 G2 X-1.000000 Y0.000000 I1.000000 J0.000000 Z0.000000
G0 Z0.500000 (safe z)
(end of circle)

Source code:

http://www.unfocusedbrain.com/projects/2009/js-g-code/jstogcode.html

This version supports: Lines, Boxes, Circles, Arcs, and deep circles.

Using an Atmega8 2x ULN2803’s and a “Magic Screen” device I made a CNC 2 axis machine.

CNC Magic Screen Machine Project Page

A few weeks ago I started this project knowing almost nothing about CNC, steppers, or controlling them w/ a microcontroller. I have learned so much in that short time and have a lot more to learn.

I chose to do a version of etch-cnc because it looked really simple. In that version it was an open-loop controller and just used 2 uln2803‘s to control 2 steppers. These steppers were driven by the parallel port on a pc using Axis in EMC2.

Steppers are super easy to control. The unipolar ones that a friend gave me have 4 coils. You give them voltage on 1 coil and it snaps to that coil. Give power to the next one and it moves clockwise or counterclockwise depending on the order. This is called a stepping sequence. If you know the stepping sequence for a motor, good. If not it is easy to figure it out.

Next is trying to get a computer to talk to a stepper. Since the steppers I was using were rated at 24V and can draw a considerable amount of current, I learned that you need a driver chip to help handle the current. That is where the uln2803 comes in. It has 8 channels of a “darlington array.” Each channel on the chip can handle 500ma. Following the example from etch-cnc I combined 2 channels for each step.

My first experiment was hooking up a ATMega8 and just having it send step pulses. It worked with only a handful lines of code. Now the fun part. Hook it up to a machine running EMC2 software w/ the parallel port driver. It turned out not so fun. Based on what I saw on the etch-cnc page it looked like you could have EMC2 send the step pulses over the port using pins 2-10. That is not how it works.

It works by using the parallel port to send step and direction. Example X axis uses pin 2 to indicate step and pin 3 to indicate direction. So every time the computer wants the stepper to step it puts a short pulse on pin 2 and sets the pin3 high or low depending on the direction it wants it to go. Easy enough to solve. I put the ATMega8 back in the loop. Connected 4 ports to the motor. Connected pin 2 to one of the interrupt pins and pin 3 to one of the portD pins. Then wrote a little ‘C’ code that setup the interrupts and told it that each time a rising edge interrupt happens to read the status of direction and do a step in that direction. The steps are done round-robin style.

Great, now after running the EMC2 config generator I could actually get it to step forward and backward w/ the software. Now I just added the code and wiring to do one more stepper for Y axis.

Then I did a config for a 2 axis machine. Well that didn’t work. Most of the g-code files included as samples expected a 3 axis mill. So I just told it that it was a 3 axis mill. I just ignore the stuff for the 3rd axis.

Now I started Axis (the program that outputs g-code to the parallel port in EMC2) and hit run. When axis starts it loads a little default file of g-code. It did not work as I expected. Then I noticed a comment in that default file that said that that file was not good for milling. So I loaded the spiral sample g-code and hit run. Worked perfectly. Almost.

I had to figure out the lead screw ratios and maximum step rates and such to make what was on the screen come out to the machine. Through a little trial and error I got it pretty close and the settings I used are on the Project Page.

I presented what I had to The Robot Group.

Next I started the cleanup to make the project presentable. I re-did the breadboard onto a soldier type board. I used the “ATMEGA8 Development Kit” by ProtoStack. This is the first time I used a pre-prepared board for an ATMega8 project. This board made it unbelievably simple for me to wire the project up and make it permanent. The board has many features that helped make it go faster. The first of which is that the ATMega8 has some pins scattered around and not in sequence. This board brings them all out away from the chip and puts them in order ie. PC0…PC7 all in one little row.

In the past I had always transferred my projects to perf-board w/ plated holes using bus wire to make all the connections on the back. It is difficult because the ATMega8 needs 2 sets of power to the chip… and for some reason they are reversed on either side of the chip. It is frustrating. But by using the ATMega8 Development kit I didn’t have to worry about any of that. The board has 2 really nice power planes and all the reversing directions have been taken care of for me. A few other features of the board that were helpful to the project were: Large prototyping area. Since I am using 2 unl2803 chips I needed the room. Built in reset button. I have a POST in the software and just hitting a button to run it is nicer than plugging and unplugging. Built in ISP programming header so I can change the chips brain.

Since I wanted to learn about CNC from the is project, part of the equation is Going from idea to output. The whole CAD/CAM thing. For the demo I did at the robot group I wanted to take the group logo and put it on the magic screen. I loaded the logo as a bitmap into Inkscape and traced it by hand keeping in mind that the CNC MSM cannot lift the pen. So I had to trace it in one continuous path. I exported it to dxf using “Better DXF” plugin for inkscape. Then converted the dxf to g-code using “Über DXF2GCODE.”

The last thing I did for the project was take the whole prototype to a friend who is really good at making cases more elegant. He trimmed it down, painted it, and reduced some of the wooden parts to get the final version of the setup.

The CNC Magic Screen Machine Project Page has a video and some shots of the prototype.
Also see more description of the building of the machine.

Thanks again to all the people who helped me w/ this project, Nyssa, Paul, Vern, Bob, and Rick.


To help get wildlife counts we have been using the SkyIPCam500W as a wildlife camera.

Since it is not an outdoor camera we built a weather housing.

Details on the camera:
aicn500w

The neat thing about this camera is that it has a built in web server. It has built in motion detection with triggers. Those triggers can be set to ftp a still to a server whenever its triggered. It also has a built in time trigger. So it is possible to say email or ftp a still every so often.

I wanted the server on my local network to poll the camera once per minute and save a photo for each day. I wrote shell scripts to do that. During my reasearch on the camera I found some special URLs that allow you to interact with the camera.

Some of special urls: (assuming everything is setup as the default)

To get one jpeg image from camera:
lynx -auth=admin:admin -source http://192.168.1.240/cgi/jpg/image.cgi >image.jpg

To save the video stream:
lynx -source -auth=admin:admin http://192.168.1.240/cgi/mjpg/mjpeg.cgi >video.mjpeg

To change the brightness/contrast and osd:

wget –http-user=admin –http-passwd=admin “http://192.168.1.240/admin/camera.cgi?brightness=100&contrast=80&osd_enable=1” -O /dev/null

I just posted the project page for my
Cheap Generic LED Sequencer that I designed for Professor Conrad.

It is based on the ATTiny84 Chip. But I’m sure it would work with the ATTiny44 or ATTiny24.

The neat thing about this one is I have 8 pre-programmed sequences and they are selectable by jumpers or switches.

If you haven’t tried you yet you need to try Google SketchUp. It is a extremely easy to use 3d modeling tool that was recently purchased by Google. There is a free version and a Pro version.

I have only tried the Free version as the $495 pro version is a little too steep for me right now. I was able to sketch out our place in just a few minutes.

I plan on doing a SketchUp version of Rennes Le Chateau. I think to ease into the learning process of the program I will start with a Tour Magdala. Then move on to the chapel then the house.

Next Page »