logo elektroda
logo elektroda
X
logo elektroda

Fast Division and Square Root Algorithms for AVR 8 Bit Flight Control Applications

42 12
ADVERTISEMENT
  • #1 21657643
    Edward Henderson
    Anonymous  
  • ADVERTISEMENT
  • #2 21657644
    Joe Wolin
    Anonymous  
  • #3 21657645
    Edward Henderson
    Anonymous  
  • ADVERTISEMENT
  • #4 21657646
    Joe Wolin
    Anonymous  
  • #5 21657647
    Randy Dawson
    Anonymous  
  • ADVERTISEMENT
  • #7 21657649
    Bill Westfield
    Anonymous  
  • #8 21657650
    Gary Crowell
    Anonymous  
  • ADVERTISEMENT
  • #11 21657653
    Per Zackrisson
    Anonymous  
  • #12 21657654
    Ralph Pruitt
    Anonymous  
  • #13 21657655
    Todd Hayden
    Anonymous  

Topic summary

The discussion addresses efficient implementation of division and square root operations on AVR 8-bit microcontrollers for flight control systems in RC aircraft and UAVs. AVR devices feature an 8-bit hardware multiply instruction but lack hardware divide and square root operations, with floating-point divide (__divsf3) and sqrt functions in avr-libc being computationally expensive (e.g., 465 clock cycles at 20 MHz). To optimize performance, fixed-point arithmetic libraries such as AVRfix and custom 16-bit fixed-point routines (e.g., 8:8 format) are recommended, offering faster multiply (~40 cycles) and divide (~360 cycles) operations. Approaches to reduce computational load include using Taylor series expansions for transcendental functions (sin, cos) at small angles, lookup tables for precomputed values, and piecewise linear approximations to balance memory usage and speed. The tradeoff between precision, speed, and memory footprint is emphasized, with suggestions to tailor resolution to application needs. References include the HACKMEM paper for mathematical algorithms and resources with example code for fixed-point reciprocal and square root implementations on AVR Mega644.
Summary generated by the language model.
ADVERTISEMENT