Historical project documentation. Content is maintained in GitLab.

NGOS-0.52

Release Notes

NGOS version 0.52

Implemented –device and –baud in ngctrl. ngctrl now correctly initializes the device with the needed baudrate.

Fixed problem in configure.ac which detected Windows executables wrong.

Fixed libng and ngctrl to work with /dev/rfcomm0 as well. Implemented the new ngctrl flags –device and –baud. ngctrl now can use any device.

Michael implemented the spi0 statemachine to sample and read the ADC24 value from the barometric sensor. Michael also added averaging. He added the two new shell commands called “loop adc24” and “print adc24”. He also made the output signal unipolar. The handler issues a ads1255 self
calibration cmd at startup. He implemented adc24 statistics. The data
aquisition is now triggered by the data ready irq pin. The ADC24_MEANCNT is set to 100.

Renamed release folder “cmd” to “cli”.

Implemented CTRL_AMIR_KALMAN_HEIGHT which controlls if a Kalman filter gets used for height control. Implemented a two times integrating
Bucy-Kalman Filter for height and a PID closed-loop controller which
controls throttle. Both can be switched off by defines. This also includes a new debug interface for ngctrl. furthermore ngctrl has been switched
from the old uavpset debug interface to the new ngctrl debug interface
able to support 32bit debug values.

Implemented a new behavior action called ctrl.altitude.hold() which will set a new altitude fix when called with 1 and reset it when called with 0. It
allows to add two behavior rules which switch on altitude hold and switch
it off again. We tested this and it works. Good parameters need to be found.

Fixed a small problem with KalmanCycle. Found out that we essentially use a Cycle of 3. fixed the bug and the cycle variable now define the real cycle number which defaults to 3 for now.

Fixed typo in kalman1d_float3232_update(). Thanks to Tensor for spotting the bug! The corrected algorithm now converges very nicly and has an angle error of 0.045 degrees when standing still. Changed kalman1d_float3232_init() to include the gyro bias. This allows us to initialize the gyro bias
accordingly which will help to reach the steady state earlier.

Changed ctrl-amir to start the kalman filters at startup. It initializes the filters when the first controller reset happens and already runs the Kalman filters in flight state landed. This makes sure the gyro bias is
calculated at the time of spinup/flying.

Changed ctrl_loopstep() to automatically reset the controller when comming from ANY flight stateinto flight state LANDED. This assures that everything gets reset after a flight… even the Kalman filters and their biases.

Changed yaw Kalman filter to no longer update while flying and just integrate with the calculated bias from the non-flight phases as long as we do not have a heading at hand. Seems to work remarkable well. It’s similar stable as the smothed yaw integral but a lot more exact. Now initializing the Kalman filter with their previous biases when the controller gets reset. That way we never
loose our bias.

Changed ctrl_limit_dtc4() to have a lowest value of 0 while landed and spinup but a lowest value of conf.Tidle in all other flight modes.

Switched back to -O2 from -Os. It seems -Os creates crappy code! I noticed that the calibration code suddenly got called TWO times, without reason! Also noted that i could not remove a not executed code line without breaking the
hex file! Switching back to -O2 or -O1 fixed the problem… so it IS
optimization related. We will continue with -O2… seems the most sensible
flag for now.

Patrick added a check for isatty()/_isatty() which differs between different NEWLIB versions. syscalls.c gets compiled accordingly. He also fixed the
Amontec/Olimex checks in configure.ac for Windows and Unix.

Patrick added the missing part values to the sensor board schematics (in particular sallen-key resistor and capacitor values, crystal oscillator frequencies, other missing resistor values). Apart from that he also
created a little table in the schematics which lists possible sallen-key filter cut-off frequencies and the required capacitor values. All those
changes asked for a new part list and PDF documents. Added wiki page
PartLists/0.20 as partlists.pdf. It includes the actual partlists for 0.20 as of today.

Patrick fixed all bugs from the SB bug list (footprints, labeling et all) and did a cleanup of the hw-0.21 folder. He removed old 0.20 panels and
the mm3 board.

