Commit Graph

50 Commits

Author SHA1 Message Date
raiden00pl 4e27f4a1d2 libdsp: port lib_observer.c to b16 2022-02-20 21:58:10 +08:00
raiden00pl 7126b829af libdsp/lib_observer.c: cosmetics 2022-02-20 21:58:10 +08:00
raiden00pl 1366e14192 libdsp: initialize flux_link in params, remove flux_link from pmsm_phy_params 2022-02-20 21:58:10 +08:00
raiden00pl ca4790c429 libdsp: add one_by_p to motor_phy_params 2022-02-20 21:58:10 +08:00
Mateusz Szafoni 5f50547ced libdsp: cosmetics changes from code review
Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-02-16 03:20:20 +08:00
raiden00pl 31ffa6d576 libdsp/lib_observer.c: remove dir argument from speed observers
We can automatically detect the direction of movement from angle diff
2022-02-16 03:20:20 +08:00
raiden00pl 01cbe9133e libdsp/lib_observer.c: update some comments
The angle observer always refer to a motor electrical angle,
while the speed observer can be applied to a motor electrical speed or a motor mechanical speed.
2022-02-16 03:20:20 +08:00
raiden00pl 26f1be27dd libdsp/lib_observer.c: separate angle observer from speed observer
They can be used completely independently, so they should'n be coupled.
For example, a sensored motor controller in speed control mode doesn't need an angle estimator.
2022-02-16 03:20:20 +08:00
zouboan 2391e4bd71 Update libs/libdsp/lib_observer.c
Co-authored-by: Mateusz Szafoni <raiden00pl@gmail.com>
2022-02-14 10:47:15 -03:00
zouboan 132f27a91a lib_observer: add nolinear fluxlink observer 2022-02-14 10:47:15 -03:00
Xiang Xiao 187d9e58c9 Remove the unnecessary inclusion of assert.h and string.h from public header files
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-20 10:30:08 +01:00
Nathan Hartman 609ee6b54b Fix typos in comments and identifiers 2021-07-19 22:55:30 -03:00
Nathan Hartman ce20211357 Fix various typos in comments and documentation
Fix typos in these files:
    * Documentation/components/drivers/character/foc.rst
    * Documentation/guides/cpp_cmake.rst
    * Kconfig
    * arch/arm/src/imxrt/imxrt_lpspi.c
    * arch/arm/src/kinetis/kinetis_spi.c
    * arch/arm/src/kl/kl_spi.c
    * arch/arm/src/lpc31xx/lpc31_spi.c
    * arch/arm/src/nrf52/nrf52_radio.h
    * arch/arm/src/s32k1xx/s32k1xx_lpspi.c
    * arch/arm/src/stm32/Kconfig
    * arch/arm/src/stm32/stm32_adc.c
    * arch/arm/src/stm32/stm32_foc.c
    * arch/arm/src/stm32/stm32_foc.h
    * arch/arm/src/stm32/stm32_pwm.c
    * arch/arm/src/stm32/stm32_spi.c
    * arch/arm/src/stm32f0l0g0/stm32_spi.c
    * arch/arm/src/stm32f7/Kconfig
    * arch/arm/src/stm32f7/stm32_spi.c
    * arch/arm/src/stm32h7/Kconfig
    * arch/arm/src/stm32h7/stm32_allocateheap.c
    * arch/arm/src/stm32h7/stm32_fmc.c
    * arch/arm/src/stm32h7/stm32_fmc.h
    * arch/arm/src/stm32h7/stm32_pwm.c
    * arch/arm/src/stm32h7/stm32_qspi.c
    * arch/arm/src/stm32h7/stm32_spi.c
    * arch/arm/src/stm32l4/stm32l4_pwm.c
    * arch/arm/src/stm32l4/stm32l4_spi.c
    * arch/arm/src/stm32l5/Kconfig
    * arch/arm/src/stm32l5/stm32l5_spi.c
    * arch/renesas/src/rx65n/rx65n_dtc.c
    * arch/renesas/src/rx65n/rx65n_usbdev.c
    * arch/risc-v/src/rv32m1/rv32m1_serial.c
    * boards/arm/stm32/b-g431b-esc1/src/stm32_foc.c
    * boards/arm/stm32/nucleo-f103rb/src/stm32_foc_ihm07m1.c
    * boards/arm/stm32/nucleo-f302r8/src/stm32_foc_ihm07m1.c
    * boards/arm/stm32h7/nucleo-h743zi2/README.txt
    * boards/risc-v/rv32m1/rv32m1-vega/README.txt
    * boards/sim/sim/sim/scripts/Make.defs
    * drivers/1wire/1wire.c
    * drivers/1wire/1wire_internal.h
    * drivers/lcd/Kconfig
    * drivers/syslog/ramlog.c
    * fs/fat/Kconfig
    * libs/libc/debug/Kconfig
    * libs/libc/machine/Kconfig
    * libs/libc/stdio/lib_libvsprintf.c
    * libs/libc/stdlib/lib_div.c
    * libs/libc/stdlib/lib_ldiv.c
    * libs/libc/stdlib/lib_lldiv.c
    * libs/libdsp/lib_observer.c
