|
I've spent a bit of time looking at the code manuLRK posted earlier in the thread (here) regarding improved ESC PWM rates (>450Hz) and, after a day or so fiddling, I have incorporated this into XXcontroller code.
Theoretical maximum ESC rate is 497Hz, but probably less, as there are a few tens of micro-seconds's lost along the way.
Actually, I have noticed that the internal Xtal isn't very accurate, so results may vary a surprising amount.
Since this is a significant change, release is now V1.1
Things to note
There are 2 pairs of defines, ESC_RATE and PWM_LOW_PULSE_INTERVAL which allow you to set PWM rate.
One pair you set ESC_RATE and it calculates PWM_LOW_PULSE_INTERVAL, the other pair vice-versa.
PWM_LOW_PULSE_INTERVAL is measured in 10's of microSeconds (minimum 1)
Stick-arming is now standard feature
new define for Stick-arm side (for those non-standard folks out there )
When the controller is not armed, no signal is sent to ESC's, so they will bleep.
I actually quite like this (others may not) as led isn't always easy to see.
Some ESC's are a bit fussy, and you may need to re-arm to get them to sync/start correctly.
Sensor calibration now takes place @ arming.
also, gyro gain pots are read @ arming, so if you change them, you must re-arm for the changes to be used
As a general note, the code (V1.1) is time critical.
Essentially, the program expects certain sections of the code to take a short period of time.
What this means is that if you modify the code, you must avoid putting any long delay(s) (>200uS - yes, thats long!) in the code which gets executed when armed.
Failure to follow this guidline will cause motors to mis-behave.
I have flown @ 450Hz with my big Quad (config) and am suitably impressed.
I havn't checked the results on TRI copter tho'
I also havn't put this on my test-bench to check PWM consistency.
and finally, thanks to manuLRK !
这个是kk官网的,好像说电调刷新率越高越好? |
|