Speed Controller terrible resolution

Hey guys,

I have tried to set up 4 speedcontrollers to use with my arduino mega, and treat them like servos. The only problem is that the speedcontrollers only respond to changes in frequency length between ~1580 and ~1604 microseconds. I need much more resolution in control than this, as I am using these motors and speed controllers for a quadrotor. Any suggestions? Things to look for? Maybe how to identify speed controllers without dampening, or how to program a larger range of response.

Are 24 speed levels not enough, assuming they provide a different speed for each µs?

If the hardware of your speed controllers doesn't provide the functions you need, get other hardware. What else do you want us to suggest?

Korman

Give us some more information.

What brand and model of speed control are you using?

I do not know how common this is, but some ESCs had throttle range mapping during the arming procedure. When you power up the ESC, it assumes that the throttle stick is at zero throttle, and remembers this throttle location. Then you move the stick to full throttle and it remembers the high throttle signal. Then you move the throttle back to zero and the ESC them 'arms', moving from an arming mode where the motor is not powered, to flight mode where the ESC powers the motor in response to throttle commands.

If you have an ESC with some throttle mapping, then you might not be giving it wide enough throttle commands during the arming process.

The only problem is that the speedcontrollers only respond to changes in frequency length between ~1580 and ~1604 microseconds.

This sounds crazy. You would have to post your code and a link to any datasheets for the esc for anyone to really be able to figure out what you are seeing.

Lefty

I have tried to set up 4 speedcontrollers to use with my arduino mega, and treat them like servos.

Are you using modified servos for the motors?

Modified servos for a quadrotor?
What sort of gear ratio would that need?

Modified servos for a quadrotor?
What sort of gear ratio would that need?

Maybe none. Direct drive off of the motor with no gearing. But brushed motors in model aircraft seems to be a thing of the past.

OK, a quadrotor doesn't need servos. It controls its position and attitude through changing the speed of its four motors (positioned North, East, South, and West, if you will). The problem I'm having is that the speed controllers have a very small range of response. 1500 us is the zero position, the position at which they arm. However, they do not respond to any change in throttle between 1500 and ~1580. Then, between ~1580 and ~1600, the speed controllers go from no throttle to full throttle, respectively. This simply is not enough resolution to maintain stable flight. Any of you quadrotor builders out there please respond if you have encountered this, and what you did to correct it. Thanks

and yeah, brushless motors, corresponding speed controllers, the whole shabang.

However, they do not respond to any change in throttle between 1500 and ~1580. Then, between ~1580 and ~1600, the speed controllers go from no throttle to full throttle, respectively. This simply is not enough resolution to maintain stable flight. Any of you quadrotor builders out there please respond if you have encountered this, and what you did to correct it. Thanks

It really sounds to me like the esc initilization isn't being performed properly. Many (most,all?) esc have a power-up/control sequence to insure the motors don't startup at power up and than the range of control is determined before it's set to go. A link to the esc datasheet or instruction book would be a help.

Lefty

What brand and model of speed control are you using?

You would have to post your code and a link to any datasheets for the esc

A link to the esc datasheet or instruction book would be a help

Looks like a common theme here. :slight_smile:

The servo's zero is when the pulse width is 1.5ms. One pole is when the pulse width is 1.0ms and the other pole is when the pulse width is 2.0ms.

So you have 500us of graduation above and below 1500us. You can increment a timer to control the high time of a pulse width, down to a single microsecond. In other words, the servo should respond to a pulse width of 1750us, by turning exactly halfway towards one pole, and 1250us pulse width should turn it exaclty halfway in the other direction.

If you can't observe the functionality as described above, then your code method needs to be revisited, or you have a faulty servo.

OK...

#include <Servo.h>

Servo speedController[4];

int position = 1500;

void setup(){
  
  for(int i = 0; i < 4; i ++){
    
    speedController[i].attach(30 + i);
    speedController[i].writeMicroseconds(1500);
    
  }
  
  Serial.begin(9600);
  
}

void loop(){
  
  Serial.println(position);
  
  if(Serial.available()){
    
    Serial.flush();
    
    if(position == 1500){
      
      position = 1570;
      
    }
    
    position += 1;
    
    for(int i = 0; i < 4; i ++){
      
      speedController[i].writeMicroseconds(position);
      
    }
    
  }
  
}

