HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Oct 03, 2014, 12:28 AM
Registered User
Joined Mar 2005
4 Posts
Help!
How to Setup Simonk inc file

Dear All,

I home made a esc circuit for simonk and follow bs, but change to all N-Fet.

Attachment is my circuit file. and below is my current .inc config file.

The problem is ESC can listen RC PWM, but motor will shaking after pull up thro channel.

Is my .inc file not correct ?

;=================inc file start==============================
;* Fuses should be set to -U lfuse:w:0x2e:m -U hfuse:w:0xcf:m *

.equ F_CPU = 16000000
.equ USE_INT0 = 1
.equ USE_I2C = 0 ; We could, but FETs are on the I2C ports
.equ USE_UART = 0
.equ USE_ICP = 0

.equ DEAD_LOW_NS = 300
.equ DEAD_HIGH_NS = 300

;*********************
; PORT D definitions *
;*********************
;.equ = 7
;.equ = 6
.equ CnFET = 5
.equ CpFET = 4
;.equ = 3
.equ rcp_in = 2

.equ INIT_PD = (1<<CpFET)
.equ DIR_PD = (1<<CnFET)+(1<<CpFET)

.equ CnFET_port = PORTD
.equ CpFET_port = PORTD

;*********************
; PORT C definitions *
;*********************
.equ mux_b = 7 ; ADC7
.equ mux_c = 6 ; ADC6
.equ BpFET = 5
.equ BnFET = 4
.equ ApFET = 3
;.equ mux_voltage = 2 ; ADC2 voltage input (220k from Vbat, 51k to gnd, 10.10V -> 1.900V at ADC2)
;.equ mux_temperature = 1 ; ADC1 temperature input (some boards) (10k NTC to 5V, 820 to gnd)
.equ mux_a = 0 ; ADC0

.equ O_POWER = 220
.equ O_GROUND = 51

.equ INIT_PC = (1<<BpFET)+(1<<ApFET)
.equ DIR_PC = (1<<BnFET)+(1<<BpFET)+(1<<ApFET)

.equ BpFET_port = PORTC
.equ BnFET_port = PORTC
.equ ApFET_port = PORTC

;*********************
; PORT B definitions *
;*********************
;.equ = 7
;.equ = 6
;.equ = 5 (sck stk200 interface)
;.equ = 4 (miso stk200 interface)
;.equ = 3 (mosi stk200 interface)
.equ GND_PIN = 2 ; Seems to be grounded on this board
;.equ = 1
.equ AnFET = 0

.equ INIT_PB = 0
.equ DIR_PB = (1<<AnFET)

.equ AnFET_port = PORTB

.MACRO RED_on
.ENDMACRO
.MACRO RED_off
.ENDMACRO
.MACRO GRN_on
.ENDMACRO
.MACRO GRN_off
.ENDMACRO
;==================.inc file end=============================
kisnoge is offline Find More Posts by kisnoge
Reply With Quote
Sign up now
to remove ads between posts
Old Oct 06, 2014, 12:38 AM
hacker
Canada, BC, North Vancouver
Joined Dec 2010
936 Posts
Hello!

Shaking is most likely swapped FETs or sense lines. It might help to just look at the output voltages on a scope to confirm that each phase looks the same as the rest, and that you aren't missing a high or low somewhere.

The INIT_P* definitions have a special purpose of supporting inverted drive. Any FET pin listed in an INIT_* definition will be initialized to HIGH (as is probably obvious), but the rest of the code will see this and also drive it that way (by setting it LOW to turn the FET on). Make sure that is right.

I can't really read your PNG since the resolution is too small, but it looks like you have that set correctly. I'd maybe try swapping around the sense pins.
simonk is offline Find More Posts by simonk
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion Need help finding simonk hex files for download Brian Courtice Multirotor Talk 0 Aug 01, 2014 11:29 AM
For Sale 2S Power Setup - Tiger MT1306 - 12a SimonK ESC - 2s Lipos ummagawd Aircraft - Electric - Multirotor (FS/W) 1 Jun 01, 2014 10:33 PM
Discussion Simonk file for Blueseries 20A Harry_RC Multirotor Electronics 2 May 29, 2014 10:16 AM
Discussion WKM how to Export files FLY...in KML ? pepere Multirotor Electronics 0 Jan 17, 2014 12:10 PM
Question how do i scale pdf files to small sizes rcniteshrc The Builders Workshop 2 Oct 13, 2013 04:36 AM