Commit Graph

38 Commits

Author SHA1 Message Date
raiden00pl 105e4f44d4 libdsp: fix gcc14 error and clean up includes 2024-06-02 09:27:36 -03:00
raiden00pl 93312c6196 libdsp: update LP_FILTER comment
add note about filter time constant (tau)
2023-10-19 21:38:45 +08:00
Alan Carvalho de Assis 69081a72d7 libdsp: Add average filter
This commit add average filter to DSP library
2023-06-12 08:39:38 +02:00
Fotis Panagiotopoulos 85ceb7920e Typo fixes. 2023-02-17 11:17:11 -03: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 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
baggio63446333 917f1a64ad libdsp: Fix compile error with the standard math library
The libdsp uses M_PI_F and M_PI_2_F which are defined only in the NuttX
math library. Fix an compile error when CONFIG_LIBM is disabled and the
other math library is used.
2021-12-02 12:49:27 +01:00
Nathan Hartman 609ee6b54b Fix typos in comments and identifiers 2021-07-19 22:55:30 -03:00
raiden00pl 781cd3f65b libdsp: fix typos 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 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 1e02175ae7 include/dsp.h: add DIR_NONE definition 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 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 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
raiden00pl 24e17910b2 libdsp: Changed headers for apache 2.0 license 2020-10-10 12:24:28 -06:00
Xiang Xiao 06972c02f1 dps.h: Remove CONFIG_LIBM and CONFIG_ARCH_MATH_H
since the user may use math library from toolchain directly

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I67ccc4830403e3c15a84a8f9b1420d9a10894ddf
2020-05-31 14:09:03 -06:00
Xiang Xiao eca7059785 Refine __KERNEL__ and CONFIG_BUILD_xxx usage in the code base
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-01 10:43:47 -03:00
raiden00pl abfb074110 libs/libdsp: fix nxstyle issues 2020-04-03 22:51:39 +01:00
Xiang Xiao cde88cabcc Run codespell -w with the latest dictonary again
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-02-23 22:27:46 +01: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 5c853cd1dc libs/libc/unistd/lib_getcwd.c: remove stray sched_unlock(). Also fixes several typos. 2019-09-20 06:23:48 -06:00
raiden00pl f841175540 Merged in raiden00/nuttx_pe (pull request #822)
Improvements for STM32 PWM

arch/arm/src/stm32/stm32_pwm: fix polarity and IDLE state configuration for advanced timer PWM

include/dsp.h: raise error if math.h not present

Approved-by: GregoryN <gnutt@nuttx.org>
2019-01-23 17:52:27 +00:00
MYAPICI 3dd479d1b9 include/dsp.h: Fix missing semicolon error in dsp.h 2019-01-07 07:27:40 -06:00
Gregory Nutt 9157422312 include/dsp.h: Add extern C support for use with C++ 2018-08-23 12:54:13 -06: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
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