Above is my program for testing the motors.
I can control the SPEED CONTROLLERS like SERVOS because they take the same signal, but they are NOT servos. As you can see, the signal starts at 1500us, or the middle (zero). Then, it jumps quickly up to 1570 because nothing happens between 1500 and 1570. Then, after increasing it to around 1580 (by sending data to the serial port multiple times), the motors start spinning. However, the motors reach full throttle much too quickly (~1600us) and do not allow for much resolution. There are only about 20 values I can send to the motors. I hope this information helps.

Hi sprinjer1,
Multiple contributors have asked for more information on the ESCs you are using.

You have not provided it.

Can you tell us which brand and model of ESC you are using?
Even pictures of the front and back of the ESC would help.

If you can tell us which ESC you have, we can look up the specs and help troubleshoot your problem.

I have my suspicions which I stated in an earlier post. Arming.
But to confirm them, we need to know which ESC you have.

Please help us help you. Tell us which ESCs you are using.

Ok, first, they are arming. They both arm and run.
They are a cheap HobbyKing Brand. (http://www.hobbycity.com/hobbyking/store/uh_viewItem.asp?idProduct=6456&Product_Name=Hobbyking_SS_Series_15-18A_ESC)
15A, 7.4V - 11.1V made for LiPos. And I have had quite a bit of experience with R/C planes and helicopters, so everything is set up and running correctly.

I am, however, relatively new to controlling electronic components with microprocessors, and am having trouble with this. So if anyone has any ideas on how to have better control than 20 increments, it would be well appreciated.

So if anyone has any ideas on how to have better control than 20 increments, it would be well appreciated.

A good question is how many discrete increments does the ESC have with the RC receiver that it is designed to work with? What is the arming and control sequence using an RC receiver, and can this effect the control band when using RC equipment? I think RC equipment only outputs the timing to move a servo from onlly +45 deg to -45 deg.

Well posting the ad for esc helps a little, but still need the arming instructions that must come with it. What ever the arming procedure is you MUST perform it with your sketch (probably best done in the setup function) before you can give valid speed commands to the esc.

The following remarks come from one of the reviewers:

I am using this esc with a turnigy 2730-1700 outrunner and it is functioning perfectly. Programming is straight forward by battery off, transmitter on, then plug in battery and move thru the throttle position slowly. Instructions would have been nice for the wiring.

Can you review the documentation that came with the esc and give us a hint on how the initilization setup for the esc is performed?

Lefty

Ok, first, they are arming. They both arm and run.

Yes, they run, bit without a proper arming procedure, your ESCs might not accept the full input range.

Some ESCs map the input command range during the arming process.

When you use this ESC with your RC transmitter, you probably use a process something like this:

  1. Tx on
  2. throttle stick all the way down
  3. power on ESC (some ESCs beep at this point) Wait a second or so
  4. throttle stick all the way up. Wait a second or so.
  5. throttle stick all the way down (some ESCs beep here)

Now the esc is armed and will respond to throttle commands.

The input that the ESC sees in steps 3 and 4 let it know what range of input commands to expect. It maps zero throttle to the input command it saw in step 3. It maps full throttle to the input command it saw in step 4.

Your sketch does not appear to have a matching arming procedure. You write 1500 for an initial value. What happens if you put your throttle stick at mid stick (1500) and power up your ESC and wait for the ESC to use just that mid stick for its arming needs? I suspect that you will find the ESC only responds to stick positions a little bit on each side of mid stick.

Try adding an arming procedure to your setup. Write a low servo command. Wait a bit. Write a high servo command. Wait a bit. Write a low servo command. You might need to play with the delays before and after to get it all to work, but you should be able to get your ESC to respond exactly as if it were connected to your RC receiver.

The other problem is that the esc most likely only enters it's initilization phase when it's first powered up. So somehow you are going to have to have your Arduino power up first but wait until you then power up the esc. Only then can you have your setup code perform whatever the proper initilizations steps are. This is not an easy task without a lot of specific information about this esc.

Lefty

I checked the programming capabilities of my speed controller (HobbyCity 18A) and it can only be programmed to take either LiPo batteries, NiMH batteries, or to have a programmed break. Any suggestions?