RC Groups

RC Groups
    DIY Electronics
        Mini-HowTo HK 30A BlueSeries ESC schematic and I2C/TWI mod

#1 [TwisteR] Mar 05, 2011 05:00 PM

HK 30A BlueSeries ESC schematic and I2C/TWI mod
 
Hello all!

I have done with drawing schematic for HobbyKing 30A BlueSeries Brushless Speed Controller. It's mostly complete, but still can contain some bugs, errors, missing or wrong elements or values (all ceramic caps are 0.1 uF for now, lol) etc. I would be very grateful for any advices, suggestions and corrections.

The target is to re-flash this ESC with opensource firmware, add I2C and/or UART interfaces. In other words, to play with it and to gain some experience with brushless motor controllers :cool:

Now I have a couple of questions:
1) Do all of this cheap ESCs have a current sensor? I did not found any...
2) What is the point of measuring voltage at S_PWR?
3) Can't figure out, what the connections PD0-PD2 and PB2-GND are all about :confused:
4) Why do we need an middle point connection from BEMF sensors to PD6 (sorry, I'm a noob in ESCs, but I've seen similar connections in other schematics).
5) Is there any well tested C firmware, where I can just modify I/O ports? Or should I write my own?

Thanks in advance for any answer! ;)

Here is the schematic (click for full version: 3200x2400 PNG, 357 kb)
http://tfsoft.org.ua/tmp/el/AVR/hk_b..._30a_thumb.png

Here are the board photos for reference:

(1637x721 JPG, 354 kb)
http://tfsoft.org.ua/tmp/el/AVR/hk_b...ront_thumb.jpg

(1629x753 JPG, 357 kb)
http://tfsoft.org.ua/tmp/el/AVR/hk_b...back_thumb.jpg

#2 SadSack Mar 05, 2011 05:11 PM

Hi

Well this should be a bonus http://www.rcgroups.com/forums/showthread.php?t=1384442
unless you've seen it already

Phil

#3 michaelstoops Mar 05, 2011 09:11 PM

For 2) could it be a brownout detector? The MCP1804 has 800mv dropout, if I recall correctly, so maybe it shuts down or goes to an alternate behavior if the voltage regulator has dropped out and the capacitors are discharging.

Looks like an awesome project. I'm kinda trying to reverse engineer the Syma S107. I have a mostly-complete schematic but to be sure I need to do some destructive testing (stripping the board) to be sure I've got all the circuitry correct, and I don't have a board to sacrifice. :( boo

Michael

#4 michaelstoops Mar 05, 2011 09:40 PM

For 3) I might hazard a guess that joining PD0/RXD and PD2/INT0 has something to do with using INT0 to trigger an interrupt when the PPM signal edges come in. Just glancing at the Atmel documentation, I'm seeing that INT0 is the second-highest priority interrupt and will wake it from special power modes.

Grounding pin PB2/SS'/OC1B looks like it would force the chip into SPI slave mode. Perhaps it is setup for in-system programming at the factory?

Just slightly educated guesses.

Michael

#5 [TwisteR] Mar 06, 2011 08:28 AM

Quote:

Originally Posted by SadSack (Post 17595777)
Hi

Well this should be a bonus http://www.rcgroups.com/forums/showthread.php?t=1384442
unless you've seen it already

Phil

Thanks, will take a look at this thread.

Quote:

Originally Posted by michaelstoops (Post 17597962)
For 3) I might hazard a guess that joining PD0/RXD and PD2/INT0 has something to do with using INT0 to trigger an interrupt when the PPM signal edges come in. Just glancing at the Atmel documentation, I'm seeing that INT0 is the second-highest priority interrupt and will wake it from special power modes.

Well, I'm totally agree about PD2/INT0, but connection to PD0/RXD does not make any sense... :confused:

I have one more question: why do we need to control high and low sides separately? They can be controlled from the same MCU pin, aren't they?

#6 jeffs555 Mar 06, 2011 10:49 AM

