Skip to content
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

ADC Problem for XP7A with 330r resistor #98

Closed
meleeshop opened this issue Sep 27, 2015 · 3 comments
Closed

ADC Problem for XP7A with 330r resistor #98

meleeshop opened this issue Sep 27, 2015 · 3 comments

Comments

@meleeshop
Copy link

hi everyone,
thank you for working on blheli, actually i find a problem with the xp7a. when i replace the 330r risistor on xp7a with 334r (330r +4r) and the esc will work extra fine as a 330r resistor. usual we would not find the bug, the standard 330r resistor will work with 99% of the motor, but as i start to use a 1410 motor and 2s lipo, the motor started very difficult. with 1s lipo would be OK, problem only for 2s. testing with about 10 motors and 10 escs. even with 1s lipo, the xp7a esc also not good as a xp3a, with xp3a i can start the 1410 motor very soft with very small throttle, but xp7a must be with some vibration. replace the resistor with 334r on f330 chip pin 19, and problem solved. please would someone tell me how to find the code to change the ADC data on pin 19, so i don't need to change the resistor. thanks! PS. with other small size motor you will not find the problem, with a 1306 motor the xp7a will worked very good in 1s or 2s, also 22xx motor would not bring the problem.

@sskaug
Copy link
Collaborator

sskaug commented Sep 30, 2015

I am not quite sure I understand what you mean here. Which resistor are you changing? Pin19 is the bemf sensing common node, as far as I can see.
If this is the node, there is nothing the code can do, as a comparator is used to read the node, and not the ADC.

@meleeshop
Copy link
Author

the pin19 connected with 4 resistor, 3x 5.1k resistor, and the 5.1k connected with motor wire A,B,C. there is also a 330r resistor connect to the pin19 and GND. when i change the 330r resistor with 334r, the motor will start much more gently. that's means more volt must be add to the pin19 from the node.

@sskaug
Copy link
Collaborator

sskaug commented Oct 1, 2015

This is probably because the other bemf sensing inputs use 1k/5.1k dividers. While the common branch has 330/(3x5.1k) divider. And then, ideally, the 330 ohm should be 333.33 ohm.
Anyway, nothing to do with this in the code, as said it is read by a comparator, not an ADC.
Of course the code can always be better in dealing with such offsets, but that's a challenging task :).

@sskaug sskaug closed this as completed Oct 6, 2015
saidinesh5 added a commit to saidinesh5/BLHeli that referenced this issue Dec 24, 2020
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants