Home        Store        Docs        Blog

Cannot run T200 Thruster in both directions


#1

Hello everyone,

I have been trying to run some tests with the T200 thrusters, with some basic code written in Arduino IDE. Unfortunately, I could run the motors only in one direction (reverse).

Specs: 14.8V 10Ah, 10C LiPo battery; AfroESC with max 30A; T200 thruster

Code:
#include <Servo.h>

Servo servo;
static const byte servoPin = 9;
static const int MAX_FWD_REV_THROTTLE = 400; // Value between 0-400
static const int CENTER_THROTTLE = 1500;

void setup() {
  servo.attach(servoPin);
  servo.writeMicroseconds(CENTER_THROTTLE); // send "stop" signal to ESC.
  delay(1000); // delay to allow the ESC to recognize the stopped signal
}

void loop() {
  servo.writeMicroseconds(CENTER_THROTTLE-MAX_FWD_REV_THROTTLE); // backwards 1100
  delay(5000);
  servo.writeMicroseconds(CENTER_THROTTLE+MAX_FWD_REV_THROTTLE); // forward 1900
  delay(3000);
}

Basically, the thruster ignores the 1900 microseconds command.

Is there something that I am doing wrong?

Many thanks,
minu


(Jacob) #2

Where did you buy your Afro ESC?

It sounds like your ESC does not have reversible firmware on it.


#3

Hey,

They were bought from a company called ROV-Control, from the USA. They were bought just before the company hit bankruptcy.

I presume that the firmware may be the issue. Is there a possible fix to this problem?

Many thanks,
minu


(Jacob) #4

If they are Afro 30A ESCs, then it is possible to flash them with our custom firmware available on our ESC product page. Otherwise, you will need different ESCs.


#5

Yes, they are Afro 30A ESCs.

Could you please be more precise about this process, especially that now you don’t call it Afro ESC anymore. I landed on the Github page and on the Google Code page after following your instructions.

I don’t know exactly which files are to be used and how.

Thanks


(Adam) #6

Hi Minu,

You can flash you ESC with the BasicESC forward/reverse firmware here (right click save link as on the page) using these instructions.

The BasicESC is just our name for the firmware customized 30A Afro ESC we sell to go with our thrusters.

-Adam


Change Firmware Afro 30A ESC OPTO
#7

Hey Adam,

Many thanks. The instructions are very clear.

The only bug is due to Arduino, as the code in ArduinoUSBLinker is not compilable for any Arduino board. During the compilation to an Arduino Due board, the “eemprom.h” library is signaled as missing, even though it is existent in the hardware libraries. Moving them in the ones called by the compiler does not solve the issue. Running the code online, on their Cloud will signal other issues…so it is quite a dead end. The Pololu A-Star has other issues as well, but compiling it for Arduino Uno or Duemivalone signals no problems at all. This may become frustrating for Arduino users, as each board has a different behaviour.

Unless you have a better suggestion, I will order an Arduino Uno and try the setup for reflashing the ESCs again.


(Adam) #8

Hi Minu,

Yes, I believe that code will only compile for an Arduino Uno. Getting an Uno sounds like a good idea, getting the right firmware on there should be all you need to do!

-Adam


#9

Hey Adam,

Just completed the reflashing using an Arduino Uno board. The motors have now a proper behaviour when running them on either Arduino or Raspberry Pi board.

Here’s the code I used for testing the motor out with Arduino:

#include <Servo.h>

Servo servo;
static const byte servoPin = 9;
static const int MAX_FWD_REV_THROTTLE = 75; // Value between 0-400
static const int CENTER_THROTTLE = 1500;

void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);

  servo.attach(servoPin);
  servo.writeMicroseconds(CENTER_THROTTLE); // send "stop" signal to ESC.
  delay(1000); // delay to allow the ESC to recognize the stopped signal
}

void blinkOnce() {
  digitalWrite(LED_BUILTIN, LOW);
  delay(500);
  digitalWrite(LED_BUILTIN, HIGH);
  delay(500);
  digitalWrite(LED_BUILTIN, LOW);
}

void stopMotor() {
  servo.writeMicroseconds(CENTER_THROTTLE); // stop
  delay(1000);
}

void loop() {

  // signal backwards movement
  blinkOnce();
  digitalWrite(LED_BUILTIN, HIGH);
  delay(500);
  servo.writeMicroseconds(CENTER_THROTTLE - MAX_FWD_REV_THROTTLE); // backwards
  delay(2000);
  // signal stop
  stopMotor();


  // signal forward movement
  blinkOnce();
  digitalWrite(LED_BUILTIN, LOW);
  delay(500);
  servo.writeMicroseconds(CENTER_THROTTLE + MAX_FWD_REV_THROTTLE); // forward
  delay(2000);
  // signal stop
  stopMotor();
}

Many thanks for the support,
minu


(Adam) #10

Hi Minu,

Great to hear you have the ESCs working well! Happy to help.

-Adam