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

"Phase Locked" Waveform: fix significant jitter, that stresses servos and is clearly audible in Tone output #7022

Merged
merged 153 commits into from
Nov 19, 2020

Commits on Nov 14, 2020

  1. Allow 100% high or low periods.

    Let output remain at current level on stopping instead of always turning to low.
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    3f36f6f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ee3ca86 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    233e5f1 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c462fe0 View commit details
    Browse the repository at this point in the history
  5. Guard for zero period length undefined waveforms.

    Fix for zero duty or off cycles and expiring from them.
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    a97f247 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    a2c7125 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    b2e9ad7 View commit details
    Browse the repository at this point in the history
  8. Important comment

    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    6eb28d3 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    da049c1 View commit details
    Browse the repository at this point in the history
  10. Use plural for bit arrays.

    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    1178268 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    3fbaaa8 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    01c5f7a View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    b255655 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    7b99b85 View commit details
    Browse the repository at this point in the history
  15. Rewrite to keep phase in sync if period remains same during duty cycl…

    …e change.
    
    Refactor identifies to distinguish CPU clock cycle from waveform cycle.
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    22556f0 View commit details
    Browse the repository at this point in the history
  16. Rather iterate even if full-duty or no-duty cycle in period, than too…

    … many calculations in NMI handler.
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    0f4486b View commit details
    Browse the repository at this point in the history
  17. Must fire timer early to reach waveform deadlines, otherwise under so…

    …me load aggressive jitter occurs.
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    37b0685 View commit details
    Browse the repository at this point in the history
  18. Schedule expiry explicitly, too.

    Needed to keep track of next timer ccy in each iteration, not just when changing level.
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    0a2415d View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    b595e49 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    e0d9a48 View commit details
    Browse the repository at this point in the history
  21. Improve phase timing

    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    bb04a02 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    8c646f3 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    8ab9975 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    acd0dcd View commit details
    Browse the repository at this point in the history
  25. Lead time improved for ISR

    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    87b71c2 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    2bae205 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    deaf2ec View commit details
    Browse the repository at this point in the history
  28. Simplify calculation.

    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    d8e330e View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    da933fd View commit details
    Browse the repository at this point in the history
  30. Misleading code, there must ever be only one bit set at a time, start…

    … and stop block until the ISR has handled and reset the token.
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    6c7346a View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    f6fbf80 View commit details
    Browse the repository at this point in the history
  32. Continuously remove distant pending waveform edges from the loop, con…

    …tinuously update now.
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    745c1b2 View commit details
    Browse the repository at this point in the history
  33. Configuration menu
    Copy the full SHA
    b877047 View commit details
    Browse the repository at this point in the history
  34. Configuration menu
    Copy the full SHA
    42983a9 View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    6aea9d6 View commit details
    Browse the repository at this point in the history
  36. Configuration menu
    Copy the full SHA
    9245e19 View commit details
    Browse the repository at this point in the history
  37. Configuration menu
    Copy the full SHA
    42a065d View commit details
    Browse the repository at this point in the history
  38. Configuration menu
    Copy the full SHA
    02e5233 View commit details
    Browse the repository at this point in the history
  39. Configuration menu
    Copy the full SHA
    b68d3cb View commit details
    Browse the repository at this point in the history
  40. Restructured code in ISR for expiration, this saves 36 byte IRAM, and…

    … improves PWM resolution.
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    2bc599f View commit details
    Browse the repository at this point in the history
  41. Configuration menu
    Copy the full SHA
    aab4a49 View commit details
    Browse the repository at this point in the history
  42. Configuration menu
    Copy the full SHA
    5a91f9f View commit details
    Browse the repository at this point in the history
  43. Stabilized timings.

    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    6395373 View commit details
    Browse the repository at this point in the history
  44. Prevent WDT under load.

    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    4984f49 View commit details
    Browse the repository at this point in the history
  45. Configuration menu
    Copy the full SHA
    eb28b27 View commit details
    Browse the repository at this point in the history
  46. Configuration menu
    Copy the full SHA
    3155888 View commit details
    Browse the repository at this point in the history
  47. Optimize in-ISR time.

    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    6c43c0d View commit details
    Browse the repository at this point in the history
  48. Configuration menu
    Copy the full SHA
    14444a9 View commit details
    Browse the repository at this point in the history
  49. Configuration menu
    Copy the full SHA
    48f6d85 View commit details
    Browse the repository at this point in the history
  50. Configuration menu
    Copy the full SHA
    ac832a7 View commit details
    Browse the repository at this point in the history
  51. Configuration menu
    Copy the full SHA
    94626e8 View commit details
    Browse the repository at this point in the history
  52. Configuration menu
    Copy the full SHA
    ef5fdd0 View commit details
    Browse the repository at this point in the history
  53. Eschew obfuscation.

    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    59d788b View commit details
    Browse the repository at this point in the history
  54. Configuration menu
    Copy the full SHA
    1057256 View commit details
    Browse the repository at this point in the history
  55. Determine generator quantum during same IRQ - this is better than tim…

    …er resolution, but non-zero.
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    3d99249 View commit details
    Browse the repository at this point in the history
  56. Configuration menu
    Copy the full SHA
    d92a737 View commit details
    Browse the repository at this point in the history
  57. Configuration menu
    Copy the full SHA
    560cca7 View commit details
    Browse the repository at this point in the history
  58. Can do 60kHz PWM.

    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    c75d1bd View commit details
    Browse the repository at this point in the history
  59. Recalibrated timings after performance optimizations.

    Initialize GPIO if needed.
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    a2222e8 View commit details
    Browse the repository at this point in the history
  60. Configuration menu
    Copy the full SHA
    6ab789c View commit details
    Browse the repository at this point in the history
  61. Configuration menu
    Copy the full SHA
    ac21bca View commit details
    Browse the repository at this point in the history
  62. Performance tuning.

    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    7a4bb61 View commit details
    Browse the repository at this point in the history
  63. Configuration menu
    Copy the full SHA
    ba47d27 View commit details
    Browse the repository at this point in the history
  64. Configuration menu
    Copy the full SHA
    1c4de11 View commit details
    Browse the repository at this point in the history
  65. Configuration menu
    Copy the full SHA
    a9565b2 View commit details
    Browse the repository at this point in the history
  66. Configuration menu
    Copy the full SHA
    a3c0dfe View commit details
    Browse the repository at this point in the history
  67. Waveform stopped by runtime limit in iSR doesn't deinit the timer, bu…

    …t stopWaveform refuses
    
    to do anything if the waveform was stopped by runtime, either.
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    bd0fea0 View commit details
    Browse the repository at this point in the history
  68. Configuration menu
    Copy the full SHA
    9f5743c View commit details
    Browse the repository at this point in the history
  69. Configuration menu
    Copy the full SHA
    9d29fc2 View commit details
    Browse the repository at this point in the history
  70. Configuration menu
    Copy the full SHA
    244153e View commit details
    Browse the repository at this point in the history
  71. Configuration menu
    Copy the full SHA
    e149284 View commit details
    Browse the repository at this point in the history
  72. Configuration menu
    Copy the full SHA
    ab70633 View commit details
    Browse the repository at this point in the history
  73. Configuration menu
    Copy the full SHA
    4ba59dc View commit details
    Browse the repository at this point in the history
  74. Configuration menu
    Copy the full SHA
    a3bf761 View commit details
    Browse the repository at this point in the history
  75. Configuration menu
    Copy the full SHA
    e2fe477 View commit details
    Browse the repository at this point in the history
  76. Configuration menu
    Copy the full SHA
    3286bf7 View commit details
    Browse the repository at this point in the history
  77. Configuration menu
    Copy the full SHA
    237bdfd View commit details
    Browse the repository at this point in the history
  78. Configuration menu
    Copy the full SHA
    6e352ea View commit details
    Browse the repository at this point in the history
  79. Configuration menu
    Copy the full SHA
    5b6be8b View commit details
    Browse the repository at this point in the history
  80. Configuration menu
    Copy the full SHA
    25dbff5 View commit details
    Browse the repository at this point in the history
  81. Configuration menu
    Copy the full SHA
    9f79f43 View commit details
    Browse the repository at this point in the history
  82. Configuration menu
    Copy the full SHA
    936985e View commit details
    Browse the repository at this point in the history
  83. Configuration menu
    Copy the full SHA
    5fc33d0 View commit details
    Browse the repository at this point in the history
  84. Move updating "now" out of inner loop, prevents float between pins th…

    …at are in phase lock.
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    a235066 View commit details
    Browse the repository at this point in the history
  85. Configuration menu
    Copy the full SHA
    b0bf144 View commit details
    Browse the repository at this point in the history
  86. Configuration menu
    Copy the full SHA
    948601c View commit details
    Browse the repository at this point in the history
  87. Configuration menu
    Copy the full SHA
    9445755 View commit details
    Browse the repository at this point in the history
  88. Configuration menu
    Copy the full SHA
    0ec53e4 View commit details
    Browse the repository at this point in the history
  89. Frequency scaling is only for PWM-like applications, anything needing…

    … real time duty cycles or frequency must be able to fail on overload.
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    1d0f914 View commit details
    Browse the repository at this point in the history
  90. Configuration menu
    Copy the full SHA
    f8e07f5 View commit details
    Browse the repository at this point in the history
  91. Directly scale frequency for all duty/all idle waves to reasonable ma…

    …ximum, reduces thrashing.
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    ea01c25 View commit details
    Browse the repository at this point in the history
  92. Configuration menu
    Copy the full SHA
    d17a7b9 View commit details
    Browse the repository at this point in the history
  93. Configuration menu
    Copy the full SHA
    2ff07a1 View commit details
    Browse the repository at this point in the history
  94. AutoPwm correction moved to correct location - after overshoot recalc…

    … - and allow limited duty floating
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    a07f12c View commit details
    Browse the repository at this point in the history
  95. Finish overshoot math fixes.

    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    d0a79d6 View commit details
    Browse the repository at this point in the history
  96. Configuration menu
    Copy the full SHA
    2360dfe View commit details
    Browse the repository at this point in the history
  97. Simplify calculations, fix non-autoPwm for servo use, where exact dut…

    …y is needed, idle is elastic.
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    9d6130c View commit details
    Browse the repository at this point in the history
  98. Configuration menu
    Copy the full SHA
    c8f300f View commit details
    Browse the repository at this point in the history
  99. Some optimizing.

    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    7565dc2 View commit details
    Browse the repository at this point in the history
  100. Configuration menu
    Copy the full SHA
    e0fbc99 View commit details
    Browse the repository at this point in the history
  101. Finally get rid of volatile and use atomic thread fence memory barrie…

    …rs, great for ISR performance.
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    742199f View commit details
    Browse the repository at this point in the history
  102. Configuration menu
    Copy the full SHA
    ee69ab9 View commit details
    Browse the repository at this point in the history
  103. Improved duty cycle overshoot mitigation.

    Case for investigation: 3% (shl 5) vs. 1.5% (shl 6), either less fuzz, but a few marked stray spots, or more fuzz, but no bumps in counter-PWM travel test.
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    e8d25b0 View commit details
    Browse the repository at this point in the history
  104. Configuration menu
    Copy the full SHA
    916db2e View commit details
    Browse the repository at this point in the history
  105. Configuration menu
    Copy the full SHA
    864a2bf View commit details
    Browse the repository at this point in the history
  106. Configuration menu
    Copy the full SHA
    b0682a9 View commit details
    Browse the repository at this point in the history
  107. CPU clock to Timer1 ccy correction must be dynamic even when BSP is c…

    …ompiled for fixed CPU clock.
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    4af8505 View commit details
    Browse the repository at this point in the history
  108. Corrected use of Timer1 registers and add rationale to Timer1 use in …

    …comment.
    
    Recalibrate for improved frequence downscaling @ 80MHz and 160MHz.
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    b861742 View commit details
    Browse the repository at this point in the history
  109. Let duty cycle overshoot correction depend on relative impact compare…

    …ed to both period and duty.
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    04ab1e0 View commit details
    Browse the repository at this point in the history
  110. 80MHz/160MHz specific code can be compile-time selected in general, o…

    …nly NMI is affected by
    
    apparent CPU frequency scaling in SDK code.
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    60a09e4 View commit details
    Browse the repository at this point in the history
  111. Seems that removing the redudant resetting of edge interrupt mode sha…

    …ves 0.5us off rearm latency.
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    4e50fbc View commit details
    Browse the repository at this point in the history
  112. Recalibrated delta irq ccys.

    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    9d86859 View commit details
    Browse the repository at this point in the history
  113. Configuration menu
    Copy the full SHA
    6fe4732 View commit details
    Browse the repository at this point in the history
  114. Simple register writes.

    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    6885337 View commit details
    Browse the repository at this point in the history
  115. Memory fences checked and joining events into same loop iteration tha…

    …t are close to one another.
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    41f6bb5 View commit details
    Browse the repository at this point in the history
  116. Configuration menu
    Copy the full SHA
    89dd855 View commit details
    Browse the repository at this point in the history
  117. Code simplifications.

    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    86afd50 View commit details
    Browse the repository at this point in the history
  118. Dynamically map pins out from in-ISR handling based on next event tim…

    …ing.
    
    Major performance boost.
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    b707020 View commit details
    Browse the repository at this point in the history
  119. Configuration menu
    Copy the full SHA
    e71d86f View commit details
    Browse the repository at this point in the history
  120. Revert recent change that is the most likely cause of reported PWM fr…

    …equency drop regression.
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    6855ad1 View commit details
    Browse the repository at this point in the history
  121. Configuration menu
    Copy the full SHA
    ddecf8a View commit details
    Browse the repository at this point in the history
  122. Configuration menu
    Copy the full SHA
    111583b View commit details
    Browse the repository at this point in the history
  123. Configuration menu
    Copy the full SHA
    aa18a70 View commit details
    Browse the repository at this point in the history
  124. Configuration menu
    Copy the full SHA
    b43d4b0 View commit details
    Browse the repository at this point in the history
  125. Event timestamps are all recorded for compile-time CPU frequency, the…

    … timer ticks conversion
    
    must be set at compile-time also. The SDK WiFi 160MHz boost mitigation temporarily handles
    the CPU clock running twice as fast.
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    e978ac4 View commit details
    Browse the repository at this point in the history
  126. Configuration menu
    Copy the full SHA
    3b18d51 View commit details
    Browse the repository at this point in the history
  127. Configuration menu
    Copy the full SHA
    b45a2d2 View commit details
    Browse the repository at this point in the history
  128. Save a few bytes code.

    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    784692b View commit details
    Browse the repository at this point in the history
  129. Configuration menu
    Copy the full SHA
    2d591eb View commit details
    Browse the repository at this point in the history
  130. Reduce memory use.

    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    dd10064 View commit details
    Browse the repository at this point in the history
  131. SDK boost to 160MHz may last across multiple ISR invocations, therefo…

    …re adjust target ccy instead of ccount.
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    557f356 View commit details
    Browse the repository at this point in the history
  132. Configuration menu
    Copy the full SHA
    2e1ecc7 View commit details
    Browse the repository at this point in the history
  133. New PWM overshoot mitigation code keeps frequency. Averages duty betw…

    …een consecutive periods.
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    b7f1b95 View commit details
    Browse the repository at this point in the history
  134. Configuration menu
    Copy the full SHA
    05307a1 View commit details
    Browse the repository at this point in the history
  135. Configuration menu
    Copy the full SHA
    83c6b67 View commit details
    Browse the repository at this point in the history
  136. Configuration menu
    Copy the full SHA
    5165ba2 View commit details
    Browse the repository at this point in the history
  137. Configuration menu
    Copy the full SHA
    12e4755 View commit details
    Browse the repository at this point in the history
  138. Break out of ISR if timespan to next event allows, instead of busy wa…

    …iting and stealing CPU cycles from userland.
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    16956e9 View commit details
    Browse the repository at this point in the history
  139. Minor code simplification.

    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    7646984 View commit details
    Browse the repository at this point in the history
  140. Improve code efficiency.

    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    ab1b4c1 View commit details
    Browse the repository at this point in the history
  141. Improved performance of loop.

    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    3d8865d View commit details
    Browse the repository at this point in the history
  142. Recalibrated.

    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    60bfa92 View commit details
    Browse the repository at this point in the history
  143. No positive effect of lead time inclusion was found during testing, r…

    …emove this code.
    
    Maximum period duration limit is implicit to timer, consider it documented constraint, don't runtime
    check in ISR.
    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    b78329b View commit details
    Browse the repository at this point in the history
  144. Configuration menu
    Copy the full SHA
    f2dc71b View commit details
    Browse the repository at this point in the history
  145. Configuration menu
    Copy the full SHA
    7e247c2 View commit details
    Browse the repository at this point in the history
  146. Configuration menu
    Copy the full SHA
    440c444 View commit details
    Browse the repository at this point in the history
  147. Configuration menu
    Copy the full SHA
    610fe5a View commit details
    Browse the repository at this point in the history
  148. Configuration menu
    Copy the full SHA
    0f1c423 View commit details
    Browse the repository at this point in the history
  149. Configuration menu
    Copy the full SHA
    59d3143 View commit details
    Browse the repository at this point in the history
  150. Configuration menu
    Copy the full SHA
    bc7d279 View commit details
    Browse the repository at this point in the history
  151. Configuration menu
    Copy the full SHA
    12a4c65 View commit details
    Browse the repository at this point in the history
  152. Remove _toneMap from Tone.cpp

    dok-net committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    e4892fa View commit details
    Browse the repository at this point in the history

Commits on Nov 19, 2020

  1. Configuration menu
    Copy the full SHA
    31ebfa7 View commit details
    Browse the repository at this point in the history