Ive got a 4 wire hdd to run thru a l293 driver board. It wont start by itself, and there isnt alot of torque... but it runs.heres the code.
int a =12; // L4
int b =11; // L1
int c =10; // L3
int d =9; // L2
void setup() {
pinMode(a,OUTPUT);
pinMode(b,OUTPUT);
pinMode(c,OUTPUT);
pinMode(d,OUTPUT);
}
void loop() {
digitalWrite(a,HIGH);
delayMicroseconds(3000);
digitalWrite(a,LOW);
digitalWrite(b,HIGH);
delayMicroseconds(3000);
digitalWrite(b,LOW);
digitalWrite(c,HIGH);
delayMicroseconds(3000);
digitalWrite(c,LOW);
digitalWrite(d,HIGH);
delayMicroseconds(3000);
digitalWrite(d,LOW);
}
any ideas on getting more torque would be great. i used delayMicroseconds when I didnt need to, but its in hopes of more speed. i can get it to run with a 1 ms delay, which gives it more speed but it hell to start.
They don't really need much to spin a platter but they DO usually run on 12Volts. What were you intending to drive with the motor?
Also, you know that these are usually Brushless DC motors... (BLDC) and I'm not telling you something new, right?
Maybe I am...
You are SEQUENTIALLY firing each coil as if it were a stepper... with BLDC motors there is usually a 120 to 180 degree OVERLAP and more than one coil is activated at a time (in some cases ALL are) based on rotational position. That's where you get the torque. If you fire each one individually... much less torque.
kinda get it. there is no reason other than learning for this project. Im a noob so im just teaching myself. Can you give me some references or basic code to get this up to speed. So there will always two coils on. And how do i know which order.
Nearly All BLDC controllers use Hall Effect Sensor feedback to determine spindle position and therefore know how to energize the coil sequence... it's actually not very "simple"... and I'm personally not very good with it yet.
There is an Open Source Motor Controller group on YAHOO you might want to check out.
Here's what got me starting: http://letsmakerobots.com/node/2898
The drawing at the bottom is the interesting part since you already figured out the upper part.
Don't know if pwm is fast enough for a fast changing sine though.