ok, I'm finally throwing in the towel and asking for help.
here is what I have:
a Maxtor diamondMax vl 40 that is broken down to just the 4 wires from the BLDC
I also got a E-flite 10amp pro BL ESC http://www.e-fliterc.com/ProdInfo/Files/EFLA1010_manual.pdf
at first i was just running 5v from the arduino. and the disk would pulse, speed up for about 2 second at maybe 1500 rpms. then it would turn off and it would slowdown for about 2 seconds.
the manual says something about a soft cut off where if the voltage is 70% of startup then it would begin to pulse... I don't know if this is where my problem is or not.
i even tied it with a battery where the voltage measured at 11.2 volts and didn't stop the pulsing
so no i'm thinking it's with my code, or the motor is just speeding faster than the code. since i don't have anyway of checking how fast it is going..
is there a way to calculate speed from the control pin of the hdd or from the ESC?
is the pulsing coming from the drive outrunning the code?
here is the current sketch I'm using:
#include <Servo.h>
Servo myservo;
int potpin = 0;
int val;
int analogPin = 3;
void arm(){
myservo.write(0);
delay(2000);
}
void setup()
{
Serial.begin(9600);
myservo.attach(9);
arm();
}
void loop()
{
for (int i = 0; i < 180; i++){
val = i;
myservo.writeMicroseconds(1200);
myservo.write(val);
int a = analogRead(analogPin);
Serial.println(a);
delay(15);
}
}
here is another one i've use but still does the same thing.
// this uses the Arduino servo library included with version 0012
// caution, this code sweeps the motor up to maximum speed !
// make sure the motor is mounted securily before running.
#include <Servo.h>
Servo myservo;
int analogPinLow = 3; // potentiometer wiper (middle terminal) connected to analog pin 3
int analogPinHigh = 4; // outside leads to ground and +5V
int val = 0; // variable to store the value read
int pwmpin = 6;
void arm(){
// arm the speed controller, modify as necessary for your ESC
setSpeed(0);
delay(2000); //delay 1 second, some speed controllers may need longer
}
void setSpeed(int speeda){
// speed is from 0 to 100 where 0 is off and 100 is maximum speed
//the following maps speed values of 0-100 to angles from 0-180,
// some speed controllers may need different values, see the ESC instructions
int angle = map(speeda, 0, 360, 0, 360);
myservo.write(angle);
}
void setup()
{
Serial.begin(9600);
myservo.attach(9);
arm();
}
void loop()
{
// debug value
int speeda;
// sweep up from 0 to to maximum speed in 20 seconds
if (speeda < 360){
for(speeda = 0; speeda <= 360; speeda += 1) {
setSpeed(speeda);
delay(20);
}
speeda = 0;
}
// // sweep back down to 0 speed.
//
// for(speeda = 175; speeda > 0; speeda -= 5) {
//
//
// setSpeed(speeda);
// analogWrite(pwmpin, 255);
// delay(30);
// }
// setSpeed(0);
}