hdd motor -- can't get past 1200RPM

I have wanted to build the HDD pov clock for a long time, and finally got the L293D chips in the mail the other day.

after hours and hours of experimenting [I cannot believe I'm still up at 2AM working on it :o ] the most I was able to get was about 1200RPM.. and even then, if I bump or slow the motor it can stop and just chatter.

Here are a few key things I want to mention: I glued a small neodymium magnet onto the platter. I'm using a hall effect sensor, and I'm having some kind of magnetic interference. I have the 6 steps that it cycles through for each quarter-turn and when I write the 3 outputs, I first turn off an ENABLE pin, write all 3, then turn ON the ENABLE pin. However, if I connect the enable pin [on the breadboard], it causes the hall effect sensor to trigger false, and instead of once per revolution, it triggers multiple times a rev [I'm assuming back-emf?].

so for now I just leave the enable pin alone, or tied to VCC, and the sensor works.

Oh and the other thing, I have 2 L293D's in parallel so to speak. I hooked up 1, and it was getting too hot at ~500mA, so I put another one above it and put a jumper on each pin that was being used. shared the load, not quite even but it ran cooler.

that's all I can think of.. oh here's the full code: http://pastebin.com/8bQZWcFA I switched from millisecond to microsecond delays so the comments of the code might not all be 100% correct.

the main things I'm wondering: is not shutting off the power before I switch polarities [due to interference I get when enabled] limiting my max speed? if so, if I get an infrared sensor what speed can I expect to gain?

and for the project I'm thinking of [http://www.ian.org/HD-Clock/ -- I haven't cut the slot in the plate yet] would ~1200RPM be enough for POV? I'm thinking no, because it's 20 R/second, i.e. 20 FPS, and 24 FPS is what smooth animation looks like. [it would look choppy I guess?]

Bump

I don't know anything about those motors, but do people a favour and post your code here so they don't have to make a journey to another website.

How could a clock need 1200 rpm ?

...R Stepper Motor Basics

Robin2:
I don’t know anything about those motors, but do people a favour and post your code here so they don’t have to make a journey to another website.

How could a clock need 1200 rpm ?

…R
Stepper Motor Basics

Robin – I could not find a CODE option like some forums have, so I did not want a big long chunk of code that is hard to read. it’s much more elegant on Pastebin with color formatting, etc. but for you I have posted the code here in a block quote:

#include <TimerOne.h>

int one = A1;
int two = A2;
int three = A3;
int en = A5;

//int in = 2;

void setup() {
// put your setup code here, to run once:

//1000000 is 1.0 Second
//2000 = 2ms
//2000
Timer1.initialize(100); // set a timer of length 100000 microseconds (or 0.1 sec - or 10Hz => the led will blink 5 times, 5 cycles of on-and-off, per second)
Timer1.attachInterrupt( timerIsr ); // attach the service routine here

//pinMode(in, INPUT_PULLUP);
attachInterrupt(0, isr, FALLING);

pinMode(one, OUTPUT);
pinMode(two, OUTPUT);
pinMode(three, OUTPUT);
pinMode(en, OUTPUT);
pinMode(13, OUTPUT);

Serial.begin(9600);
}

bool seq[3] = {
{true, true, false },
{true, false, false },
{true, false, true },
{false, false, true },
{false, true, true },
{false, true, false },
};

volatile long msold = 0;
volatile long msnew = 0;

volatile int mpr1 = 0;
volatile int mpr2 = 0;

volatile long tick = 0;
volatile int freq = 250; //frequency at which every freq’nth time the ISR calls, we do next step
volatile int freqmin = 25; //the fastest theoretical speed is determined by this

void isr() //magnet speed sensor
{
msold = msnew; //set “old new” ms to oldms
msnew = micros();

mpr2 = mpr1;
mpr1 = mpr();

if(mpr1 < mpr2)
{
if(freq > 100)
freq -= 10;
else if(freq > 15)
if(tick % 3 == 0) freq -= 1; //In order to get more speed I had to slow down the acceleration, hence the % 3
}

digitalWrite(13, !digitalRead(13));
}

long mpr() //return Millisecond Per Revolution
{
return msnew - msold;
}

void timerIsr()
{
tick++;
if(tick % freq == 0)
nextStep();
}

volatile long steps = 0;

volatile byte pointer = 0;

void nextStep()
{
steps++;
if(pointer > 5)
{
pointer = 0; //reset if we reached last step. happens 4 times a revolution;
}

digitalWrite(en, LOW); //disable ENABLE pin
digitalWrite(one, seq[pointer][0]);
digitalWrite(two, seq[pointer][1]);
digitalWrite(three, seq[pointer][2]);
digitalWrite(en, HIGH); //enable ENABLE pin
pointer++;
}

void loop() {
// put your main code here, to run repeatedly:

delay(500); Serial.println(mpr());

}

Secondly, you apparently did not even read much of the project I linked to [here it is again for you to read: LED Hard Drive Clock 3.5" ]

There is a disk platter that has a slot cut from the center point to the edge of the platter. This allows light to shine only on that one spot. Then the platter spins very fast [I assume a minimum of 24 FPS, which is 1440 RPM], and you change the color of the RGB led behind the platter very fast to make a pattern form. [Just watch the youtube video in the project link, it will make everything clear]

The guy in the tutorial you posted claims 60 Hz is necessary but I don't think that's right, and I didn't see sources. I know when working on animation 24 frames/sec is a suggested starting point to save resources and over head while creating smooth visuals. Anything over 15 frames/sec is when the brain starts visualizing animation but choppiness is noticeable.

You would think in this setup that as long as the disk moves fast enough to not notice the slot you are in the clear. What motor are you using?

mvmacd:
Robin – I could not find a CODE option

It is the first button above the editor and looks like </>

the result looks like this

and I can easily select your code and copy it to my text editor. If you modify your post I will look at the code.

Secondly, you apparently did not even read much of the project I linked to

You are quite right. I feared it would take too much time that might be better spend helping another person.

You need to get me interested first.

…R

ApexM0Eng: The guy in the tutorial you posted claims 60 Hz is necessary but I don't think that's right, and I didn't see sources. I know when working on animation 24 frames/sec is a suggested starting point to save resources and over head while creating smooth visuals. Anything over 15 frames/sec is when the brain starts visualizing animation but choppiness is noticeable.

You would think in this setup that as long as the disk moves fast enough to not notice the slot you are in the clear. What motor are you using?

Thanks for the insight on the POV aspect. I am using a BLDC motor from a maxtor 5400rpm hard drive. I haven't done any more experimenting, because I was hoping someone could save me a lot of time and explain why it won't work, or, tell me which way to achieve victory! (Not that I'm against experimenting--I tried all I could think of for almost 5 hours straight. Probably more, lol)