No they can't be controlled with the same pin. At any given time one motor wire is driven high and one is driven low and the third needs to be open circuit(this is where the feedback comes from). You need two pins for each motor wire so you can turn off both high side and low side drivers to open circuit the feedback wire. That is also why you need 4) the middle point connection. The commutation is triggered when the voltage on the open circuit wire crosses the center point between the two driven wires.

#7 quax Mar 06, 2011 12:36 PM

Quote:

Originally Posted by [TwisteR] (Post 17600839)
...
Well, I'm totally agree about PD2/INT0, but connection to PD0/RXD does not make any sense... :confused:
...

This INT0 is good to evaluate the PPM pulse and RXD is good to program the ESC with a TTL-serial connection.

But RXD may also be used as a power input, as it is used by some quadrocopters.

cu
quax

#8 George Shering Mar 07, 2011 11:37 AM

For 2, a possibility. Does the ATMEGA8 have a built in ADC?
If not then S_VBAT and S_PWR may be the voltage measuring circuit, checking how long S_VBAT takes to get to S_PWR after being released.

#9 Peter Seddon Mar 07, 2011 04:17 PM

Yes the ATMega8 has an ADC with 8 way multiplexer.

S-VBAT will probably be to give a shutdown when the battery voltage becomes critical. Many ESC's allow you to specify the battery type which with the voltage at startup is used to determine the shutdown threshold. Many ESC's offer a hard or soft shutdown. Not sure about S-PWR but it may be a startup check - to ensure the power is established and correct before allowing the software to start.

Peter


Quote:

Originally Posted by George Shering (Post 17612087)
For 2, a possibility. Does the ATMEGA8 have a built in ADC?
If not then S_VBAT and S_PWR may be the voltage measuring circuit, checking how long S_VBAT takes to get to S_PWR after being released.


#10 reph Mar 07, 2011 09:58 PM

Thanks for posting this. I've been reverse engineering the 12A BlueSeries, looks fairly similar (w/ 1 FET per rail instead of 3). I guess the AIN0 circuit acts as an ADC trigger to sample the BEMF?

#11 jeffs555 Mar 08, 2011 12:00 AM

Quote:

I guess the AIN0 circuit acts as an ADC trigger to sample the BEMF?
I think the ADC would be too slow for sensing the BEMF so usually use the analog comparator.

AIN0 is also the positive input to the analog comparator. The negative input to the comparator comes through the ADC mux so it can be connected to one of 8 inputs. The center voltage is connected to AIN0 and the program switches the mux to connect BEMF from the undriven wire to the negative comparator input. When the voltage on the undriven wire crosses the center point between the other two wires the comparator switches which triggers the commutation sequence.

To understand how it works, you can read this very long thread. http://www.rcgroups.com/forums/showthread.php?t=200567
Quax is the guru for BLDC controllers and you can learn a lot by looking at the source code on his site. http://home.versanet.de/~b-konze/

#12 reph Mar 09, 2011 12:31 AM

Ahh. They're using the ADC's mux, but not the actual ADC?

#13 Dan Baldwin Mar 09, 2011 12:38 PM

Quote:

Originally Posted by reph (Post 17628948)
Ahh. They're using the ADC's mux, but not the actual ADC?

A mux is a muliplexer. It's a way of switching the ADC between different analog inputs, so a single ADC can be used for multiple (in this case 8) analog inputs.

Dan

#14 [TwisteR] Mar 09, 2011 06:38 PM

Thank you guys for the answers! That make things clearer to me :)

Dan Baldwin, I think that reph was asking about using ADC's mux for comparator, and not for what "mux" is actually means.

#15 [TwisteR] Jun 03, 2011 03:44 PM

3 Attachment(s)
I've successfully converted this controller to I2C/TWI interface. In order to do so, we need to cut two traces (see attachments), add two wires and re-flash it with modified firmware.

The firmware for modified ESC is based on renatopub's code base and is available through svn:
Code:

svn checkout svn://tfsoft.org.ua/esc_firmware/branches/HK_Blueseries_30A_twi/
More details, photos & videos will be added soon :)


All times are GMT -5. The time now is 06:02 AM.