Commit Graph

92 Commits

Author SHA1 Message Date
raiden00pl
9ba7092000 examples/foc: add support for control loop performance measurements
also format CMakeLists.txt
2023-11-06 09:02:28 +08:00
raiden00pl
73ab7dedd4 examples/foc: refactor control loop
1. get FOC device state at the beginning of the loop
2. simplify if-else block
2023-11-05 13:56:52 +08:00
raiden00pl
7e918964e4 remove examples/xxx/README.md. Migrated to Documentation/applications/examples
part of examples/bastest is moved to examples/bastest.testcases.md
2023-10-30 10:00:01 +08:00
raiden00pl
292b0cbc28 examples/foc: change the velocity ramp parameters scale to x1
controlling the ramp with greather accuracy makes no practical sense
2023-10-29 10:40:27 +08:00
raiden00pl
8568439b80 examples/foc: configure acceleration and deceleration from command line 2023-10-29 10:40:27 +08:00
raiden00pl
aad2bcb621 examples/foc: use the current configuration values when printing the help message
This is useful when tuning the controller and running application many times with different parameters from the NSH
2023-10-19 19:18:48 -04:00
raiden00pl
1c922f2d2d examples/foc: add phase angle observer support (sensorless mode)
This app can work now as sensorless ESC.

Also introduce a cmd line option that force open-loop control
which is useful when tuning angle/velocity observers
2023-10-19 19:33:43 +08:00
raiden00pl
8398297518 examples/foc: add an option to call nxscope work from control thread
This alows nxscope data to be sent with every cycle of the control loop,
which increases the execution time of the control loop, but allows data
to be sent at a highier frequency using the small nxscope buffer.

Useful when tuning and debuging using RTT transfer.
2023-10-19 01:24:07 +08:00
raiden00pl
4652c5516d examples/foc: rename SETPOINT_ADC_SCALE to SETPOINT_INTF_SCALE
SETPOINT_INTF_SCALE is more appropriate name because this definition is not only used for ADC scale
2023-10-18 14:15:47 +08:00
raiden00pl
de6a384668 examples/foc: add velocity PI controller 2023-10-18 14:15:12 +08:00
raiden00pl
9dde6983e6 examples/foc: add support for feedforward compensation 2023-10-17 22:45:26 +08:00
raiden00pl
c8a4abfcb2 examples/foc: remove align configuration checks
these are already done when you configure the align routine
2023-10-17 22:42:42 +08:00
raiden00pl
fd0da7d4df examples/foc: open-loop needs initial phase alignment 2023-10-17 22:42:42 +08:00
raiden00pl
8e0819df04 examples/foc: add velocity observers 2023-10-17 22:42:42 +08:00
raiden00pl
9bcca69967 examples/foc: initialize motor phy 2023-10-17 22:42:42 +08:00
raiden00pl
9ee4daea43 examples/foc: configure active breake current 2023-10-17 14:24:58 +08:00
raiden00pl
e8ff9ad005 foc/example/Kconfig: cosmetics 2023-10-17 14:23:42 +08:00
raiden00pl
969607ac44 examples/foc: fix setpoint scale for char interface 2023-10-17 14:23:42 +08:00
raiden00pl
4c4976a4e9 examples/foc: add warning if no controller enabled 2023-10-17 14:23:42 +08:00
raiden00pl
5dd4813b34 examples/foc: fix wrong nxscope functions for fixed16 2023-10-16 13:53:40 -04:00
raiden00pl
8ee684e586 industry/foc: make direction alignment configurable
for sensorless velocity controller (ESC) we don't need to align the direction,
but we have to align the initial motor phase each time the motor start
2023-10-16 13:44:37 -04:00
raiden00pl
b88057fffd examples/foc: support svm3 state with nxscope 2023-10-05 20:42:46 +08:00
raiden00pl
a56f0922c5 industrial/foc: add an interface that returns the modulation state
Useful for debugging and demonstrating FOC operation
2023-10-05 20:42:46 +08:00
raiden00pl
5cbd9b2b7b examples/foc: allow nxscope transfer over RTT interface
For UART serial interface TERMIOS is required, but for RTT serial interface it's not.
2023-10-02 21:46:52 +03:00
Xiang Xiao
8083b094c3 Kconfig: Simplify the conditional default statement
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-25 09:51:09 +08:00
raiden00pl
ed370ec674 cmake: port nxscope and foc and add missing directories 2023-07-14 22:04:35 +08:00
raiden00pl
7e5a436ff9 examples/foc: add real time data capture with the NxScope library 2023-05-19 20:18:38 +08:00
raiden00pl
55b296a5c6 examples/foc/foc_thr: get controller type from controller ID 2023-05-19 20:18:38 +08:00
raiden00pl
54bcf3afdd examples/foc/foc_thr: fix mutex logic 2023-05-19 20:18:38 +08:00
raiden00pl
111e02dbdb examples/foc: improve the readability of the motor structures 2023-05-17 13:45:24 +08:00
raiden00pl
caba5a0a6f examples/foc: add missing deinit calls 2023-05-15 13:19:34 -03:00
raiden00pl
f358bdfcb3 examples/foc: send messages only to active control threads 2023-05-15 13:19:34 -03:00
raiden00pl
beb5369a0d examples/foc/foc_main.c: fix de-initialization sequence 2023-05-15 13:19:34 -03:00
raiden00pl
cc189ef170 examples/foc: add controller IDLE mode 2023-05-15 13:19:34 -03:00
Xiang Xiao
7c37421266 Replace all sprintf with snprintf
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-08 21:35:16 +03:00
Gustavo Henrique Nihei
efb4e0bc91 Add another batch of missing headers throughout the repository
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-03-28 14:54:16 -03:00
Xiang Xiao
21bc466a2b Remove the tail space char from all files
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-03 00:18:36 +02:00
Xiang Xiao
a29d9ea9da fsutils/examples: Include unistd.h explicitly
to get the prototypes or macros are defined in it

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-05 08:46:59 +02:00
Xiang Xiao
81de5d4c59 Fix foc_fixed16_thr.c:188:27: error: variable 'time' set but not used
and foc_float_thr.c:189:27: error: variable 'time' set but not used

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-19 18:47:41 +01:00
raiden00pl
13bfad1053 examples/foc: control motor identification parameters from cmd line 2022-11-04 02:07:15 +08:00
raiden00pl
682cac07d9 examples/foc/Kconfig: update EXAMPLES_FOC_MMODE range 2022-11-04 02:07:15 +08:00
raiden00pl
2bbfb1b396 examples/foc: move validate_args to parseargs file 2022-11-04 02:07:15 +08:00
raiden00pl
2c5dc1e4a2 examples/foc: simplify control thread configuration 2022-11-04 02:07:15 +08:00
raiden00pl
b1f91528ec examples/foc: separate control thread configuration from general args 2022-11-04 02:07:15 +08:00
raiden00pl
c2efa80969 examples/foc: refactor args 2022-11-04 02:07:15 +08:00
raiden00pl
8d61a10a74 industry/foc/foc_ident: make the Ki resistance measurement parameter configurable
The hardcoded parameter may not be suitable for various types of motors
2022-10-24 01:14:52 +08:00
Petro Karashchenko
0fe45a4c73 Revert "Revert "examples/foc: fix description in Kconfig""
This reverts commit 1a18703a42.
2022-10-24 01:13:27 +08:00
Petro Karashchenko
1a18703a42 Revert "examples/foc: fix description in Kconfig"
This reverts commit eca51e267f.
2022-10-23 08:29:01 +02:00
Petro Karashchenko
eca51e267f examples/foc: fix description in Kconfig
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-10-23 11:45:52 +08:00
Xiang Xiao
893387b2c5 Fix the minor style issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 19:07:16 +02:00