-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4-in-1 ESCs #132
Comments
Still, at a minimum, I'd say four comparators would be needed. |
I checked and SiLabs does NOT have an MCU with 4 comparators; Atmel does. The three supporting processors are here. The only difference between the three Atmel chips is memory size (as I can see). As for pricing, a single ATmega8-16AU runs just above $4 USD for a single chip whereas the ATmega16M1 in single lots is just under $6 USD. When you start to look at unit costs, one ATmega16M1 sure beats 4 ATmega8-16AU MCUs. |
In a one-MCU-for-one-motor scheme, the comparator is operated in a multiplex way for A, B, C phases. While in a one-MCU-for-four-motors scheme(if exist), the only one comparator should also be operated in a multiplex way for A1, A2, A3, A4, B1, B2, B3, B4, C1, C2, C3, C4 phases, serially, if the MCU is fast enough. The truth is that i don't have to find out the exact time of zero cross event. only if the frequency is high enough, what i need is the time of check in which the comparator result is changed compared to the previous check. the time of zero cross event could be find out somewhat roughly. think about the differences between analog and digital. now the problem is, you need an MCU with a 12 ways multiplexer for quad-motors, or 9 ways multiplexer for tri-motors and 6 ways multiplexer for dual-motors. |
@nonamerubbish can you be a little more specific so I know what to look for in an MCU? This is from the C8051F363 datasheet.
Is this what you mean? |
In fact, i just start learning the AVR MCU. i don't know much about C8051. so the method i provide could be possible, but not must be possible. the zero cross event is checked with Analog Comparator, but not Analog and Digit Convertor, in the BLHeli program for AVR MCU as i know. is it the same for C8051 MCU?(@ sskaug) |
Thanks to https://github.com/RamonMartins/BLHeli_S-Startup-Tones music_gs4: mov Temp3, bitdump#58 ;length of tone mov Temp4, bitdump#29 ;number of delay loop1 cycles (tone frequency) mov Temp5, JazzMaverick#2 ;number of delay loop2 cycles (large step?) jmp music music_as4: mov Temp3, bitdump#58 mov Temp4, bitdump#29 mov Temp5, JazzMaverick#2 jmp music music_f1: mov Temp3, bitdump#222 ;length of tone mov Temp4, bitdump#110 mov Temp5, JazzMaverick#2 ;one ms ;frequency of tone 1=500, 2=1000, 3=1500 jmp music music_f2: mov Temp3, bitdump#132 ;length of tone mov Temp4, bitdump#43 mov Temp5, JazzMaverick#3 ;one ms ;frequency of tone 1=500, 2=1000, 3=1500 jmp music music_f3: mov Temp3, bitdump#132 ;length of tone mov Temp4, bitdump#29 mov Temp5, JazzMaverick#2 ;one ms ;frequency of tone 1=500, 2=1000, 3=1500 jmp music music_f4: mov Temp3, bitdump#88 ;44 mov Temp4, bitdump#172 mov Temp5, JazzMaverick#2 jmp music music_g4: mov Temp3, bitdump#98 ;49 mov Temp4, bitdump#110 mov Temp5, JazzMaverick#2 jmp music music_c: mov Temp3, bitdump#65 mov Temp4, bitdump#182 mov Temp5, JazzMaverick#1 jmp music music_d2: mov Temp3, bitdump#146 ;73 mov Temp4, bitdump#140 mov Temp5, JazzMaverick#1 jmp music music_ds: mov Temp3, bitdump#78 mov Temp4, bitdump#121 mov Temp5, JazzMaverick#1 jmp music music_e: mov Temp3, bitdump#82 mov Temp4, bitdump#103 mov Temp5, JazzMaverick#1 jmp music music_f: mov Temp3, bitdump#87 mov Temp4, bitdump#86 mov Temp5, JazzMaverick#1 jmp music music_g: mov Temp3, bitdump#196 ;98 mov Temp4, bitdump#55 mov Temp5, JazzMaverick#1 music: mov A, Temp5 push ACC BcomFET_on ; BcomFET on ApwmFET_on ; ApwmFET on mov A, Beep_Strength djnz ACC, $ ApwmFET_off ; ApwmFET off BcomFET_off ; BcomFET off pop ACC mov Temp5, A mov Temp2, A ; Make copy of Temp5 to work with (Temp2) mov A, Temp4 mov Temp6, A music_O_loop: ; Outer loop mov Temp1, bitdump#23 ; Number of times to repeat inner delay loop music_M_loop: ; Middle loop clr A djnz ACC, $ ; Inner loop (42.7us - 1024 cycles) djnz Temp1, music_M_loop djnz Temp2, music_O_loop wait_150us: mov A, bitdump#30 ;5us wait djnz ACC, $ djnz Temp6, wait_150us djnz Temp3, music
Could the codebase be adapted to a C8051F363 chip? It runs at 100 MHz and has 5 digital ports. All of the 4-in-1 ESCs that I see are really just 4 ESCs "glued" together. Would be nice to reduce the chip count and have one MCU for all four motors. Is this feasible? Thanks!
The text was updated successfully, but these errors were encountered: