Pages

Tampilkan postingan dengan label bot. Tampilkan semua postingan
Tampilkan postingan dengan label bot. Tampilkan semua postingan

Selasa, 07 Juni 2016

Photography My new macro bot

I built a thing today.

It moves stuff in small increments using a small electric motor, in response to a users input.

I guess that means Ive built my first robot.

Actually, probably my second.

Anyway...

My device looks like this










It also looks like this.

The bit with the "1" next to it is my previously built power supply that delivers 5 volts to my project.

The bit with a "2" next to it is the previously made PICAXE Proto Board that connects some input/output pins to my breadboard.

The "3" is the transistor bit, that powers the motor when the chip sends a signal to do so.

And the "4" isnt really visible. If you could see the "4", it would be next to the the switch that the user presses to make the subject move a tiny bit.

The point of this exercise is to attempt to make a device that carries an empty box of mints along a steady track, to carry a subject to different focal distances, in order to make a series of photos to create a focus stack, and thus create an image with a greater depth of field than might otherwise be achieved.

This absurdly simple solution, represents my first successful attempt at creating an electronic something without external help from someone, somewhere on the planet.

All the software does is wait for someone to press the button, then move the subject a tiny bit closer to the camera. This changes which bit of the subject is in focus, and enables the user to take a "stack" of pics, each one having a different plane in sharp focus. The user can then knit them all together using some free software, creating a photo with an otherwise impossible depth of depth of field.

The 11 lines of code that makes it work look like this (the very small amount of black text is the actual software, the green text is just my description of it)

--------------------------------------------------


; Macro Mover ver 2013 06 10 0200
        ;moves a small platform holding a photographic macro subject a tiny amount closer to the camera                    each time a button is pressed, helping to create a "focus stack"
;120thingsIn20Years.blogspot.com
;no rights reserved
;use at your own risk

;For picaxe 08M2

#No_Data saves a few seconds when uploading the code to the chip, because it doesnt have to check for data

main: begin the main program loop

if pinC.1 = 1 then gosub Move    if someone is pressing the button, jump to the bit of code called "Move"

goto main if it gets this far, go back to the start and check for a button press again

Move: the bit of code that moves the platform with the subject on it

do until pinc.1 = 0 :loop hang here until the button is released

high 2 turn on the motorconnected to pin 2
pause 2 wait for 2 milliseconds
low 2 turn off the motor connected to pin 2
pause 100 pause for 100 milliseconds

      return go back to the gosub that called the "Move" code

-------------------------------------------------


I started with an old CD ROM drive that I ripped all the interesting bits out of.

I think this is the original motor because it fits perfectly. This is the motor that made the laser head move from the centre to the rim. Now its the motor that moves the photographic subject towards the lens, changing which bit is in focus.

The blu-tac is there as a weight to keep the linear cog in contact with the gear that the motor connects to.





So the motor makes the black bit move from this extreme...

(see the black bit)










to this extreme, but in tiny increments each time the button is pressed.

Each button press causes a a quarter of a millimetre migration.

.25 mm = 0.0098 inches

A tiny amount each button press.

The camera sits on the large grey platform to the right.


The software controls how much the motor moves at any given moment. This way we control how much we increment the slice of our subject that is in crisp focus.

The camera is securely set in place because there is a tight fit due to my bending some tags in order to hug the camera. There is also two lumps of blu-tac securing the camera to the base.

This arrangement feels totally secure, and I havent had any problems with the camera moving.







Last, but far from least, I added a subject platform  and a light source. The subject sits on a platform made form an empty tic-tac (small mint confectionery) box,

The light source is the thing on three zebra legs.

Its best to move the light source with the subject as it moves toward, or away from the camera, to avoid photos with different exposures, so a light that moves with the subject is best.




Once you have a "stack" of photos with different bits in focus, you can knit them all together with a program like "MacroFusion" (free, open source program I run on my linux computer)

To use this Macro-bot device, you press down once or more times, on a button to move the subject a tiny bit closer to the camera. After each button press (or two or three) you take a photo. Each time you press the button, the subject moves a fraction of a millimetre. I found pressing the button once was suitable for macro shots where the lens was at full zoom, and pressing three times when the lens was at minimum zoom.