2021-07-04 11:23:26 -05:00
raiden00pl 55517a51e0 libdsp/fixed16: add openloop handler 2021-04-01 14:54:33 -03:00
raiden00pl 61389ad616 libdsp: update some comments 2021-04-01 01:24:12 -05:00
raiden00pl f05edf1a5b libdsp: fix nxstyle errors 2021-04-01 01:24:12 -05:00
raiden00pl 255ffcf852 libdsp: add support for fixed16 libdsp 2021-04-01 01:24:12 -05:00
raiden00pl f248207717 libdsp/Kconfig: move configuration to menuconfig, add option to include vabc in FOC data 2021-04-01 01:24:12 -05:00
raiden00pl a2afb2daa9 libdsp: add Permanent Magnet Synchronous Motor (PMSM) model 2021-04-01 01:24:12 -05:00
raiden00pl eeab79bd52 libdsp/lib_motor.c: remove reference to some unused data 2021-04-01 01:24:12 -05:00
raiden00pl eadc7ebb1a libdsp/lib_observer.c: optimize and add some comments 2021-04-01 01:24:12 -05:00
raiden00pl ee97eab4e7 libdsp/lib_foc.c: use better PI wind-up protection; add interface to run voltage controller without current controller; add separate interfaces to update base voltage and phase angle 2021-04-01 01:24:12 -05:00
raiden00pl b34dd2d96a libdsp/lib_pid.c: add anti-windup protection with decay coefficient and add interface to select anti-windup mechanism 2021-04-01 01:24:12 -05:00
raiden00pl 15b0ae716c libs/libdsp/lib_motor.c: refactor 2021-04-01 01:24:12 -05:00
raiden00pl c43ec4283f libdsp/lib_motor.c: remove maximum openloop speed limiter 2021-04-01 01:24:12 -05:00
raiden00pl eea371093c libdsp/lib_svm.c: return not saturated output from modulator, the current corection now takes float as an arguments 2021-04-01 01:24:12 -05:00
raiden00pl e0bab18b07 libs/libdsp/lib_transform.c: update descriptions 2021-04-01 01:24:12 -05:00
raiden00pl 5034e4d8ba libdsp: introduce libdsp-specific debug assertion (LIBDSP_DEBUGASSERT) 2021-04-01 01:24:12 -05:00
raiden00pl 66972d947e libdsp: add _f32_ suffix to all libdsp data structures tht use float as a numerical type.
This is an initial step to support fixed16 calculations for libdsp
2021-04-01 01:24:12 -05:00
Gustavo Henrique Nihei 330eff36d7 sourcefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
Gustavo Henrique Nihei 47cb41c92f makefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
chao.an c56785bd0d style/Makefile: remove unnecessary trailing whitespace
N/A

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-28 12:20:30 +01:00
Matias N d5b6ec450f Parallelize depend file generation 2020-11-22 09:02:59 -03:00
raiden00pl 33901969fe Fix nxstyle warnings 2020-10-10 12:24:28 -06:00
raiden00pl 24e17910b2 libdsp: Changed headers for apache 2.0 license 2020-10-10 12:24:28 -06:00
SPRESENSE e249a2f82f Makefile: Fix Make.dep not updated by config changes
Make.dep file should be updated by .config changed after first make.
There are 2 cases affected for this problem:

 1) Add source files by config symbol
 2) Include header files in #ifdef directive

These 2 cases may not be included in Make.dep and this may prevent the
differential build from working correctly.
2020-07-28 03:59:45 -05:00
Xiang Xiao 23668a4b9b build: Remove the empty variable assignment
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-24 08:24:13 -06:00
Xiang Xiao 1a95cce1a3 build: Move .config check to the top Makefile
remove the workaround to handle the inexistence of .config/Make.defs

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-20 17:57:34 +01:00
Gregory Nutt ca2b0a3657 Fix more warnings noted in PR checks
arp/arp_notify.c:132:43: warning: for loop has empty body [-Wempty-body]
           prev = curr, curr = curr->nt_flink);
                                              ^

    sixlowpan/sixlowpan_tcpsend.c:806:31: warning: implicit conversion from 'unsigned int' to 'uint16_t' (aka 'unsigned short') changes value from 4294967295 to 65535 [-Wconstant-conversion]
                                  _SO_TIMEOUT(psock->s_sndtimeo));
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Numerous warnings like:

    ieee802154_getreq.c:93:3: warning: implicit declaration of function 'memcpy' is invalid in C99 [-Wimplicit-function-declaration]
      IEEE802154_EADDRCOPY(eaddr, req.attrval.mac.eaddr);
      ^

    nxfonts/nxfonts_cache.c:839:35: warning: for loop has empty body [-Wempty-body]
               fcache = fcache->flink);

    bluetooth/bluetooth_finddev.c💯11: warning: implicit declaration of function 'memcmp' is invalid in C99 [-Wimplicit-function-declaration]
          if (BLUETOOTH_ADDRCMP(dev->d_mac.radio.nv_addr, match->bf_addr))
              ^

    rwbuffer.c:559:7: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
      if (rwb->rhmaxblocks > 0 && rwb->rhnblocks > 0)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2020-04-13 02:09:34 +08:00
