Intro: Laser Painting
Imagine being able to paint anywhere and on any surface, no matter how big the canvas is or how far it seems to be! This robotic controlled laser lets turn any landscapes into canvas.
Please be responsible while using lasers, never point them at people or animals. Also be aware that people can react in many different and extreme ways to the presence of lasers around them. Do not point at flying things either.
This Instructable goes over a couple different programs, tools and hardware so I'll try to keep it readable and informative at the same time.
Step 1: Early Progress
The idea is simple, as they usually are (at least in the beginning).
Being fascinated by light painting, I decided to venture using the tools I have today at my disposal. The idea was to be able to take any image and then draw a simplified version of it on a wall. Processing would do all the analysis and then spit out angles for the Arduino to command the servos.
There have been a couple of iterations along the way. For the first one I was trying to record a Scarlet Hawk, my University's (Illinois Institute of Technology) mascot.
Doing some research I found Diana Lange's "Image based one line drawing" which take a drawing and outputs a single path to render such image. By now my code looks very different but similarities and probably not coincidence.
Step 2: 2nd Round!
After tuning the code and changing to a more powerful laser I decided to give it another try. Turn the lights off and the let the camera role.
As you can see there was significant progress. The main problem however is the lack of resolution one can get using stander servos with the arduino servo.h. Another problem I was encountering was the the fact that the entire setup was pretty slow and if I tried to go faster the servos would go crazy...
Step 3: R3. Gears
In the hopes of getting better resolution I designed a set of gears to reduce the amount of motion the laser would experience, meaning that I could send larger angles to the servo for the same net movement.
This worked pretty well, specially in the increase of resolution, the curves didn't look like stairways any more. I still had the problem of the servos going crazy once in a while if I tried to push coordinates too fast. Which made the entire process way to slow and not very reliable.
Step 4: 01 Mechatronics- Super Modified Servo
And then I found these guys... Talking to Paolo Salvagione (Incredibly amazing person) he told me about these servo controllers he had found... Prepared to be amazed just as I was back then:
The modified controllers, or SUPER modified controllers I should say, fit inside most stander servos, they replace the board and the potentiometer, in exchange they offer:
- Includes 15bit absolute position encoder
- Profiled movements (control acceleration and velocity through movement)
- Control loop running at 9,765 KHz !
- Multiple bus interfaces including RS-485, multi-node uart, I2C! Up to 128 nodes on a single bus !
- 5 to 24V, 5Amps continuous
- Multiple software interfaces: Stand alone application, MatLab dll, Arduino library and more
Need to say more?
Here is also a video on how to make the modification:
Step 5: Connecting Multiple Servos Using I2C to an Arduino
The I2C protocol is awesome in many ways, like the way that you could connect connect more than 100 devices to the same 2 Arduino Pins and control them all independently and simultaneously. These devices could be sensors, motors (in this case), even other arduinos. This however doesn't come with its difficulties. Since all devices are being controlled by the same pins there needs to be a way to address them. By default the SMS controllers come with the address no.4. This becomes a problem when trying to control more than one since they will interfere with each other.
Changing the address of the servo:
To change the address of the servo you will need some extra hardware. The RS-485 to USB will allow the controller to connect to your computer. You will also need to download the 01 Supermodified Commander. This will allow you to connect to the servo controller, test it and modify it. Make sure to follow the guide (attached). The guys at 01 Mechatronics have made an excellent job at documenting this process and the guide is easy to follow.
After seeing the controller select function No23 at the right side of the software SET NODE ID. You will be prompted to select another node id (motor id) for your SMS controller.
Step 6: Eye + Memory Vs Camera + Computer
Lets be honest, looking at a little green dot move on a wall is not very exciting, unless we are able to see the past in the present. This is a concept that I find particularly interesting, we can be presented with information and instances after we can no longer recall it. It would be extraordinary for a person to be able to tell what the laser is drawing just by seeing it move.
The traditional method to see the result of light painting is by taking a long exposure photo. This however is not a fast since you have to wait for the painting to finish in order see the results. This is also a very static process, the result is a single image when the process was full of fluid movement. Finally this method only works in great darkness, which makes the entire process very limiting.
After a day of thinking on ways to solve this I started developing a tool to record a video and then convert it into a long exposure video (video attached).
I won't go too much into details here but Isadora is an amazing piece of software that will allow you to process video live, you can add effects and do so much that I don't know yet. It is node based which makes it easy to play with and immediately see what works. Check it out! I can't wait to use Isadora on many of my future projects.
In this case I am using it to track the color of the laser instead of the light, which means that it doesn't have to be dark for the "long exposure" to work!
Step 7: Painting Time!
This project is not over but the tools are now ready!