Tag Archives: Arduino

Stepper Testing with Arduino

The photo-interrupter on the winding jig gave up the ghost, and nobody has it in stock locally. So i’m dead in the water without any positioning.

An alternative to external sensing with the photo-interrupter was to use a stepper motor instead, and I had picked one up several weeks ago. Now is as good a time as any to see if it’d work.

The part number printed on the stepper is 17PS-C054-01. The label said it was bipolar, 4 wire, 12v, 30Ω per winding and had a 1.8° step, and after a little bit of multimeter work, these are the wire pairs for the windings. Yellow/white, and Red/Blue.

Some more web searching indicated that stepping the motor would involve putting current in the following wire pairs in sequence:

(plus / minus)
Yellow / White
Red / Blue
White / Yellow
Blue / Red

On my Guangzhou University (all-in-one) Arduino board, that meant driving the enable pins high permanently (E1 = 5 and E2 = 6), and using the stepper libraries in 2 wire mode (M1 = 4, M2 = 7).

Wire connections shown

While the stepper library out of the box worked OK, Mike McCauley’s AccelStepper library comes with acceleration and deceleration, and seems also to run real time.

Only thing is, it doesn’t seem to have a setting to tell it how many steps the stepper is (1.8° x 200 steps = 1 full turn). It seems to think 50 steps is a full turn.

Weird. Back to tinkering…

Update: 17 Dec 2010

I’ve finally found the time to do MORE tinkering… the coupler originally connecting the motor to the drive gear had to be drilled out from 3 to 5mm to accommodate the stepper’s shaft. Connected it up tonight.

Holy cow, the noise was unbelievable. It ground and rattled and vibrated. Stepper idea scrapped. Back to work on replacing the photo-interrupter…

Arduino Watch Winder – Updates

We’re almost there! This is what’s on my desk / worktop / pigsty now.

We are almost there

Some pictures of the acrylic parts and hardware…

A few (software) features

Tourbillon mode. No I don’t own one…. The gears have a ratio of 1:6, so the motor has to turn 6 times before the watches turn once. A cool idea was to have the watches come to a stop at different positions. 1:6 ratio meant I can stop them at 2, 4, 6, 8, 10 and 12 o’clock positions.

A photo-interrupter counts motor revolutions.

Cumulative counting. Every 1 1/6 programmed turns of the watch means 7 actual turns, and these are counted towards the TPD set in.

Dynamically self-balancing. At the top of each hour, the program would calculate how many turns it has to perform based on the cumulative turns, the set TPD, and the number of hours left in that 24 hour period.

Bidirectional. Pretty standard feature.

Now to clean up the wiring and get an enclosure!

Watch Winder Experiment with Arduino

Owning more than one automatic watch can be a hassle. I call it the “jealous girlfriend” effect. You neglect her for more than a day or so, and she stops giving you the time of day.

Having read over the years about the interesting stuff people have done with the open-source Arduino platform, I decided to try my hand at it. I have a little electronic and programming experience but absolutely zero mechanical and product design skills. This explains the finished prototype!

The original intention was to buy a Duemilanove (I cannot pronounce this) and build from there. I needed some kind of motor shield, and was discovering H-bridges. I contacted Mr Wong of Robot R Us, and asked him a few questions. He was kind enough to sit me down and we chatted for about an hour. He recommended an Arduino board designed and manufactured by a professor in Guangzhou University. It came with PWM pins ready to accept servos, it would also control 2 motors out of the box. The only snag is – the manual is in Chinese. And I can’t read that!

I took the leap and picked it up anyway. Mr Wong provided plenty of email support.

As you can tell, it isn’t very well made. Some of the header pins are not aligned properly, but at least the board is silkscreened.

I plugged in a little servo assembly and with the sample code from the Arduino website, it worked right away. You’ll notice also that since this is a small servo, I did not need to give it additional power.

To turn some watches, you’ll need a motor. Preferably a slow torquey one. The one I picked up was rated for 3rpm @ 6Vdc. It ran at 6rpm. Put it into a peforated aluminum frame (hotglued together), put a gear on it with some tape (so i could count RPM), plugged it into the board and voila, that worked too.

I could control speed (with PWM – although later I would realise that torque would also be sacrificed at anything but top speed) and direction. Woot!

The next issue was how the watches would attach to the shaft of the motor…. I used the set screw clamp from a plastic hobby gear attached to a coaxial T-joint, attached to the screw thread of a vitamin bottle. To hold the watches, the cap of these vitamin bottles were attached to some plumbing fittings. The plumbing fittings had some dashboard anti slip mats attached and there you go. Yeap. Confusing. Pictures.

Stripping a plastic gear set screw clamp

Cutting up the vitamin bottles

Assembling the Tee

When I used the word “attached”, I meant with hot glue. Then things started falling apart. I re-did most of it with clear epoxy and did some reinforcement work with more perforated metal…. and here it is…

The first working prototype.

The Tag Heuer Chronometer requires 650TPD (turns per day) in any direction, the Praesto Fliegeruhr uses a Miyota 8245 movement and needs 650-900 TPD in CCW direction.

The code I wrote originally ran for 30 seconds counter clockwise, stops for 45 secs, runs another 30 seconds clockwise, stops for 45 seconds, repeats. This works out to 144 revolutions per hour, and waaayyyy to many TPD. I only run it when i’m at home, and manually turn it on.

After a couple of days of this (one watch stopped because I came home late from work one day), I amended it to run all the time (10 secs in one direction, pause for 2 minutes, 10 seconds in the other direction, pause, repeat. That’s 665 TPD.)

I read also that Arduino’s delay command would cause it not to accept any other inputs. So I took code from a real time clock and modified it to count the time while the motor is turning. The program will now accept one of the board’s push-button switches as an input at any time.

The code:

This is the code in txt format. Download
Given my many years out of practice, please be forgiving ;-)

What I would change in the next version? Plenty!

Wifey wants it enclosed. Whether because it looks ugly, or so as not to accumulate dust we’ll never know!

I don’t think the motor shaft is meant to be supporting a weight like this. Version 2 will take the weight off the motor shaft, onto a sturdier platform. That means the use of gears. Would it be loud?

Maybe a stepper motor? Or some way to track shaft position? Some kind of encoder? Or a photo-interrupter.

With a photo-interrupter, i would be able to count the revolutions instead of now it being only time based.

Knobs or some kind of control to control TPD (and therefore turns per hour) and direction (CCW, CW or both). A switch to stop the contraption so i can remove a watch, or put one on.

A LCD display to show off the settings and put some bling into it. Another idea is to use a rotary encoder with a push down button to effect the controls. That would really be cool.

Notes:

I found this to be a really good resource when I was thinking about making my own winder. Commercially available winders have different features dependant on price, doing it with a micro controller meant that I could incorporate a lot of the wish list features the aficionados look for.

Stay tuned for Version 2!