Traxxas EVX-2 ESC from an E-Maxx 3905

Has anyone had any luck interfacing an EVX-2 with a microcontroller or servo controller?

I bought one of the newer E-maxx 3905’s and I was able to get the steering servos to work with the Pololu Serial Servo Controller and an Arduino.

I was hoping to get the EVX-2 to work so I wouldn’t have to pull it out and put in an H-Bridge.

Can anyone give me some help with the EVX-2? Maybe it’s the same protocol as an EVX?

Thanks.

Hello.

Does the EVX-2 not work like a regular speed control? If it’s a regular speed control, you should be able to interface with it just like any servo (e.g. use our servo controller or generate the 1-2ms pulses on your microcontroller).

- Jan

I’m using an Arduino with the Micro Servo Controller and the sample code from this site.

What setting would produce a 1-2ms pulse? Is that the servo speed or the servo direction?


void setup()// run once, when the sketch starts
{
  Serial.begin(9600);
}

void loop() //Main program loop, executes forever after setup()
{

  servoSetSpeed(0,10);   // set servo speed
  put(0,5000);           // turn servo 1 right
  
 
}


void put(unsigned char servo, unsigned int angle){
   //servo is the servo number (typically 0-7)
   //angle is the absolute position from 500 to 5500

   //Send a Pololu Protocol command
   Serial.print(0x80,BYTE); //start byte
   Serial.print(0x01,BYTE); //device id
   Serial.print(0x04,BYTE); //command number
   Serial.print(servo,BYTE); //servo number
   //Convert the angle data into two 7-bit bytes
   Serial.print(((angle>>7)&0x3f),BYTE); //data1
   Serial.print((angle&0x7f),BYTE); //data2
}

void servoOff(unsigned char servo){//turns off a servo
   //(servo will go limp until next position command)
   //servo is the servo number (typically 0-7)

   //Send a Pololu Protocol command
   Serial.print(0x80,BYTE);//start byte
   Serial.print(0x01,BYTE);//device id
   Serial.print(0x00,BYTE);//command number
   Serial.print(servo,BYTE);//servo number
   Serial.print(0x0f,BYTE);//data1 (turn servo off, keep full range)
}

void servoSetSpeed(unsigned char servo, unsigned char speedcmd){
   //servo is the servo number (typically 0-7)
   //speed is servo speed (1=slowest, 127=fastest)
   //set speed to zero to turn off speed limiting
   
   speedcmd=speedcmd&0x7f;//take only lower 7 bits of the speed
   
   //Send a Pololu Protocol command
   Serial.print(0x80,BYTE);//start byte
   Serial.print(0x01,BYTE);//device id
   Serial.print(0x01,BYTE);//command number
   Serial.print(servo,BYTE);//servo number
   Serial.print(speedcmd,BYTE);//data1
}

All that RC hobby servos can do is go to a position as fast as they can (except for really fance specialized servos). The 1-2ms pulses just encode the desired position; in the case of a speed control, speed is substituted for position. When doing “speed control” with a servo controller, the servo controller is really just automatically gradually changing the target position. If you use the speed option with a speed control, you will just change the rate of changing the speed (i.e. have acceleration control).

- Jan

bernardroth,

I spent a month last winter trying to get the EVX-2 ESC to work correctly with pulses from a microcontroller. I gave up.

The EVX-2 works from pulses just like the servos. 2.0 msec pulse is high speed forward, 1.5 msec is off-no brake (actually 1.492 msec on my EVX-2) and 0.9 msec for full reverse or full brake. There is a 20 msec pause between pulses.

I had two problems. First, I could not get the EVX-2 to go into reverse reliably. Going from forward to reverse just produced brake, no reverse. I tried stopping the motors, monitoring the encoders for zero speed, then reversing the pulse. That worked some time, but not all of the time.

The second problem is that it doesn’t brake without a pulse width less than 1.5 msec. In other words, you could be going fast and give it a command to slow to another forward speed, and it just coasts for a long time. Even changing the pulse width to 1.5 msec doesn’t result in braking, just coasting. That is not a good characteristic if accurate speed control is desired.

Remember that the EVX-2 was made for manual control and intended to ease drive train shock loads regardless of driver input.

I gave up and bought a different control for the motor.

  Rick Brooks

Thanks for the help. I played around with the settings till I found the right numbers.

I remember that I had to put the wireless remote in reverse twice for it to go from forward to reverse. Maybe something with the gear box on the E-maxx?

Richard: which motor controller did you use that worked better than the EVX-2?

Here is an example I used to go from forward to reverse with the code I posted earlier:
(I also put a “put(0,2900);” in the setup area of the code to reset the EVX-2, to bring it to a green light state)

  put(0,2944);           // slower forward
  delay (1000); 
  put(0,2900);           // neutral  
  delay (1000);     
  put(0,2800);           // reverse
  delay (1000); 
  put(0,2800);           // reverse 
  delay (1000);
  put(0,2900);           // neutral
  delay (1000);       

I tried replacing the two reverse commands with one long one, but it didn’t seem as smooth, so I recommend using two reverse commands.

Other speeds settings:
// put(0,2600); // fast reverse
// put(0,2800); // reverse
// put(0,2900); // reset & neutral
// put(0,2943); // twitchy forward
// put(0,2944); // slower forward
// put(0,2950); // slow forward
// put(0,3000); // forward
// put(0,3100); // really fricken fast
// put(0,3200); // holly buckets it goes faster!
// put(0,3300); // even faster… all the way to 5000?

Unfortunately, I did not use a Pololu product. I used a Robotec AX1500SC. This is one of the very few robots that I’ve built that does not use one of the Pololu motor drivers.

Going into reverse twice to get reverse drive does work with the remote control. I could not duplicate the function reliably with a microcontroller. It is not the gearbox, the EVX-2 is controlling reverse.

Once you have your code working, try an autonomous four point turn:

Drive forward up to a solid object (wall).
Give full right and reverse for a little while.
Stop.
Give full left and forward for a little while.
Stop.
Give full right and reverse for a little while.
Stop.
Give full left and drive away from the wall.

Once you can successfully perform that maneuver, then you’ve mastered the EVX-2.

  Rick Brooks