HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Nov 01, 2011, 08:35 AM
Registered User
Joined Nov 2011
3 Posts
Help!
ESC with Microcontroller NOT WORKING! PLEASE HELP!

Hi,
I am trying to build a 4 wheeled robot based on:
Redcat Ground Pounder
http://www.redcatracing.com/RC-Cars/.../GroundPounder

I am using the B7003 ESC that comes with this monster truck. And trying to control it with Atxmega64a1 microcontroller.

I currently have PWM controlling the servo, and the same function going to the ESC, but it is not doing anything.
What I found out so far is that I have to send out a the corresponding number close to 1ms otherwise the ESC will not make a sound that says "Connected to receive signal" and then it blinks a tiny red led saying "receiving signal".
And then it has a spur of motor spin for 1 sec, and stops, and goes again, and stops.
Any idea what the problem is?
Any advice or suggestions on what I should do?
I am tight on schedule to get this done.... is it better to just buy another motor and ESC combination?
I can't find any datasheet or anything on this part either.

I am really stuck on this project.
Really appreciate the help!
Thank you so much!

P.S
I've read all the other posts on here about ESC with microcontroller, but it didn't help much.
angelmdevilm419 is offline Find More Posts by angelmdevilm419
Reply With Quote
Sign up now
to remove ads between posts
Old Nov 02, 2011, 12:39 AM
mostly newbie
shimniok's Avatar
United States, CO, Centennial
Joined May 2011
263 Posts
Hm, wow... where to begin...

Do you know for 100% sure this is a standard ESC that takes a standard servo signal?

How have you set up your PWM signal? It should be a period of 20ms (50Hz freq) with a duty cycle set such that the pulse with varies from 1ms to 2ms with 1.5ms as the center (off) signal.


(image from Pyroelectro.com displayed here for educational purposes)

Do you have an oscilloscope? If so, it'll help if you verify that the microcontroller is sending the correct signal. You might also be able to reverse engineer the signals generated by the transmitter and compare.

Can you control the position of the servo correctly? Can you make it sweep smoothly back and forth? What if you plug that output signal into the ESC?

Can you post up C source code? (If you're using assembly I won't be able to help much at all)

(Coincidentally, I just did some rudimentary servo / esc control a few days ago using an ATtiny13... although I wasn't using straight pwm)
shimniok is offline Find More Posts by shimniok
Reply With Quote
Old Nov 08, 2011, 04:34 PM
Registered User
Joined Nov 2011
3 Posts
thank you for the post.
but since I was having no luck. I decided to go buy a brand new esc with a brushless motor.
now it seems to be working fine with my microcontroller.
but since it is a PWM... the motor goes on and off.
how do i hold the value for the motor to keep running?

thank you so much for the help!
angelmdevilm419 is offline Find More Posts by angelmdevilm419
Reply With Quote
Old Nov 09, 2011, 08:49 AM
mostly newbie
shimniok's Avatar
United States, CO, Centennial
Joined May 2011
263 Posts
You need to send a constant 50hz signal with 1.5ms on time at all times to keep it running. If you want your MCU to do anything else at the same time, your best bet is to use the onboard timer/counter either

1) configured in PWM mode, adjusting the duty cycle <-- least MCU cycles required, limited to PWM output pin
2) configured to fire interrupt and use interrupt handler to turn signal on/off <-- more MCU cycles required, can use any pin.
shimniok is offline Find More Posts by shimniok
Reply With Quote
Old Nov 09, 2011, 02:41 PM
Registered User
Joined Nov 2011
3 Posts
but isn't 1.5ms a neutral?
the way i have it set up right now is.....

int main (void)
{
TCC0_CCA = 739; //this is for my 1.5ms for my esc, this is the only way the esc will arm and start receiving signal

while(1)
{
if (bumper pressed){
TCC0_CCA=800; //for forward throttle
}
}

}

doesnt the code stay in the while loop and not go outside to re-initialize the timer compare and capture to 739??

sorry i am very new to this...
angelmdevilm419 is offline Find More Posts by angelmdevilm419
Last edited by angelmdevilm419; Nov 09, 2011 at 02:46 PM.
Reply With Quote
Old Nov 10, 2011, 09:39 AM
mostly newbie
shimniok's Avatar
United States, CO, Centennial
Joined May 2011
263 Posts
That's right. Initialize the timer/counter registers once (you didn't show that code, though?).

Then change the compare register (I guess that is TCC0_CCA -- maybe on ATXmega the register names are different versus ATmega) within the main loop as you're showing.

That's how I've done it on my robots.

So, in your demo code above, if the bumper is hit, then it goes forward forever.

As to your earlier question

Quote:
but since it is a PWM... the motor goes on and off.
how do i hold the value for the motor to keep running?
In fact, the PWM signal is supposed to run continuously. If the ESC is getting a continuous signal, then it'll run the motor according to the pulse width.

How are you initializing the timer? Can you show the code?
shimniok is offline Find More Posts by shimniok
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Help! Please Help On ESC interface with Basic Stamp Microcontroller MAX_MN DIY Electronics 17 Jan 20, 2012 03:45 PM
Discussion Help with Plush 30A & Paris V3 not working thepelell Multirotor Talk 3 Aug 06, 2011 08:28 PM
Discussion Help please something is not working Mechnan FPV Talk 33 May 24, 2011 11:56 AM
electrifly receiver with 30a esc not working need help maeu2003 Radios 4 Jul 16, 2004 03:47 PM
piccoboard not working with hitec 6ch please help kevinO Micro Helis 3 Mar 20, 2004 12:15 PM