sim- / tgy

tgy -- Open Source Firmware for ATmega-based Brushless ESCs
http://0x.ca/tgy/
685 stars 388 forks source link

Odd relationship between PWM command and measured voltage duty cycle #101

Closed maxikrie closed 8 years ago

maxikrie commented 8 years ago

Dear Simon,

I am observing a strange relationship between duty cycle (percentage of applied voltage) and PWM command. I am expecting that a PWM command of 125 us maps to 0 % and 250 us maps to 100 % of the applied voltage. However, I am measuring what you see in the figure as blue dots (the green line being a fitting through the measurements, and the red line what I expect).

figure_1

I am using a dys ESC in oneshot mode with the following custom settings

;** ; Custom settings * ;** .equ COMP_PWM = 1 ; During PWM off, switch high side on (unsafe on some boards!)

.equ MOTOR_ADVANCE = 8 ; Degrees of timing advance (0 - 30, 30 meaning no delay)

.equ MOTOR_BRAKE = 1 ; Enable brake during neutral/idle ("motor drag" brake)

.equ RC_PULS_REVERSE = 0 ; Enable RC-car style forward/reverse throttle

.equ STOP_RC_PULS = 1000 ; Stop motor at or below this pulse leng .equ FULL_RC_PULS = 2000 ; Full speed at or above this pulse length

.equ RCP_DEADBAND = 20 ; Do not start until this much above or below neutral

.equ BRAKE_SPEED = 6 ; Speed to reach MAX_POWER, 0 (slowest) - 8 (fastest)

Thanks, Max

maxikrie commented 8 years ago

I just realized that there is already an open thread to this issue.