raiden00pl abfb074110 libs/libdsp: fix nxstyle issues 2020-04-03 22:51:39 +01:00
YAMAMOTO Takashi 1ffa009c8b Revert "Don't generate .depend anymore"
This reverts commit 79af7fbf4e.

Because:

* btashton reported some issues in local builds:

  https://github.com/apache/incubator-nuttx/pull/603#issuecomment-602264860

* this might be related to the current CI breakage:

  > /bin/sh: 1: /__w/incubator-nuttx/incubator-nuttx/nuttx/tools/mkdeps: not found
2020-03-22 23:07:29 -05:00
Xiang Xiao 79af7fbf4e
Don't generate .depend anymore 2020-03-22 18:15:29 +00:00
Xiang Xiao bd4e8e19d3 Run codespell -w against all files
and fix the wrong correction
2020-02-22 14:45:07 -06:00
Juha Niskanen e8b5dd4528 Fix use of undefined pp-token #errror, other typos. 2019-09-19 18:19:18 -06:00
Mateusz Szafoni d2b98cc150 Merged in raiden00/nuttx_pe (pull request #771)
Use STM32 DMA IP core version instead of chip family names and some minor improvements

arch/arm/src/stm32/chip/stm32_adc.h: raise error if two IP cores seleceted

libs/libdsp/Kconfig: cosmetic change

arch/arm/src/stm32/Kconfig: hide TIMER menu, HRTIM menu and USB Host debug menu if peripherals not enabled

configs/stm32f429i-disco/highpri/defconfig: fix configuration warning

Approved-by: GregoryN <gnutt@nuttx.org>
2018-12-02 11:49:25 +00:00
Gregory Nutt 2722fd8192 tools/nxstyle.c: Add capability to detect multiple blank lines. Single spacing required by the coding standard. Also coding standard fixes to server .c files for problems found during testing nxstyle. 2018-08-24 05:51:44 -06:00
Mateusz Szafoni 078fd78af7 Merged in raiden00/nuttx (pull request #669)
libdsp/lib_motor.c: ouch, forgot to change variable name

* libdsp: initial commit

* libdsp: cosmetics

* stm32f334-disco/buckboost: use a PID controller from libdsp

* stm32_adc.h: fix typo

* stm32_dac.c: set OUTEN bit for DAC1CH2 and DAC2CH1

* stm32_hrtim: cosmetic changes

* power/motor: direction parameter is now int8 + add overload fault

* libdsp: all floats with f-sufix

    libdsp: add precision option for library

    libdsp: add debug option for library and assertions in functions

    libdsp: add current samples correction for SVM3

    libds: add some motor control specific functions

    libdsp: add basic speed observer

    libdsp: fix phase shift in SMO observer

    libdsp: add more logic to FOC

    config/sim/dsptest: add dsptest configuration

* libdsp/lib_motor.c: remove unused comparation

* libdsp/lib_observer.c: update some comments

* libdsp/lib_motor.c: ouch, forgot to change variable name

Approved-by: GregoryN <gnutt@nuttx.org>
2018-07-07 18:17:42 +00:00
Mateusz Szafoni 8416d9a966 Merged in raiden00/nuttx (pull request #668)
Master

* libdsp: initial commit

* libdsp: cosmetics

* stm32f334-disco/buckboost: use a PID controller from libdsp

* stm32_adc.h: fix typo

* stm32_dac.c: set OUTEN bit for DAC1CH2 and DAC2CH1

* stm32_hrtim: cosmetic changes

* power/motor: direction parameter is now int8 + add overload fault

* libdsp: all floats with f-sufix

    libdsp: add precision option for library

    libdsp: add debug option for library and assertions in functions

    libdsp: add current samples correction for SVM3

    libds: add some motor control specific functions

    libdsp: add basic speed observer

    libdsp: fix phase shift in SMO observer

    libdsp: add more logic to FOC

    config/sim/dsptest: add dsptest configuration

* libdsp/lib_motor.c: remove unused comparation

* libdsp/lib_observer.c: update some comments

Approved-by: GregoryN <gnutt@nuttx.org>
2018-07-07 17:04:57 +00:00
Gregory Nutt 1c4bdfd8fc libs/libdsp: Trivial typo fixes from review of last PR; hook README file into documentation. 2018-05-30 06:49:48 -06:00
Mateusz Szafoni b5ec5349b0 Merged in raiden00/nuttx (pull request #648)
libdsp: initial commit

* libdsp: initial commit

* libdsp: cosmetics

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-05-30 12:36:06 +00:00