Extended release script to contain FC+SB schematics and a PDF of the wiki partlists. Added usbser.[inf|sys] to release script.

Markus updated the 0.20 board plans with the current values and generated new PDF files for them.

Added a small java tool called jngctrl which is able to visualize the current angles of the NG. The code now outputs the nick/roll/yaw angles in degrees and in the internal integer format to the shell console while turning the model according to the current angles.

Added correction in ACC2INT3232_ROLL/NICK() which incorrectly handled the angle and changed the value range. Fixed atan2() to work in all quadrants. Implemented a float3232 asin() function which takes a float3232 as argument and returns a float3232. Simplified ACC2INT3232_NICK() and ACC2INT3232_ROLL().

Implemented float3232 log() and rewrote PRESSURE32322HEIGHTM3232() to use float3232 instad of floats. Extended log-table from 64x 64bit-float3232 to 128x 64bit-float3232. This makes it exact enough to give a hight +-10m from the float log()-height. We do a linear aproximation between table entries
to improve it further and to reduce memory usage. We use a 7bit table width and 8bit fraction which is used for linear aproximation. We now calculate
the height +-2m as the float log() implementation which is ok with a sensor which has 130m absolute error.

The amir controller now is able to use the height Kalman while still using not more than 346us.

Added factor 100 to z-PID divisor since we switched from [m] to [mm] in cs.out.z. Extended help text of the ctrl.altitude.hold(x) action.

Reduced GPS in-ram tracking points to 60. It simply does not make sense to store the stuff in-ram and it hinders “store conf” from functioning since
that needs 4kb RAM just for that.

Lowering I2C1 actor bus speed to 100kHz while scanning the bus to make sure we see all devices. Afterwards we switch the bus back to 400kHz.

Changed ADC10 sampling from automatic burst mode (resulting in 21 samples per cycle) to triggered burst mode with a 10Hz sampling frequency. This
reduces the IRQ storm and gives us a lot more time. we do not need more
to sample the battery, do we?

Changed usage of HW.use.acc. It now signals if ctrl_input() should use the real ACC measurements or if it should supplement [0,0,-1000] as fake
measurement. This allows to switch off the ACC for all types of controllers.

Reduced ACC_MEANCNT from 100 to 10. Increased ACC_CALIBRATE_MEANCNT from 50 to 100. Increased log() table from 128 to 256 entries and increased linear aproximation from 8bit to 10bit.

Increased ADC16_MEANCNT from 8 to 16. this results in much smother gyro values.

Started marking constant strings as “const char * const” which moves the string contents to the .text section which resides in flash, not in ram. Added a new Makefile target “fc-ram” which shows the symbols using ram
sorted by size.

Implemented body to earth transformation of a[NRY]_b to aY_e in ctrl-amir. Rhis reflects the change rate of the height in the eart system measured by the acc in the body system. Added new command “debug trans” to
debug body->earth transformation.

Fixed DSL on UART1. Added output of total slot number in “list conf”. Extended DSL protocol documentation.

Implemented the new command “scan dsl [uart0|uart1]” which does a frequency scan on DSL receivers and displays the RSSI of all channels.

Renamed the 3 Kalman parameters to Kalman.Angle.Q, Kalman.Bias.Q, Kalman.Acc.R and changed all refering code.

Implemented help texts in “show conf” and “show globals”. Renamed all configuration parameters globaly according to new standard.

Implemented HAL framework. The framework calls input & output HAL functions now. Implemented input HAL transformation in hal_quadcopterX_input() which turns w[NR], a[NR] and Y_n by -45 degrees. This allows us to use a
normaly oriented FC to fly in X mode.

Raised quadcopterX hal quality to FLYING.

The Kalman-Bucy filter for the height now uses the aY_e (meaning the z-component of the acc measurement after transforming it from the body to the earth system). Introduced new config parameters KalmanZ_L[123]
which configure the height Kalman-Bucy filter.

Changed “loop rc” and “print rc” to include channel names.