Some experimentation is required, but as soon as I made this, I immediately solved all the problems I was having with poor alignment of my photos in a focus stack.

Successful results to follow...




120 Things in 20 years - Sometimes, all you have to do to make a robot, is to replace all the bits from the robot you salvaged last week.






Read More..

Selasa, 03 Mei 2016

death metal rooster and dirty yuckface


FIRST...death metal rooster. Its incredible so I advise all to watch.


Found that by accident.
So now...what about the grossness?

Well I had a bath net sponge (often called a loofah but I ensure you....it was like the one in the picture and NOT a loofah which is a plant used in the same way) and I left it out to dry. I just did laundry so I wasnt about to just wash it alone.

It went missing.

For a few months in fact. Well today I found it in my grandmas shower which means my sister stole it. -_-

Jokes on you sis

That bath net was used on Adams sweaty ass after not showering for a while. Yup thats right. It was a dirty net used on my dirty boyfriend. I set it by my stuff in hopes common sense would kick in and say "hey thats hers" but I guess it doesnt work that way when youre a compulsive idiot liar like her.

On top of that, I had my favorite pair of jeans go missing. Again, joke is on her. They were clean but I found out the thing I had them on was growing stuff. Then my rats played in them and pooped and peed all over them. Seeing as she usually stops by before going to work, this means she had to have carried it out with her. If she stole it on her way "home" then she slept with her dirty arm and side (seeing as she takes showers before work.) It made me WTF but I hope she liked the smell of mildew and rat excrements.

=]
Read More..

Minggu, 03 April 2016

Welcome To Humboldt Laser Harp In Detail

[Tonights post is by Ed Smith, participant in the Humboldt Microcontrollers Group.]

In this post well go through the Humboldt Makers Groups Humboldt Laser Harp (HLH) in rather more detail than we have previously.

If youre not familiar with the concept of a laser harp YouTube has plenty of videos of different styles, or of course you can keep reading and get familiar that way. This is our harp:


We opted for a closed-frame harp rather than an open frame, as the closed frame struck us as an easier proposition. It also gives us control over the laser path, rather than letting it head off into the ether. Important for harps that will be played outdoors (as ours is) or near airports / airplane flight paths.

For lasers we opted for super cheap laser pointers from the local dollar store; at a buck per laser this beat mainstream suppliers prices by a huge margin.
Mounting the whole laser would be difficult, and those batteries dont last very long, so Nick ripped them open and hacked away most of the PCB, leaving us with a much more manageable package.
Those of you familiar with LEDs / laser diodes and button cell batteries may be able to guess what happened next.
We read the battery spec, 1.5v each, and fed the lasers ~4.5v. What we failed to consider was the internal resistance and resulting voltage drop of the button cell batteries.

The lasers looked amazing, for about half an hour.
Then they started to burn out. Oops.

After replacing the dead and dying lasers Nick did more testing and we eventually solved this by running the lasers on 3.3 volts, which seems to work well. Unfortunately more lasers were damaged during testing and we ran out of time to replace them, resulting in a few "strings" that didnt work well in direct sunlight. Oh well.
We are debating different methods of laser amperage control for future harp designs.
To hold the Lasers Nick designed and 3D printed some lovely adjustable mounts for them.

The corks hold the top end of a spring, which pushes the mounts against their legs (screws) and against the harp frame. By turning the screws the aim of the laser is easily adjustable. I failed to take a picture of a mount up close, but you can see the general idea.

On the bottom side each laser hits a light sensitive resistor (LDR) light sensor, each sensor has a 3D printed holder and light guide tube.

The black heatshrink around the tube helps block out ambient light and results in a stronger signal from the laser. This turned out to be crucial when operating the harp in daylight outdoors.

To convince the harp to stand upright we turned to Gordon, who hit the scrap yard and attacked what he found with his MIG welder. The result was a very stable base that complimented Nicks choice of an industrial theme wonderfully.
The rear screen is held in place by a pair of wing nuts, allowing us easy access to the center area. This center area will eventually hold the electronics package as well as some light effects.

