I have a HSP/Novatech 75A (#03307) brushless ESC, and I'm trying to control it with my mbed.
After a few hours of playing & researching, I've come up with the following code:
#include "mbed.h"
PwmOut motor(p21);
int main() {
motor.period_ms (20); //50 Hz
motor.pulsewidth_ms (1.5); //forwards?
motor = 0;
wait(2);
for(float i = 0.0665; i < .07; i+=0.0001){
motor = i;
wait(.1);
}
wait(5);
motor = 0;
}
I use the power from the ESC to the mbed, so when I turn it on, it turns the mbed on. It sets the motor output to 0 (to set neutral position?), waits 2 seconds and during this the ESC beeps, saying it's set & ready.
I increase the motor output from 0.665 (a figure from experiment) to 0.07 with 0.0001 steps, and somewhere in this the ESC beeps again (saying it's ready to go forwards?) and it slowly speeds up (clunky at first, to smooth at 0.07). (0.07 isn't the max speed, it's just a speed I thought was appropriate for inside & testing.)
It goes this speed for 5 seconds, then stops.
I've tried setting motor = 0.07 directly, but it doesn't move. The only way I've found that works is to slowly increment as the example above.
I have no clue how to go backwards (set the neutral position to 0.5 at start?). Why does it only work by incrementing?
Does anyone have any ideas? I couldn't find a datasheet or much useful information (any general info?). I still have the reciever handy, so I could somehow read how that sent signals to the ESC?
If I get it working to a decent degree I'll post the code in a cookbook (if allowed?)
I have a HSP/Novatech 75A (#03307) brushless ESC, and I'm trying to control it with my mbed.
After a few hours of playing & researching, I've come up with the following code:
I use the power from the ESC to the mbed, so when I turn it on, it turns the mbed on. It sets the motor output to 0 (to set neutral position?), waits 2 seconds and during this the ESC beeps, saying it's set & ready.
I increase the motor output from 0.665 (a figure from experiment) to 0.07 with 0.0001 steps, and somewhere in this the ESC beeps again (saying it's ready to go forwards?) and it slowly speeds up (clunky at first, to smooth at 0.07). (0.07 isn't the max speed, it's just a speed I thought was appropriate for inside & testing.)
It goes this speed for 5 seconds, then stops.
I've tried setting motor = 0.07 directly, but it doesn't move. The only way I've found that works is to slowly increment as the example above.
I have no clue how to go backwards (set the neutral position to 0.5 at start?). Why does it only work by incrementing?
Does anyone have any ideas? I couldn't find a datasheet or much useful information (any general info?). I still have the reciever handy, so I could somehow read how that sent signals to the ESC?
If I get it working to a decent degree I'll post the code in a cookbook (if allowed?)