diff --git a/FlashV2.bat b/FlashV2.bat index 443b382..452da3f 100644 --- a/FlashV2.bat +++ b/FlashV2.bat @@ -5,7 +5,7 @@ set flasher="%ProgramFiles(x86)%\STMicroelectronics\STM32 ST-LINK Utility\ST-LIN :flash set filename=%1% -if "%filename%" == "" set filename=out\STM32Gimbal.bin +if "%filename%" == "" set filename=out\STM32Gimbal.USB.bin %flasher% -c SWD -P %filename% 0x08004000 -V -Rst pause \ No newline at end of file diff --git a/GUI/EvvGC_GUI_v0_4/EvvGC_GUI_v0_4.zip b/GUI/EvvGC_GUI_v0_4/EvvGC_GUI_v0_4.zip new file mode 100644 index 0000000..db9066e Binary files /dev/null and b/GUI/EvvGC_GUI_v0_4/EvvGC_GUI_v0_4.zip differ diff --git a/Makefile b/Makefile index 740d418..bd74077 100644 --- a/Makefile +++ b/Makefile @@ -65,7 +65,7 @@ LIB_DIRS = # libraries (additional libraries for linking, e.g. "-lm -lsome_name" to link # math library libm.a and libsome_name.a) -LIBS = +LIBS = -lm # additional directories with source files (absolute or relative paths to # folders with source files, current folder is always included) @@ -152,13 +152,13 @@ C_FLAGS += -fsingle-precision-constant AS_FLAGS = -Wa,-amhls=$(OUT_DIR_F)$(notdir $(<:.$(AS_EXT)=.lst)) # flags for linker -LD_FLAGS = -T$(LD_SCRIPT) -g -Wl,-Map=$(OUT_DIR_F)$(PROJECT).map,--cref,--no-warn-mismatch -LD_USB_FLAGS = -T$(LD_USB_SCRIPT) -g -Wl,-Map=$(OUT_DIR_F)$(PROJECT_USB).map,--cref,--no-warn-mismatch +LD_FLAGS = -T$(LD_SCRIPT) -Wl,-Map=$(OUT_DIR_F)$(PROJECT).map,--cref,--no-warn-mismatch +LD_USB_FLAGS = -T$(LD_USB_SCRIPT) -Wl,-Map=$(OUT_DIR_F)$(PROJECT_USB).map,--cref,--no-warn-mismatch # process option for removing unused code ifeq ($(REMOVE_UNUSED), 1) - LD_FLAGS += -Wl,--gc-sections - LD_USB_FLAGS += -Wl,--gc-sections + LD_FLAGS += -Xlinker --gc-sections + LD_USB_FLAGS += -Xlinker --gc-sections OPTIMIZATION += -ffunction-sections -fdata-sections endif diff --git a/built-versions/0.4/STM32Gimbal.USB.bin b/built-versions/0.4/STM32Gimbal.USB.bin index b35a3bf..3546bd2 100644 Binary files a/built-versions/0.4/STM32Gimbal.USB.bin and b/built-versions/0.4/STM32Gimbal.USB.bin differ diff --git a/built-versions/0.4/STM32Gimbal.bin b/built-versions/0.4/STM32Gimbal.bin index 1bb8570..41b5054 100644 Binary files a/built-versions/0.4/STM32Gimbal.bin and b/built-versions/0.4/STM32Gimbal.bin differ diff --git a/built-versions/0.4/STM32Gimbal.hex b/built-versions/0.4/STM32Gimbal.hex index 1f57d0c..f9a1823 100644 --- a/built-versions/0.4/STM32Gimbal.hex +++ b/built-versions/0.4/STM32Gimbal.hex @@ -754,9 +754,9 @@ :102EF80000232B6013601D46174C00212068C4F284 :102F08001C21FDF745FF2946FDF73AFE0021C4F2D2 :102F18002021FDF7F1FF0346014623603846FDF7FF -:102F28002DFEF8BD46F266612046C3F6E6614FF015 +:102F28002DFEF8BD4CF6CD412046C3F60C714FF08E :102F380040442C60FDF72CFF054606480560DBE79A -:102F480046F266612046C3F6E6614FF08044F0E73A +:102F48004CF6CD412046C3F60C714FF08044F0E7B3 :102F5800C8090020140A0020F40900202DE9F04FC8 :102F6800DFF89C9299B0D9F800308346581CC9F80C :102F7800000002F097FF02F0B9FF16A802F08CFCDF @@ -3561,7 +3561,7 @@ :10DE68007669636553746174652025336420205690 :10DE78004350436F6E6E6563744D6F64652025640F :10DE88000D0A000056657273696F6E3A2025730D8E -:10DE98000A000000302E342E352E3100746573745C +:10DE98000A000000302E342E352E3200746573745B :10DEA800207068617365206F7574707574202535EE :10DEB8002E31660D0A0000000D0A636F6E666967F1 :10DEC80020646174613A2000202530325820000017 @@ -3623,8 +3623,8 @@ :10E2480068207265766973696F6E203230323630B5 :10E25800315D0D0A00000000457676474320666967 :10E26800726D77617265205625732C206275696C12 -:10E27800642064617465204E6F7620313620323018 -:10E2880031332030383A31353A3132200D0A000026 +:10E278006420646174652044656320313420323041 +:10E2880031332031303A30373A3037200D0A000028 :10E2980072756E6E696E67206F6E20657874657230 :10E2A8006E616C2048534520636C6F636B2C206350 :10E2B8006C6F636B20726174652069732025644DEF @@ -3759,8 +3759,8 @@ :08EAC8003CBF737FDD4F1575A3 :08EAD0003027FF7F0100000068 :10EAD8000204060800000000010203040102030406 -:10EAE80006070809FFFFFFFF3132336162633334E1 -:10EAF80035303136EC51B8BD50000000010000003F +:10EAE80006070809FFFFFFFF28553C1E3728233774 +:10EAF8003C303040EC51B8BD50000000010000002F :10EB0800C80000000000000000000000010203042B :10EB18000607080900A24A04480000001A03530027 :10EB280054004D00330032000000000000000000D7 diff --git a/built-versions/0.4/STM32Gimbal.zip b/built-versions/0.4/STM32Gimbal.zip index 1be0d8e..f95028b 100644 Binary files a/built-versions/0.4/STM32Gimbal.zip and b/built-versions/0.4/STM32Gimbal.zip differ diff --git a/history.md b/history.md index 0352a92..a0b78f2 100755 --- a/history.md +++ b/history.md @@ -1,227 +1,231 @@ -# History # - -20130629 - - initial commit (derived from FW03preB) - - - to build under eclipse, you'll need the gnu toolchain from - https://launchpad.net/gcc-arm-embedded - - I borrowed a setup documnent from the AQ32PLUS software, you'll have to translate a little bit from it. - it's in the Documentation folder - - while the eclipsesetup document in the Documents directory talks about installing the Code Sourcery - toolchain, ignore that and use the above. Follow the rest of the document however. - - where it talks about importing a .cproject file, use the one in the setup folder called .cproject.orig - -20130629 - - added USB libaries and stubbed in the VCP code (NOT FUNCTIONAL) - -20130629 - - added newlib_stubs.c - these are the stub routines that should allow the uarts to function like - consoles with limited input/output features like printf, etc. - -20130711 - - updated the CMSIS library to the latest version from ARM (3.2) - updated setup/.cproject.orig, confirmed build - -20130712 - - updated with latest sources from evvaldis, builds ok, still untested - -20130712 - - added the original sources for 0.3b and 0.3e (latest as of this date) - -20130716 - - updated with new sprintf_ that is much smaller than original, changed Release build to optimize for size - added the USB FS Driver (none of the USB drivers are currently used - -20130716 - - updated the import .cproject.orig in the setup directory to remove Release optimizations - -20130718 - - updated with the EvvGC 0.3g sources, built but not tested - -20130721 - - added a minimal set of bin utililies in the setup/minutils.zip file. - copy these files (rm.exe, cs-rm.exe, make.exe and cs-make.exe to the same location - as the bin utilities for the compiler that you installed.) - -20130801 - - replaced system_stmf10x.c with 3.6.1 version - -20130808 major code rework by ala42 - - added Makefile, modified a Makefile that was posted previously in a source code package - - added message printouts during startup, so you can see what is going on - - made variable 'stop' volatile - Previously while (stop == 0) {} was an endless loop due to compiler optimisation - - added interrupt driven serial I/O using ring buffer - - AUX3/4 handling - - changed resolution of timer3 from 10µs to 1µs - - made variables used for reading AUX3/AUX4 static instead of global - - added access functions GetAUX3()/GetAUX4() returning pulse length from 0-999µs - - disabled JTAG to make PB3 connected to AUX3 usable at all, AUX3 is not used in the code, yet - - fixed variable types of counter helper variables like rc3a from int to unsigned short - - changed max counter value from 60000 to 65535, as arithmetics in the arithmetic ring - of the 16-bit counter does not work otherwise. - - - made several variables in engine.c local/static - - moved several global variable declarations to the files where they belong to - - added a constrain function to make the code more readable - - fixed the usage of the AUX4 value so the sinus array is accessed correctly - - fixed gyro resolution from 8000 to 8192 and made some cleanup in gyro.c - - - changed main loop timing from timer2 interrupt flag to direct timing reads - - - moved command handling from interrupt handler to main loop - - cleaned up command handling - - added '+', '-' commands for testing PWM outputs - - added 'd' command to enable debug print messages - - added 'G' command to print config values - - - removed motor off during config loop as config is atomic now - - removed variable stop - - renamed TimerOff to PWMOff - - - ReadFromEEPROM returns an error checked by configLoad() now, if eeprom is not available - - MPU6050_Init returns an error now, added retries - - relaxed watchdog timing, before the watchdog could trigger during gyro calibration - - - fixed several major problems in the dead time handling of TIM4 and TIM5 - - TIM5 active time was reduced by 70 18MHz ticks, had to be 80 to match the dead time of TIM1/8 - - TIM4 active time was not reduced at all by the dead time - - delay between TIM4 and TIM5 was made with a delay loop when enabling the timer. Now the - counter start value is set to the wanted delay. Old delay was 0.8µs instead of 4.4µs. - - inverted and swapped TIM4+5, as YawX and YawXN were swapped and did not match the Roll/Pitch waveform - - PWM width is changed syncronously now in interrupt handlers - This bug caused dead time violations/shortcuts on TIM4/5 before when PWM width change was large - - activated compare preload mode, so PWM cycles are no longer interrupted when changing the PWM width - This bug caused bad frequency and shortcuts on TIM4/5 before when PWM width change was large - - changed BTDR initialisation order for TIM1/8 to remove startup glitch - - simplyfied timer setup - - - moved rc code from main.c and timer.c to rc.c - - moved PWM code from timer.c to pwm.c - - moved and simplyfied PWM code from engine.c to pwm.c - - removed timer.c - -20130810 some fixes by ala42 - - fixed bug in ringbuffer handling - - fixed problem in micros() - - added 64MHz clock setup in case external oscilator fails - - added callback for systick irq - - removed TIM2 usage - - Performance - - added performance messages, online selectable with 'p' - - changed atan2(double) to atan2f(float), which saves ~60µs - - changed SetPWM to use sinus table and fix point calculation, which saves ~550µs/loop - - current loop time is ~660µs - -20130813 - - increased the I2C delay to be on the safe side - - revised gyro convertion to use gyroScaleFactor and corrected the math and value - to match the actual gyro setup - -20130819 - PWM handling - - added profiling to measure when and how often the CCR registers are changed - Log message is toggled with 'c'. - - fixed bug causing yaw channel update every cycle without any need - This bug just wasted time. - - fixed bug that prevented CCR shadow register update at the planned moment - The IRQ handler were added before to update the CCR registers early in the cycle. - They were fired directly because of pending timer overruns, which caused non syncronous - updates when the update occured at the end of the cycle. - - added protection to prevent late CCR register updates in case the interrupt was blocked - - increased priority of these interrupts - - added phase delay between the three motor axis. Not sure if that helps, but it does not hurt - - - added idle time calculation, printed out in the performance log you get with 'p' - - added USB-VCP support. Input and output runs in parallel to UART4. - - - changed start up messages, which can be seen on USB-VCP if you connect a terminal program fast enough - - moved command handler to separate files - -20130820 - - added built-versions directory with just the hex files of the various verions - including the experimental version (both FW and GUI) - - various usb VCP tweaks, - - change to the command interpreter to resolve an error when writing values from the GUI - -20130821 - - fixed array offset in engine.c for yaw power setting - -20130901 - - added basic evvgc board support - - added mechanism to reset CPU before starting main program to avoid USB setup problems - - added shared memory communication with main program using backup ram area - - added "fast reset mode" triggered by main program - - reduced flash timeouts for 8x faster flashing - - added some volatile definitions to use -O2 code - - removed many compiler warnings - - - main program changes for boot loader support - - added command 'r' to reset CPU - - added command 'b' to reset CPU and stay in bootloader until program is uploaded - - - other changes - - added printout of gcc version and firmware build date, looks like - gcc version 4.7.4 20130613 (release) [ARM/embedded-4_7-branch revision 200083] - EvvGC firmware V1.01, build date Sep 1 2013 01:08:53 - - added pin definitions for LED and I2C pins to pins.h, changed code to use them - -20130903 - - updated the attitude estimation code to support external RX control of both Pitch - and YAW... AUX3 - Pitch, AUX4 - YAW - - added support for a roll offset that can be programmed via the GUI - - added support for AutoPan on the YAW axis - - other general formatting changes to the code - -20130908 - - more cleanup in the attitude estimation engine - - fixes for tuning the yaw motor - -20130910 - - initial release of the 0.4 firmware - -20130913 - - usb VCP fix for Windows XP - - added version command to cli - -20130917 - - incremental changes to the attitude engine and replacement of other *magic* numbers - - release of 0.4.1 firmware - -20130929 - - Fixed a stray interrupt problem that was occuring on 1.3 boards only due to the USB pin - mis configuration - - correct gyro configuration - - release of 0.4.2 firmware - -20131010 - - added usb bootloader and associated scripts. See wiki for details on use - - corrected RC control double add of RC values - - included Autopan on Yaw in software - - release of 0.4.3 firmware - -20131019 - - updated gyro.c to setup the mpu6050 the correct way, added the z axis clock as the imu clock - - other minor formatting changes - -20131021 - - revised gyro.c initialization completely after finding a major issue with the original version - Gyro is initialized with Z Axis clock, 8khz sample rate on the gyro, 1khz on the accel, NO LPF enabled, 250 deg/sec on the gyro and +/-2G on the accel - - The gyro scale has been corrected to be the right value for a 250d/sec gyro setup - - engine.c was corrected to maintain all values in Radians - -20131114 - - added define for IMU address - - added acc007 changes for debug/desk config of board when no IMU is present - - updated attitude with paulphil changes for pitch greater than 45 degrees - - updated rc pwm detect for futaba receievers - - Released 0.4.4 firmware - -20131115 - - added delay to startup to allow gimbal to settle - - Released 0.4.5 firmware - -20131116 - - tweaking startup delay and added slow flashing LED - - Release 0.4.5.1 firmware \ No newline at end of file +# History # + +20130629 + - initial commit (derived from FW03preB) + + - to build under eclipse, you'll need the gnu toolchain from - https://launchpad.net/gcc-arm-embedded + - I borrowed a setup documnent from the AQ32PLUS software, you'll have to translate a little bit from it. + it's in the Documentation folder + - while the eclipsesetup document in the Documents directory talks about installing the Code Sourcery + toolchain, ignore that and use the above. Follow the rest of the document however. + - where it talks about importing a .cproject file, use the one in the setup folder called .cproject.orig + +20130629 + - added USB libaries and stubbed in the VCP code (NOT FUNCTIONAL) + +20130629 + - added newlib_stubs.c - these are the stub routines that should allow the uarts to function like + consoles with limited input/output features like printf, etc. + +20130711 + - updated the CMSIS library to the latest version from ARM (3.2) + updated setup/.cproject.orig, confirmed build + +20130712 + - updated with latest sources from evvaldis, builds ok, still untested + +20130712 + - added the original sources for 0.3b and 0.3e (latest as of this date) + +20130716 + - updated with new sprintf_ that is much smaller than original, changed Release build to optimize for size + added the USB FS Driver (none of the USB drivers are currently used + +20130716 + - updated the import .cproject.orig in the setup directory to remove Release optimizations + +20130718 + - updated with the EvvGC 0.3g sources, built but not tested + +20130721 + - added a minimal set of bin utililies in the setup/minutils.zip file. + copy these files (rm.exe, cs-rm.exe, make.exe and cs-make.exe to the same location + as the bin utilities for the compiler that you installed.) + +20130801 + - replaced system_stmf10x.c with 3.6.1 version + +20130808 major code rework by ala42 + - added Makefile, modified a Makefile that was posted previously in a source code package + - added message printouts during startup, so you can see what is going on + - made variable 'stop' volatile + Previously while (stop == 0) {} was an endless loop due to compiler optimisation + - added interrupt driven serial I/O using ring buffer + + AUX3/4 handling + - changed resolution of timer3 from 10µs to 1µs + - made variables used for reading AUX3/AUX4 static instead of global + - added access functions GetAUX3()/GetAUX4() returning pulse length from 0-999µs + - disabled JTAG to make PB3 connected to AUX3 usable at all, AUX3 is not used in the code, yet + - fixed variable types of counter helper variables like rc3a from int to unsigned short + - changed max counter value from 60000 to 65535, as arithmetics in the arithmetic ring + of the 16-bit counter does not work otherwise. + + - made several variables in engine.c local/static + - moved several global variable declarations to the files where they belong to + - added a constrain function to make the code more readable + - fixed the usage of the AUX4 value so the sinus array is accessed correctly + - fixed gyro resolution from 8000 to 8192 and made some cleanup in gyro.c + + - changed main loop timing from timer2 interrupt flag to direct timing reads + + - moved command handling from interrupt handler to main loop + - cleaned up command handling + - added '+', '-' commands for testing PWM outputs + - added 'd' command to enable debug print messages + - added 'G' command to print config values + + - removed motor off during config loop as config is atomic now + - removed variable stop + - renamed TimerOff to PWMOff + + - ReadFromEEPROM returns an error checked by configLoad() now, if eeprom is not available + - MPU6050_Init returns an error now, added retries + - relaxed watchdog timing, before the watchdog could trigger during gyro calibration + + - fixed several major problems in the dead time handling of TIM4 and TIM5 + - TIM5 active time was reduced by 70 18MHz ticks, had to be 80 to match the dead time of TIM1/8 + - TIM4 active time was not reduced at all by the dead time + - delay between TIM4 and TIM5 was made with a delay loop when enabling the timer. Now the + counter start value is set to the wanted delay. Old delay was 0.8µs instead of 4.4µs. + - inverted and swapped TIM4+5, as YawX and YawXN were swapped and did not match the Roll/Pitch waveform + - PWM width is changed syncronously now in interrupt handlers + This bug caused dead time violations/shortcuts on TIM4/5 before when PWM width change was large + - activated compare preload mode, so PWM cycles are no longer interrupted when changing the PWM width + This bug caused bad frequency and shortcuts on TIM4/5 before when PWM width change was large + - changed BTDR initialisation order for TIM1/8 to remove startup glitch + - simplyfied timer setup + + - moved rc code from main.c and timer.c to rc.c + - moved PWM code from timer.c to pwm.c + - moved and simplyfied PWM code from engine.c to pwm.c + - removed timer.c + +20130810 some fixes by ala42 + - fixed bug in ringbuffer handling + - fixed problem in micros() + - added 64MHz clock setup in case external oscilator fails + - added callback for systick irq + - removed TIM2 usage + + Performance + - added performance messages, online selectable with 'p' + - changed atan2(double) to atan2f(float), which saves ~60µs + - changed SetPWM to use sinus table and fix point calculation, which saves ~550µs/loop + - current loop time is ~660µs + +20130813 + - increased the I2C delay to be on the safe side + - revised gyro convertion to use gyroScaleFactor and corrected the math and value + to match the actual gyro setup + +20130819 + PWM handling + - added profiling to measure when and how often the CCR registers are changed + Log message is toggled with 'c'. + - fixed bug causing yaw channel update every cycle without any need + This bug just wasted time. + - fixed bug that prevented CCR shadow register update at the planned moment + The IRQ handler were added before to update the CCR registers early in the cycle. + They were fired directly because of pending timer overruns, which caused non syncronous + updates when the update occured at the end of the cycle. + - added protection to prevent late CCR register updates in case the interrupt was blocked + - increased priority of these interrupts + - added phase delay between the three motor axis. Not sure if that helps, but it does not hurt + + - added idle time calculation, printed out in the performance log you get with 'p' + - added USB-VCP support. Input and output runs in parallel to UART4. + + - changed start up messages, which can be seen on USB-VCP if you connect a terminal program fast enough + - moved command handler to separate files + +20130820 + - added built-versions directory with just the hex files of the various verions + including the experimental version (both FW and GUI) + - various usb VCP tweaks, + - change to the command interpreter to resolve an error when writing values from the GUI + +20130821 + - fixed array offset in engine.c for yaw power setting + +20130901 + - added basic evvgc board support + - added mechanism to reset CPU before starting main program to avoid USB setup problems + - added shared memory communication with main program using backup ram area + - added "fast reset mode" triggered by main program + - reduced flash timeouts for 8x faster flashing + - added some volatile definitions to use -O2 code + - removed many compiler warnings + + - main program changes for boot loader support + - added command 'r' to reset CPU + - added command 'b' to reset CPU and stay in bootloader until program is uploaded + + - other changes + - added printout of gcc version and firmware build date, looks like + gcc version 4.7.4 20130613 (release) [ARM/embedded-4_7-branch revision 200083] + EvvGC firmware V1.01, build date Sep 1 2013 01:08:53 + - added pin definitions for LED and I2C pins to pins.h, changed code to use them + +20130903 + - updated the attitude estimation code to support external RX control of both Pitch + and YAW... AUX3 - Pitch, AUX4 - YAW + - added support for a roll offset that can be programmed via the GUI + - added support for AutoPan on the YAW axis + - other general formatting changes to the code + +20130908 + - more cleanup in the attitude estimation engine + - fixes for tuning the yaw motor + +20130910 + - initial release of the 0.4 firmware + +20130913 + - usb VCP fix for Windows XP + - added version command to cli + +20130917 + - incremental changes to the attitude engine and replacement of other *magic* numbers + - release of 0.4.1 firmware + +20130929 + - Fixed a stray interrupt problem that was occuring on 1.3 boards only due to the USB pin + mis configuration + - correct gyro configuration + - release of 0.4.2 firmware + +20131010 + - added usb bootloader and associated scripts. See wiki for details on use + - corrected RC control double add of RC values + - included Autopan on Yaw in software + - release of 0.4.3 firmware + +20131019 + - updated gyro.c to setup the mpu6050 the correct way, added the z axis clock as the imu clock + - other minor formatting changes + +20131021 + - revised gyro.c initialization completely after finding a major issue with the original version + Gyro is initialized with Z Axis clock, 8khz sample rate on the gyro, 1khz on the accel, NO LPF enabled, 250 deg/sec on the gyro and +/-2G on the accel + - The gyro scale has been corrected to be the right value for a 250d/sec gyro setup + - engine.c was corrected to maintain all values in Radians + +20131114 + - added define for IMU address + - added acc007 changes for debug/desk config of board when no IMU is present + - updated attitude with paulphil changes for pitch greater than 45 degrees + - updated rc pwm detect for futaba receievers + - Released 0.4.4 firmware + +20131115 + - added delay to startup to allow gimbal to settle + - Released 0.4.5 firmware + +20131116 + - tweaking startup delay and added slow flashing LED + - Release 0.4.5.1 firmware + +20131214 + - small updates with a more typical gopro default PIDS + - Release 0.4.5.2 firmware diff --git a/src/config.c b/src/config.c index cac9ef2..fdc546d 100644 --- a/src/config.c +++ b/src/config.c @@ -11,7 +11,7 @@ #include "eeprom.h" #include "comio.h" -char configData[CONFIGDATASIZE] = {49, 50, 51, 97, 98, 99, 51, 52, 53, '0', '1', 54}; +char configData[CONFIGDATASIZE] = {40, 85, 60, 30, 55, 40, 35, 55, 60, '0', '0', 64}; void configLoad(void) { diff --git a/src/engine.c b/src/engine.c index 01f3b27..53c1d99 100644 --- a/src/engine.c +++ b/src/engine.c @@ -144,7 +144,7 @@ void Get_Orientation(float *SmoothAcc, float *Orient, float *AccData, float *Gyr float GyroRate[EULAR]; //AccAngle[ROLL] = -(atan2f(AccData[X_AXIS], AccData[Z_AXIS])); //Calculating roll ACC angle - AccAngle[ROLL] = -(atan2f(AccData[X_AXIS], sqrtf( AccData[Z_AXIS] * AccData[Z_AXIS] + AccData[Y_AXIS] * AccData[Y_AXIS]))); //Calculating roll ACC angle + AccAngle[ROLL] = -(atan2f(AccData[X_AXIS], sqrtf(AccData[Z_AXIS] * AccData[Z_AXIS] + AccData[Y_AXIS] * AccData[Y_AXIS]))); //Calculating roll ACC angle AccAngle[PITCH] = +(atan2f(AccData[Y_AXIS], AccData[Z_AXIS])); //Calculating pitch ACC angle SmoothAcc[ROLL] = ((SmoothAcc[ROLL] * 99.0f) + AccAngle[ROLL]) / 100.0f; //Averaging roll ACC values @@ -163,7 +163,7 @@ void Get_Orientation(float *SmoothAcc, float *Orient, float *AccData, float *Gyr //---------------------YAW autopan----------------------// //#define ANGLE2SETPOINT -1000 #define DEADBAND 2.0f //in radians with respect to one motor pole (actual angle is (DEADBAND / numberPoles) * R2D) -#define MOTORPOS2SETPNT 0.45f //scaling factor for how fast it should move +#define MOTORPOS2SETPNT 0.55f //scaling factor for how fast it should move #define AUTOPANSMOOTH 40.0f //#define LPFTIMECONSTANT 20 //change this to adjust sensitivity diff --git a/src/main.h b/src/main.h index 2e58852..7c36d87 100644 --- a/src/main.h +++ b/src/main.h @@ -9,7 +9,7 @@ #define MAIN_H_ // software version number -#define __EV_VERSION "0.4.5.1" +#define __EV_VERSION "0.4.5.2" float GetIdlePerf(void);