Arduino programming: Advanced Servos

For a while now I wanted to share what I learned in programming Arduino and AVR micro-controllers in general.  Most of the topics I want to discuss are above basics.  There are already plenty of basic tutorials online, so no need to reinvent bicycle.

However don’t be discouraged by “advanced” title. I will attempt to explain it in terms even a very beginner programmer can understand.

Let’s start with servos. I only started to play with servos about a month ago, and found how fun controlling them can be. But also challenging.

I won’t go into details about servo types, specs, uses, etc. but I do want to mention a few things about ways to control them.

There are essentially 3 ways to have full control of a servo.

You can do it directly with Arduino or similar AVR microprocessor using PWM pins or a Servo library that allows you to use even non-PWM pins.
An external PWM expansion board like Adafruit’s 16 channel servo controller
A dedicated “smart” 32 channel servo controller board (i.e. RTRobot)

In this topic I will talk about first option, however let me talk just a little bit about options 2 and 3.

An external PWM controller is just an extension of Arduino’s own PWM ports.  These are usually controlled via I2C bus and can be chained together to control a huge number of servos.  These are great but a little more difficult to control and will rely on your micro-controller’s CPU.

A dedicated servo controller board usually have it’s own microprocessor (ARM), in many cases more powerful than Arduino.  These are fantastic boards, that can store servo movement macros that can be initiated by Arduino serial commands. If you are building a robot like hexapod, you can pretty much program movement sequences into controller’s memory and offload your Arduino to do other tasks.  Some even come with PS2 wireless controller capabilities!

But if you only have a handful of servos to control, doing it directly from AVR is probably the best choice.

[…]

December 19th, 2016|How To, Programming Tutorials, tips|0 Comments

Extending probe for digal temperature gauge

I love these visual LCD temperature gauges. They have this nice LCD screen, can be switched between Celsius and Fahrenheit and most importantly have long waterproof temperature probe.  And cost just under $5 shipped from China on eBay.

[…]

February 13th, 2016|How To, Laser machine|0 Comments

How To: Upgrade 50W Chinese laser cutter to 60W

It’s been almost a month since i upgraded my SH-G350 laser cutter to 60Watts of cutting power.  Here’s at last a comprehensive How To guide for all you DIYers out there.

[…]

January 13th, 2016|diy, How To, Laser machine|1 Comment

How to add ammeter to 50W Chinese laser cutter from eBay

Ammeter add-on was on my to do list for a long time. It’s important to know what current is flowing thru your CO2 tube so you don’t shorten it’s life. Ammeter measures current and in case of this SH-G350 machine you’ll want ammeter rated in the 0-30 or 0-50mA range because most CO2 laser tubes run under currents under 25mA.

[…]

November 20th, 2015|diy, How To, Laser machine|12 Comments

DIY Lighted Marquee Sign for Halloween

For this year I decided to do a Circus themed Halloween party.  One of the major props for the part was supposed to be a large lighted “Circus” marquee sign (also called dimensional lettering).

There are more than few tutorials on how to make such sign, most of them involve using some kind of thin sheet […]

November 5th, 2015|diy, How To, Laser machine|Comments Off on DIY Lighted Marquee Sign for Halloween

How to add beam combiner to SH-G350 laser cutter

CO2 Laser cutters are insanely cool, but there’s one problem. We cannot see infrared beam, so it’s always a guesswork where laser is actually will hit the work piece. Many laser cutters including SH-G350 come with a red laser pointer attached near head cone, but they are far from accurate.  One that came with my machine annoyed me to the point that I disconnected it completely. It never points to where laser is cutting (mine was about an inch off to the side) and it can only be adjusted up or down. Spot gets larger or smaller depending on where your z-table is located. And to make things worse,there was something wrong with mine as it kept on overheating and fading.

So what is beam combiner and why would you want one?

As you can see from the illustration beam combiner is a special lens that only let’s certain wavelengths thru, and reflects all others. In our case Infrared laser beam passes thru it, while visible red laser reflects. By adjusting angle of the lens you can get both beams to travel same path.  You can actually see where IR laser beam is going and where it will end up on the table!

No more guessing, where you cut will be. As added bonus this makes it insanely easy to align mirrors. You don’t have to burn pieces of paper anymore! But wait, there’s more 🙂 ZnSe lens will also focus red laser beam, so you can even see if focal distance to the object is ideal!

[…]

July 10th, 2015|3D Printing, diy, How To, Laser machine|0 Comments

Bricked SMD ATMega328 resurrection tutorial

brick
verb

cause (a smartphone or other electronic device) to become completely unable to function, typically on a permanent basis.
“installing an unofficial OS voids the warranty and may brick the phone”

Lately I’ve been working on a custom “arduino clone” board that uses SMD version of ATMega328p microprocessor.  This is what it looks like, magnified.

 

[…]

June 30th, 2015|diy, How To|0 Comments

Laser engraving slate

I got my laser machine primary for cutting, but lately I’ve been getting hooked on engraving as well. Mostly I’m fascinated by engraving on stone, such as slate. I see a lot of people making fun things like drink coasters and cheese cutting boards.

It wasn’t easy obtaining slate stone here in US. Online it’s very […]

June 3rd, 2015|How To, Laser machine|1 Comment

Laser mirror alignment jig V2

Recently I created a 3D printed “target” holder to help with 2nd laser mirror alignment.  This is a much improved “jig”, that now allows to align both mirrors.

[…]

April 29th, 2015|diy, How To, Laser machine|1 Comment

DIY Pin table Update

Some time ago I wrote about Pin table (a.k.a. vector table) I made for my laser cutter.   It kind of worked, but I had issue with rivets moving slightly. This caused some issues when cutting/engraving at high speed, as whole work-piece shook.  I also wanted to have more pins to hold smaller parts form […]

April 8th, 2015|diy, How To, Laser machine|1 Comment