NGOS-0.68
Release Notes
NGOS version 0.68
Bumped version number to 0.68.
Merged Stefan’s perlimary work making NGOS multi-architecture enabled for architectures stm32f4 and lpc2148. We are now officially multi architecture enabled. Fixed a lot of followup errors and warnings.
Merged Matze’s changes implementing mixed teacher/student mode. Modified free command. Added malloc to conf store command. Added patch to toolchain build script, which sets the sbrk page size to 128 instead of 4096.
Merged Mattes’s changes: Added some controller defines for multible code usage to SimonK code. Added controller defines for multible code usage. Added forgotten define for multiple compiling; compiling works for atmega8 and atmega168, no difference between original tga.hex (m8) and our defined tgy.hex for target m8. removed debug LED. added atmega8 define file; tested with avra 1.3.0. Defined i2c input to 8bit and 11bit. Merged SimonK’s last changes.
Mattes increased TMAX for holger/quax/simonK to right maximum value.
Partly ported spi0-sensor.c from architecture lpc2148 to stm32f4. Code compiles. Moved all sensor header files, which are independent of architecture, to kernel/sensor/*.h.
Implemented LISL device probing for stm32f4. SPI device probing works, we have a LISL in the device table.
Refactoring of a lot of lpc2128 architecture specific code to support multi architecture.
Made terminal task redraw their prompts first thing after starting.
Extended configure.ac and Makefile.am to support GIT WCs and to fetch “git describe –tags HEAD” as revision number.
Fixed behavior_action_conf_store() which did not correctly calculate the CRC checksum of the config slot. Moved CRC checksum calculation from “conf store” shell command to in-kernel SWI function conf_store() which gets used by shell command and behavior action.
Fixed bug introduced in BHCC merge. Conditions using left/right did not work. This means behaviors when.landed.rc.stick.edge(), when.rc.stick.edge.and.pot() did not work.
Stefan enabled “set defaults” for STM32, succeed architecure specific conf_arch_init, in order to load default settings correctly. Fixed bugs introduced with new s3d-dsl communication through uart. Implemented new platform independent UART format configuration. Converted S3D DSL to terminal task, fixed bugs introduced in UART conversion. Converted DSL parser to be parsed as user task. Removed M-Link detection since Spektrum devices are detected as M-Link because they have the same detection sequence. Use uart_mode instead. Modified prompt drawing, do it the same way on STM32F4 and LPC2148 (using callback task in ctrl.c). Improved UART mode configuration validation.
Splitted MSB (Multiplex Sensor Bus) and M-Link (Multiplex RC-Receiver) into two files. Renamed everything MSB related from mlink to msb. Added new configure flag –enable-rc-msb to enable Multiplex Sensor Bus support. Spektrum now uses the new UART interface too, and should work on STM32F4 therefore. Converted Graupner SUMD to new UART interface. Converted Futaba S.Bus system to new UART interface. Converted VDrive2/Vinculum Firmware support to new UART interface, run as an task and use malloc to allocate buffer. Bootmsg is now completly platform independent.
Improved actor detection for HW.actor.init != 0, the detected actors now all show up in “show devices”.
Stefan implemented new conf table UART, along with new commands “show uart”, “diff uart”, “dump uart”. Use C99 struct initialization in globals (explicit field assignment, compiler checked.
We have set the openocd jtag adapter speed to 1200kHz for JTAG-flashing, making sure the Amontec JTAG will not be driven too fast.
Florian added support for 11 bit Spektrum DSMX.
Amir moved ALL shell loop commands to the new files user/cmd/loop.[ch]. Added generic integer loop task. Reimplemented all loop commands using the generic loop task. Extended generic loop interface to static and dynamic number of variables. Converted “loop adc10” into “loop adc10-low” and “loop adc10-high”. Extended generic loop interface with scaling option for variable scaling. Changed generic loop task to support printf() instad of iprintf() when scale_factor is != NULL. Changed “loop compass” to output 1/10 deg instad of only 1 deg.
Implemented cs.in.ir_dist containing the IR distance from the IR sensor on ADC AUX0/AUX1.
Stefan marked the parameter registers r0-r3 as clobber. This solves bugs when returning from SWI.
“print acc” works on the stm32f4! We have a first working DMA driven SPI device called LISL. Fixed acc channel order (need real hardware to correct this correctly). “print acc” works using a SPI DMA task kicked off using spi_start_task() as long as the SWI/SVC interface is not yet ready.
Stefan switched to silent building by default using AM_SILENT_RULES. Set version and revision flags only for version.c. Use Per-Object Flags emulation in Makefile as suggested in automake manual. This fixes silent building for all our C-files. Splitted license text in order to reuse authors (saves more than 300 bytes).
Implemented new loop command “loop height” showing new cs.out.ground_height which represents ground height over sea, baro height and IR height. The new ground_height is calculated in ctrl_input() from IR height subtracted from baro hight. Fixed bug in slot allocation which did not clear scaling of used slot variables when setting up a new slot. Improved IR height calculation. A IR height of zero represents an invalid value.
Moved ground height calculation from ctrl_input() to ctrl_amir_ng_gps_input(). Implemented ir distance measurement attitude (using nick/roll angles) compensation and added cs.out.ir_height to store the calculated IR height besides the measured IR distance in cs.in.ir_dist. Exporting ctrl_system_booted for other modules. Extended “loop height” to display the new values.
Replaced ALL rc related loop commands except “loop rc” with “loop rc-in <dev>”. We now have just two rc loop commands: “loop rc” showing the output of the rc mixer and “loop rc-in” showing the inputs of the rc mixer.
Fixed ms56xx initialization. now we start using the baro measurement when the first measurement has been received and not before. fixed version checks for hw-0.23-mini. We now use the ms56xx instad of the adc24/mpx on hw-0.23-mini. Currently this can not be changed by configuration.
Eliminiated cs.in.time, cs.in.date and cs.in.meta. replaced them with cs.in.time_hour, cs.in.time_minute, cs.in.time.second, cs.in.data.year. This allows us to use generic loop tasks to show the data. Eliminated float3232 cs.in.latitude, cs.in.longitude, cs.in.attitude, cs.in.speed and replaced them with float cs.in.gps_latitude, cs.in.gps_longitude, cs.in.gps_attitude, cs.in.gps_speed. Converted “loop position” to new loop interface. extended new loop interface to support floats by prefixing format with a F character like “F\t\t%f”. removed old “loop position” code. Modernized “loop stick”, now uses task with timer_sleep(). Reimplemented “loop ctrl” as generic loop task. No longer dumping in irq. eliminated “loop ctrlreg”.
Improved generic loop task interface: eliminiated parameter var_size and replaced it with the generic first character in the format string. we support for now: “Sxxxx”: short (16bit), “Ixxxx” or “xxxx”: int (32bit), “Fxxxx”: float (32bit). This allows to have a data type for each variable pointer. rewrote all loop commands to comply to the new interface.
Mattes added mouse zoom and move to qNGctrl plots. Added timestamp of fetched packet to ng_ngctrl_packet_data_t struct. Now we have a correct time base to use it at dumping. Added new QWidget NGPlot with new plot window, infinite curves, colored curves, colored legent, title, dump data, mouse zooming, replots only at new data, clearing plot window.
Mattes modifactions to cross compile qngctrl and libng for Windows.
Amir replaced function calling without caller function in libbhcc to use int[] instad of N arguments to the function. All our behavior functions use int[], better to use everywhere int[]. Implemented two new lookable functions called arg_firstXYZ(x,y,z) and arg_lastXYZ(x,y,z) returning x and z. used them to implement regression tests for function argument order testing for the first and the last element of a 3 argument.
Mattes corrected libng serial handling in windows.
Moved all print commands to user/cmd/print.[ch]. Integral shell print commands stay in user/task/terminal.c.
Christi implemented a better shell thread implementation for qNGctrl. Extended I2C output to Holger compatible BLCs to 11 bits. Set I2C_EXTEND=1 for simonK. Added global parameter ACTOR.use.11bits. Changed TMAX for actors to 65535 (16 bit resolution). Adapted scaling in ctrl-amir-pid and ctrl-amir-ng-pid. No need to change any default parameters. Controllers are now working with higher resolution.
Amir fixed all rc behaviors which used HOOK_NOSIG and HOOK_SIG. All behaviors using these two hooks did not trigger anymore as behavior_check() did not do a bit-check on the behavior condition’s hook definition. The signal loss behaviors work again now. Improved behavior_check() performance by only copying action parameters when the condition is true.
Mattes fixed the MS65xx pressure calculation. Output is now correct and does no longer oscilate.
Christi added arrow left/right support to qNGctrl shell.
Michael changed behavior of HW.use.gps. It allows to set different modes now (no|onboard|ext_auto|ext_venus_autoconf_uart1||ext_venus_autoconf_uart2). The hw.uartx.mode venus is absolute now. Rhis allows hw with onboard gps to use other serial devices on uart1.
Amir refactored all “calibrate xxx” commands. Moved all calibrate commands to user/cmd/calibrate.[ch]. Consolidated “calibrate acc”. Will automatically use the right acc. Added “calibrate mpu” and “calibrate lisl” commands. Consolidated “calibrate compass”. Will automatically use the right compass. Added “calibrate micromag3” command.
Fixed “loop rc” to always show signals even when receiver communicates signal loss. Rhis allows us to see the generated rc signals on signal loss. Fixed “loop ms56xx” to scale correcty.
Implemented new behavior action ctrl.stay.above.ground(height) which will increase throttle the more you are below the given height. Added sound when throttle gets manipulated. Extended ctrl.descend(x)/ctrl.ascend(x) to play sound as well, when throttle gets manipulated.
Implemented CTRL_AMIR_NG_BEEP_DCM_ACC_VALID_NEG and CTRL_AMIR_NG_BEEP_DCM_ACC_VALID_POS. activated CTRL_AMIR_NG_BEEP_DCM_ACC_VALID_NEG. Changed ctrl.descend()/ctrl.ascend() to play melody while active and changed them to do nothing when landed.
Michael fixed behavior_condition_when_rc_pri_pot_binary. Missing switch case for multiplex receivers.
Amir implemented a new command “calibrate acc”. The new command implements 4 point calibration. It needs 2 times 4x 90 degree turns on 2 axis.
Rewrote all spi0 ACC fsm. Arch layer no longer corrects in-flight nor calibration. It’s all done in ctrl_input() now.
Implemented new style accelerometer calibration for all three axis. The new calibration code calculates multiplicative factor a and additive factor b for each axis to scale measurement correctly.
Renamed cs.in.a[NRY]raw to cs.in.a[NRY] as it represents the corrected and calibrated measurements. Introduced cs.in.a[NRY]raw, containing the raw value from the measurement. Moved all calibration and in-flight corrections from fsm in spi0-sensor.c to ctrl_input() in ctrl.c. New style calibration stores results now to global registers ctrl_cal_acc[nick|roll|yaw][a|b].
Changed “calibrate acc” to call the right calibration function depending on CTRL_ACC_CALIBRATION_NEW_STYLE. Changed default behavior to no longer contain acc calibration. Changed “calibrate mpu” and “calibrate lisl” to call “calibrate acc”.
Amir fixed BHCC’s encoding of constant pushes to stack: [-127..127] -> 8bit, [-32768..32768] -> 16bit.
Stefan implemented a new SWI interface, prepared for portability. Added supervisor.c in kernel/core, base for arch independent supervisor calls. Renamed swi to supervisor. Implemented supervisor calls for STM32F4 platform.
Reading LISL calibration register in spi0_init_lisl() and showing calibration offset and gain while booting.
Christi extended HAL BLC parameters to 16 bits.
Stefan fixed DMA for SPI on stm32f4 architecture.
Christi changed HH DCM to let the sticks rotate only nick and roll part of the HH DCM. Pull yaw part of HH DCM to body DCM.
Matthias implemented a new HAL called vz6. Matthias fixed opmode SERVO_OPMODE_FC_CONTROLLED which was not yet fully implemented.
Stefan changed lpc21isp Makefiles to compile in compilers native platform by default (makes i386 libs obsolte on AMD64 machines). Don’t use -m32 for vectsum and trigtables either.
Amir implemented maintainer/release-git.sh.
Mattes added –disable-3ds to qNFctrl allowing to switch off the 3D model.
Checking MPU revisions and configuring accordingly. Thanks to cpresser for his contribution. Added a new device table entry for MPU revision C and D. “show devices” now shows MPU revision.
Fixed led.h to only include stm32f4 headers when compiling for stm32f and only to inlude lpc2148 headers when compiling for lpc2148. Many thanks to Jiffy for spotting the problem.
Moved altitude hold toggeling code from action-ctrl.c to ctrl-nav.c making it generic. Rhis will allow us to send NGCTRL2 packets from a central place when the altitude fix toggles. Added altitude fix to DUMP_PKG_HEIGHT. Extended ctrl_nav_altutude_hold() to automatically send an out-of-order packet on state change. Added altitude fix received with DUMP_PKG_HEIGHT to altitude plot in qNGctrl. Added cs.out.navT to DUMP_PKG_HEIGHT. showing it in altitude height plot.
Implemented new shell command “nav altitude-hold” which enables or disables alltitude hold.
Extended qNGctrl’s NGPlot with controls pointer argument. passing altitude-hold button layout for altitude plot. Added signal and callback function. Button gets enabled/disabled by flight state changes. Added altitude-hold button to GPSMap. Signaling NGCtrl to toggle similar to PH/CH buttons. Corrected GPSMap button flightstate dependancies: comming-home is only possible when a GPS fix is available AND a home position is set.
Splitted flightstate into flightstate and flightfunction. Flightstate is a real state, eg. LANDED, SPINUP, FLYING. flightfunction is a bit field where each function can be set and cleared individualy. Rhis will allow us to do PH + AH at the same time using two flightfunctions activated at the same time. Adjusted all kernel modules to use ctrl_flightstate and ctrl_flightfunction. Implemented set, clear and isset macro for ctrl_flightfunction handling: ctrl_flightfunction_[set|clear|isset](ff) in ctrl.h/dumb.h. NGOS sends a NGCTRL2 out-of-order packet when the flight function and state changes. Extended qNGctrl’s gps_map to display flight function short names.
Ported altitude hold to flight function. Flight function short name is AH. Now correctly displaying AH as flight function besides PH,CH,WP-FWD,WP-REV,FF,FB, FL,FR.
Signaling heading hold using flight function without removing CTRL.useHH. This allows to use different configs with or without heading hold. This also allows us to change HH using the ‘set’ command in the shell.
Moved all controller specific cs->use_xxx to controller generic cs.in.use_xxx. ctrl_input() now sets these flags in cycle 1. this assures that the first controller run already has it’s cs.in.use_xxx set and the flags will be re-set every second. All controllers use the same cs.in.use_xxx flags now.
Implemented toolchain target “llvm-clang-3.3-arm-eabi-4.8.1” compiling llvm-3.3 with clang-3.3 using gcc-4.8.1.
Configure: replaced –short-enums with -fshort-enums. Made configure recognize gcc and clang/llvm choosing CFLAGS and LDFLAGS accordingly.
Christi implemented a new software looping algorithm. New flight state function ctrl_amir_ng_process_flip(). Scaled flip.turnrate to DEG/s, Added new parameter flip.off.angle. Added new parameter flip.throttle. Added direction parameter to behavior ctrl.flip.
Updated INSTALL documentary file describing how to compile NGOS using clang/llvm.
Mattes added google map api to qNGctrl: added maptype and google key (overloaded and function); added mapptyes roadmap, satellite, hybrid and terrain.
Renamed behavior action rcctrl.set.[nick|roll].corr(servo,pot) to rcctrl.set.[nick|roll].corr.pot(servo,pot). Changed behavior action rcctrl.set.servo(servo,pot) to rcctrl.set.servo(servo,val) to allow direct value setting.
Implemented new commands “nav height [<m>]” and “nav relheight [<m>]” and two api functions ctrl_nav_set_height(float height) and ctrl_nav_set_relheight(float height).
Implemented a new GUI counter on the Altitude tab in qNGctrl showing the current AH fix and allowing to change the AH fix. Changing the value will issue a “nav relheight” to NGOS.
Implemented throttle control while doing AH: throttle movements now allow to change current fix.
Implemented boolean controller dependant parameter CTRL.use.ir.
Re-implemented ACC.valid validation. Ajusted scale of ACC.valid to [0.01m/s^2].
Switched default of CTRL.use.baro to yes.
“set defaults” will automatically configure HW.use.acc to MPU on HW-0.23-mini. It also will recognize hw-0.24-mini and to automatically set the gyro type to MPU-2000deg.
Implemented behavior action rcctrl.set.servo.pot(servo, pot).
Fixed HAL hexa description and added CW/CCW. Thanks to Peter for checking!
Implemented NMEA precision dilution fields (pos, horizontal, vertical). Implemented cs.in.gps_dilution, cs.in.gps_dilution_h and cs.in.gps_dilution_v. Extended “loop position” to show dilutions.
Implemented new toolchain build script target “cortex-eabi-4.6.4” building a Cortex M0, M3, M4 only toolchain supporting -mfloat-abi=hard for M4 only and supporting soft floats on the other architectures.
Switch off dcm drift stabilization using acc and compass during a flip.
Changed ctrl_amir_ng_dcm_correction() to skip dift compensation using the simulated acc while doing heading hold and not using a real accelerometer.
Fixed controller amir-ng’s Kalman filter framework which did not clear correction of last control step when acc.valid returned false resulting in wrong corrections.
Jan-Hendrik implemented Graupner HOTT telemetry support.
Implemented ctrl_nav_precision_acceptable() checking satellites & dilution against NAV.min.satellites and NAV.max.dilution. Using it everywhere in ctrl-nav.c.
Implemented hal_rotate_[NR|Y_mag|Y_n](angle, …) in HAL layer. rewrote all *X HALs to use these generic rotation functions. Further HALs will know and export the rotation angle used, allowing HAL-external code to rotate with the same angle. We will need that for the in-flight calibration in X-mode. Extended hal_list[] with HAL rotation angle field. Adjusted hal_rotate_[NR|Y_mag|Y_n]() to automatically use the angle of the current HAL for rotation.
Moved all rotation code from HALs to hal.c. HALs now export a rotation angle. Rotation functions use that angle to rotate sensors for HAL. Using negative rotation function to transform in-flight calibration’s correction in x-mode HALs. HW.compass.corr gets honored as well.
Factorized ctrl_compass_rotate() into separate functions ctrl_compass_rotate() and ctrl_compass_invert() and removed all sensor rotation from ctrl_input() as hal_input() is responsible for it. consolidated all sensor rotation stuff in hal layer function hal_rotate_sensors(). it rotates all oriented sensors according to the defined HAL rotation angle and honors HW.compass.corr. removed obsolete functions hal_rotate_Y_mag() and hal_rotate_Y_n(). All x-mode HALs now call hal_rotate_sensors() in their HAL input function.
Updated lpc21isp from version 1.48 to version 1.94.
Felix refactored the HOTT receiver code. Global state is now per-UART. Inverse-text warnings don’t flicker unreadably fast now. Setting the receiver as detected/undetected correctly. Implement idle line protocol.
Christi implemented “dump_cmd_api_ngctrl_v2_console”, a new shell command to switch on/off packaging shell output into ngctrl_v2 packages. Extended libng to parse shell packets. Eliminated shell thread in qNGctrl, call ng_ngctrl2_packet_poll() instead. Activated local echo in shell because NG echo is deactivated. Replaced most of putchar() by monitor_write(). Write syscall output blocking to uart, skip ngctrl-v2 packets if uart buffer full. Do not disable terminal echo and promt if dump and shell->ngtrl-v2 is enabled. Using qNGctrl signal/slot to transfer shell output.
Ralf extended the CAM Controller: added new parameters for servo_opmode and servo speed. Attitude control and direct servo control work on CAM Controller HW.
Christi implemented multiplex GPS input with HOTT parser on uart1. Multiplexing onboard GPS if HW.use.gps = hottmux. Check GPS signal every 100ms. Send HOTT telemetry between GPS reception (may skip some GPS cycles).
Felix fixed all stick behaviors and consolidated them. Made smaller boxes for edges. It was hard to move the sticks from the center to a corner without triggering behaviors for the adjacent edge positions.
Felix implemented ctrl-u (erase line) + END key in terminal.
Christi fixed a small bug in the DTC. ctrl_limit_max() now works correctly. This will improve DTC’s impact on flight performace.