The combination of mild steel base and aluminum body gives the harp a very low center of gravity and makes it quite stable. I was very happy about this when sitting behind it at the recent maker fair, as the road had a fair crown to it and we had the harp on a card cable. If it was inclined to tip it would have been a very nervous time for me!

To finish off the hardware side of the harp, heres a view from the rear.

I was in charge of the electronics package for the harp, I used a Texas Instruments Stellaris Launchpad microcontroller board for the brains. The primary reason I chose that board is that it has 12 analog inputs, making the job of reading 12 LDRs much easier. This project could be done with a microcontroller with fewer analog inputs, but you would need to use an external ADC or some comparators to turn the analog voltage from the LDRs into a digital signal.
To the right you can see the finished, prototype, electronics package. I used some perfboard to make a BoosterPack (what TI calls expansion boards, Arduino calls them Shields) for the LaunchPad. This simplified my design somewhat and made it easy to swap a new MCU into place if I accidentally blew this one up. Thankfully I didnt, but it was nice to have the option anyway.

Most of the board consists of 12 copies of a very simple circuit. The 15 pin connector has one pin for positive voltage to the lasers, one ground pin, one "feature / effects" pin that is not currently in use, and then 12 pins that go to the LDRs. The circuit on the perfboard has a variable resistor that feeds voltage to the LDR pins, and a second wire that goes to the analog inputs.


Having a variable resistor doing the high side of the voltage divider means that we can adjust the sensitivity of the sensors to match the strength (and aim) of the lasers. This is important when some lasers are new and happy and some are half dead! Also included in that circuit is a 0.1µF capacitor to help prevent EMI issues. Whether this is actually needed or not is unknown, but the result worked well so Im leaving them in place.

The other two circuits on the perfboard connect the MIDI output port to the microcontrollers second TTL Serial channel, and connect the +3.3V pin to the lasers via a MOSFET. This gives the microcontroller control over the lasers, a useful feature for automatic calibration.

Lastly, the code. I wrote the firmware for the laser harp in the Energia IDE. Energia is a fork of the Arduino IDE that is aimed at the TI Launchpad series of microcontrollers. Most simple programs can be copied straight across from Arduino to Energia and back, though you do need to change the pin definitions. Energia also has ports of many Arduino libraries, making things even simpler.
Im going to describe the code and then post a link to it on GitHub rather than inserting it in this post.

The code is aimed at being easily adjustable for different numbers of "strings". Its main loop checks the status of one string, if the string status has changed it finds an open MIDI port and sends the Note On or Note Off message to the external MIDI synthesizer. If it has not changed, it does nothing. After that it increments the string counter and goes through the loop again, check the next strings status.

This loop takes between 67 and 1050 microseconds, or 0.067 - 1.05 milliseconds if you prefer. Not very long. The variation in time largely comes from whether it needs to send MIDI messages or not. The code is set to send the entire message before it goes through the next loop, to prevent against buffer overflow. This probably isnt necessary, but I didnt want it crashing in its first public outing!

The Launchpad has two pushbuttons on it. One of them activates a now partially defunct programming mode that allows you to set the MIDI Velocity variable (how hard the "string" is plucked) and the threshold for the analog inputs that defines what is a HIGH and what is a LOW signal from the LDRs. The MIDI Velocity is still in place; the global threshold has been removed in favor of each "string" having its own threshold.

The second button is used to set those thresholds. It first turns off all the lasers and reads the analog voltage from each LDR, then turns all the lasers on and reads the LDR voltages again. The threshold for each string is set to the mid point between the two readings.

This change to the code fixed the majority of the issues we had on the Humboldt Laser Harps first outing.

The trimmer resistors still need to be adjusted to give a good voltage range, but once they are adjusted to match the laser you dont have to do it again. Previously, every time the ambient light conditions changed, you had to redo all 12 trimmers, which took long enough that the ambient light conditions had typically changed again by the time I had finished.

You can find the code here: GitHub Code Link.

As we upgrade the Humboldt Laser Harp well make new posts about it here on the blog.

--Ed Smith

**********
Read More..