Improved float3232_log() by using all 64bit of the table for fractional parts. We now have a table with of 8bit and a interpolation with of 24bit.

Extended ngctrl by –flowctrl which switches on flow controll for devices like /dev/rfcomm0. Flow control is switched off by default as one can not use it with /dev/ttyUSB0.

Markus and Patrick finished routing on the new HW-0.21 boards. Next Quality Assurement must give it’s ok… ;)

Left stick top-right now only calibrates the Acc and does NO ‘store conf’ anymore! You have to add a behavior rule
“add behavior when.rc.stick.left(1,0) conf.store(0)” to have ‘store conf’ on a stick again!

Implemented ‘dump behaviors’ which dumps the current behaviors as script. Also implemented ‘delete behaviors’ which is the first command a behavior dump contains, to clear the table before setting it to new values.
Extenden ‘dump all’ to also include ‘dump behaviors’.

Switched ADS SPI bus speed to 1.875mhz instad of 3.75mhz. Ben found out that the ADS wants 1.92Mhz max! SPI initialization will be done at
1.875mhz spi clock for all devices.

Implemented new global configuration variable HW.gyro.type and associated variable global.hw_gyro_type. The variable has a special validation function which parses “mlx”, “adxr300” and “adxr610” to 6670, 5000 and 6000.
Changed ctrl_input() to use hw_gyro_type to scale gyro measurements.

Esden finished the huge work of changing all header files from CC-NC to GPLv3. Furthermore he added management scripts which allow us to rewrite all header’s dates when the year changes.

Markus added NGcon a small PCB as a SerCon replacement.

Changed callbacks: they now happen at 0s (no callback, 1 beep), 2.5s (spi0), 5s (actor,2 beep), 7.5s (calibration, 3 beep) and 10s (i2c0).

Ben added a BTS555 adapter board PCB.

Added new parameter to kalman_update() which allows to switch off the bias update. Introduced new config parameter KalmanLimit which decides the limit used to decide if we are stationary or not. Ro decide the gyro measurements on nick and roll get compared with the KalmanLimit and if its bigger, the bias will not get updated. Setting the limit to 32000 will disable bias freezing and setting it to 1 will freeze the bias as soon as the NG moves.

Changed Kalman.Limit default from 15 to 1: this results in no bias guessing while dynamic flight which results in better biases.

Changed yaw kalman to only update the bias while landed and not updating it while in spinup or flying: this results in the yaw bias correctly guessed and never changed while flying. updating yaw with helper integral as in the old code. This worked best without a compass.

Added a short beep when switching the height-hold closed-loop on and off.

No longer updating the angle kalman while roll is bigger than 70 degrees. This assures stability from -180 to +180 degree on nick, roll and yaw axes.

Implemented new behavior action ctrl.set.hw.hal() which allows to set HW.HAL as a behavior action. This will allow in flight HAL switching… ;)

Changed while_battery_low() to check the previous state and only alert if previous and current measurement say the battery is too low. This assures that no battery alert happens when startin up and will hide very short (<20ms) drops below the defined voltage level.

Increased UART0/1 RX buffer size from 64 to 512 bytes for both uarts. This uses 1k ram but allows pasting a full config setting into the shell. As long as we do not need the ram for other stuff, lets use it for that.

Implemented a reverse HAL called quadcopterR: It reverses flight direction, meaning the front becomes the back and left becomes right. This will allow a beginner to fly backwards…

Fixed behavior condition when.rc.pot.tristate() which did not correctly recognize one of the states.

Introduced P.z.limit and P.z.upfact. P.z.limit limits the correction of throttle to that max value. P.z.upfact is a percentual value multiplied with the correction if the correction reduces the throttle, meaning when we are too height.

Implemented behavior action conf.load(x) which allows to load a configuration slot.

Implemented shar archive creation: we now generate a wolferl-ng.sh which is a shar archive containing wolferl-ng.[bin|elf], lpc21iap, lpc21isp, openocd and flash-ng.sh which will get automatically started when calling the shell script and which allows to flash with an aribitrary serial device for which it prompts.