46Views1Replies

Author Options:

autonomous car goes full reverse because of wrong initialization of ESC? Answered

 Hi, I have a problem with my robotics project. I am building an autonomous car using a LiPo battery (2S) and a 15T motor and an Arduino board. I know that I have to initialize the ESC at the beginning of my code but for some reason, the initialization goes wrong sometimes. I don't know if my code is wrong or what. Sometimes the initialization is fine and I'm able to run the car, but sometimes it goes full reverse which is very inconvenient. These are the 8 lines of code I have to initiate the ESC:  throttle.attach(6);                                                        throttle.write(70);   
      delay(2000);        
      digitalWrite(6,LOW);
      delay(1000);
      throttle.write(77);
      delay(1000);
      digitalWrite(6,LOW);

Discussions

0
None
iceng

4 years ago

Usually I set one line high and the other low to go FWD and reverse the process to REV.

But I use a transistor bridge. You don't say what ESC.

You cannot run the motor directly off of the micro-pins as the brush noise will upset the operation of microprocessor and result in unpredictable results.