Home        Store        Docs        Blog

Basic ESC calibration?


(Andreas) #1

Hi,

I’ve hooked up two T100’s to a Pixhawk, running the Rover firmware with skid steering. It’s working, sort of. The issue I have is that the two thrusters doesn’t start at the same time when applying throttle. Now I’m starting to think that I might have calibrated one of them, but not the other. But not sure if they support throttle range calibration at all? Haven’t seen anything in the docs.

It might be a tuning thing in the Pixhawk, but I’d just like to check if calibration exists or not.

 

Thanks for a great product!

Andreas

 


(Rusty) #2

Andreas,

There’s actually no calibration routine in the firmware, they are set to hard limits of:

1100 µs: full reverse
1500 µs: stopped (and initialize)
1900 µs: full forward

The thrusters should start at the same time, possibly with slight variation due to any difference in internal resistance in the thrusters. If you’re seeing a dramatic difference, then something may be wrong.

Can you try switching which ESC is attached to each thruster? That will verify if it’s something with the thrusters or ESCs.

-Rusty


(Andreas) #3

Alright, that’s good to know and narrows things down a bit.

I suspect there’s something in the skid steering mixing that I’m doing wrong. It’s not a dramatic difference, one engine is starting maybe 100-200µs later than the other. And I’m also having some issues with the initialization of the ESCs. I have to move the throttle around a bit before both ESCs initialize. And that points even more at the Pixhawk not putting out 1500µs to both ESCs.

I’ll dig into it tomorrow!

Thanks for your super fast reply :slight_smile:

Andreas


(Rusty) #4

Andreas,

Cool! Let us know if you find a solution.

Best,

Rusty


(Andreas) #5

So, I’ve got this figured out now. It turned out that my Tx was drifting on the rudder channel, why the skid steer mixing in the Pixhawk didn’t put out exactly 1500µs to both motors at the same time. Now I replaced my old Turnigy 9X to a new Taranis Plus with D4R-II and it works like a charm!

Attaching a picture of my new friend (Inspired by something I found on the internet… :slight_smile: )

 

BR

Andreas



(Rusty) #6

Andreas,

Great to hear that you got it working well! Cool picture! Looks familiar :wink:

-Rusty


(Laura) #7

Hi,

I am planning on ordering a T100 and an ESC that I am planning to control with an arduino. I am planning ahead of time to make sure I understand. So when I hookup the ESC to the motor and then to the arduino and then to my computer I will input a value, say 1700 and the T100 should be full forward? No other calibration or “arming” of the ESC is necessary?


(Rusty) #8

Laura,

There is no calibration required, however you are required to initialize or arm the ESC by first sending a “stopped” signal of 1500. You need to provide that value for at least 1 second or so for initialization. Please see the example code here:

http://docs.bluerobotics.com/besc/#arduino

Let us know if you have any other questions.

-Rusty


(Laura) #9

Okay I think I got it. I realize that you’re not affiliated with arduino but I trust you have probably worked with their products. I wrote a basic program that I believe will work. After arming the ESC, I set the signal to 1700 causing the thruster to turn, after I use the serial input to allow for “real time” control of the thruster. Thoughts?

Here is the code:

 

#include <Servo.h>

byte servoPin = 9;
Servo servo;

// setup is where you run the code once

void setup() {
Serial.begin(9600); //turn serial on
servo.attach(9);

servo.writeMicroseconds(1500); // send “stop” signal to ESC.
delay(1000); // delay to allow the ESC to recognize the stopped signal
}

// main code here to run repeatedly
void loop() {
int signal = 1700; // Set signal value, which should be between 1100 and 1900
servo.writeMicroseconds(signal); // Send signal to ESC.
if (Serial.available()) {
signal = Serial.read();
Serial.write(signal);
}

}


(Rusty) #10

Laura,

Excellent. There is only a few issues in the code that I see.

First, Serial.read() can only read in one byte of data, which will only be 0-255. You need to read in an integer in the range of 1100-1900. Fortunately, Arduino has a handy function called Serial.parseInt() that will do exactly that. Replace Serial.read() with Serial.parseInt() and it should work great.

Second, since you are declaring int signal each time at the top of the loop() function, it will be reset each time. You need to declare it outside of the function or use the static keyword to make sure it retains its value through each loop.

Best,

Rusty


(Laura) #11

Okay great, so this will allow me to control the speed of the thruster through the serial monitor in the arduino program?

Thank you so much for your help! :slight_smile:


(Rusty) #12

Yes, it will. Good luck!

-Rusty


(Laura) #13

Hello again,

I am also planning to order a water tight enclosure. I am using a USB cable as a tether to communicate with the arduino which will be in the enclosure. I don’t believe the 6mm cable penetrator will work for this, any other suggestions?


(Rusty) #14

Laura,

You are right, it would be challenging to get the USB cable through the penetrator. It would have to be spliced.

I would recommend using a USB to serial converter on the topside and send serial communication through pins 1 and 2 of the Arduino. This will act exactly the same. If the tether is very long, then the serial communication may have errors and you would have to switch to something more reliable, like RS422 or RS485.

How long of a tether will you be using?

Best,

Rusty


(Laura) #15

is this what you are refering to? Once this is connected to the USB how would I connect to pins 1 and 2?

I plan on using 100 ft tether.


(Rusty) #16

Laura,

Yes. According to a quick search on Google, it looks like the Arduino serial interface can only go about 15m (50ft) at a baudrate of 9600 bps. If you slow it down more it should go much further. One post mentioned hundreds of feet at 300 bps. Fortunately, the Arduino serial interface supports this, but you won’t be able to transfer data very fast. To do this, start the serial interface with Serial.begin(300). You can also try 1200, 2400, 4800, etc to see what works. You’ll have to change the baud rate accordingly in the Serial monitor.

You will connect RX and TX on the Arduino (pins 1 and 2) to the TX and RX pins on the serial converter that you linked to.

Best,

Rusty


(Laura) #17

Okay, so connecting something like this: http://i.stack.imgur.com/Ymi96.jpg to the USB which will then be able to fit through the cable penetrators and connect to the arduino?


(Rusty) #18

Laura,

I’m not exactly sure what that is in the picture. You need a USB to serial converter. You could use the board you linked to earlier or something like an “FTDI Cable”.

-Rusty


(Jacob) #19

I have a serial converter like that, and yes it will work. If the product does not state ftdi explicitly, you will probably have to download the pl2303hx driver for it to work.


(Laura) #20

Hm, okay I will look into that a little more. Also are the T100 cables able to fit through the cable penetrator?