Commit Graph

1406 Commits

Author SHA1 Message Date
Kenn Sebesta 6dbea7ed86 [MCPWM_FOC] Eliminate repeated divisions
`/((2.0/3.0) * v_bus)` is the same as `* 1.5/V_bus`. Abstracting this out
saves at least one division per loop, and in some cases as many as three.

Each STM32F4 FPU division takes 14 cycles.
2021-11-07 07:35:08 -05:00
Benjamin Vedder 258ad28566
Merge pull request #373 from ElwinBoots/Commenting
Add comments to the current loop
2021-11-06 13:22:55 +01:00
ElwinBoots bbb8a3d6a8 Added comments to the current loop 2021-11-05 07:32:08 +01:00
Benjamin Vedder e31cb50973 Moved LED control to its own thread 2021-11-01 08:52:18 +01:00
Benjamin Vedder d79d12a489 Fixed braking mode 2021-10-31 21:51:40 +01:00
Benjamin Vedder cd7a2d8ca1 Fixed build script 2021-10-31 18:03:43 +01:00
Benjamin Vedder 78e750a338 Scale down measured inductance. Read the comment for details. 2021-10-31 17:47:09 +01:00
Benjamin Vedder e9cf6eb4e8 Added fast moving average filter approximation, updated ADC app to use it 2021-10-31 13:40:43 +01:00
Benjamin Vedder 5304872a92 Added missing bracket from PR 2021-10-31 09:35:52 +01:00
Benjamin Vedder 09bd14072c Added COMM_BALANCE_SELFTEST 2021-10-30 21:46:35 +02:00
Benjamin Vedder 2018e92541
Merge pull request #369 from kubark42/convenience_laggards
[Convenience math] Catch a few laggards
2021-10-30 11:13:33 +02:00
Kenn Sebesta d97793bf7b
Update mcpwm_foc.c
Co-authored-by: kalvdans <github@kalvdans.no-ip.org>
2021-10-27 14:14:27 -04:00
Kenn Sebesta 0e58e29072 [MCPWM_FOC] Fix mislabeled variable
It's not estimated RPM, it's estimated rad/sec.
2021-10-27 14:09:10 -04:00
Kenn Sebesta 8de85899b7 [Convenience math] Capture a last couple laggards which were missed earlier 2021-10-27 14:08:35 -04:00
Benjamin Vedder 78887f35cf Added link to forum post as comment to explain factor 4 2021-10-25 12:39:54 +02:00
Benjamin Vedder 9046e4644b
Merge pull request #363 from TechAUmNu/dev_fw_5_03
Add A50S 6S and 12S hardware
2021-10-24 18:14:17 +02:00
Benjamin Vedder f1c4e713d7 Added MTPA modes 2021-10-24 18:10:00 +02:00
Benjamin Vedder 98587c961b Updated inductance calculation, include motor saliency in observer, separate setting for MTPA 2021-10-24 13:25:12 +02:00
Euan 49cfd795a3 Add A50S 6S and 12S hardware
Adds A50S.h/c and build script.
2021-10-20 10:57:11 +01:00
Benjamin Vedder 8f8d913419 Added raw sample mode 2021-10-18 21:45:47 +02:00
Benjamin Vedder d041761f0e Updated mcconf signature 2021-10-16 13:01:48 +02:00
Benjamin Vedder 7265f790c6 Updated changelog 2021-10-16 12:54:57 +02:00
Benjamin Vedder 8cf082e0e0 Better bus current estimation, HFI max voltage and duty scaling fix 2021-10-16 12:54:33 +02:00
Benjamin Vedder 1763fd59d3 Fixed loss calculation 2021-10-16 12:53:49 +02:00
Benjamin Vedder b1f564c3bb
Merge pull request #352 from kubark42/convenience_math
Use convenience macros for deg/rad conversions
2021-10-15 22:35:47 +02:00
Benjamin Vedder e8ae30c9d9 Merge branch 'dev_fw_5_03' of github.com:vedderb/bldc into dev_fw_5_03 2021-10-15 22:25:25 +02:00
Benjamin Vedder d8a99fd0f1 Inductance and resistance measurement and scaling fixes, various other fixes 2021-10-15 22:25:07 +02:00
Kenn Sebesta bec06ac85a [Utils] Change convenience multiplication factors into convenience MACROs 2021-10-13 14:18:05 -04:00
Kenn Sebesta aeb5d74488 [Utils] Use convenience macros for deg/rad conversions 2021-10-13 11:52:04 -04:00
Benjamin Vedder badaa2ff7d
Merge pull request #360 from avlasic/dev_fw_5_03_nrf
blackmagic: Support more nrf5 target revisions
2021-10-13 17:30:23 +02:00
Andrej Vlašić 378b1b7d20 blackmagic: Support more nrf5 target revisions 2021-10-13 15:14:53 +02:00
Benjamin Vedder b6eb5852aa
Merge pull request #346 from afzalmam/dev_fw_5_03
PAS: add constant torque control type
2021-10-11 10:08:24 +02:00
Benjamin Vedder 583f712424
Merge pull request #350 from dimpolo/mpu_status_fix
Fix wrong status in mpu_status terminal command
2021-10-10 18:04:37 +02:00
dimpolo 27782f23c3
Fix wrong status in mpu_status terminal command 2021-10-07 22:55:00 +02:00
Afzal b1ec844b2f PAS: add constant torque control type
For gearless electric bicycles, riding up the slope and during start,
good torque support from the motor helps the rider ride with less
effort. Pedal assist based on cadence provides higher torque with higher
pedalling speed. In the situations mentioned above, where user naturally
pedals slow, aid from cadence based system is less. On a geared setup,
changing to low gear comes to the rider's help.

Here another control type is provided - Constant Torque, whenever the
rider pedals, motor would provide constant torque. The torque value can
be set using 'PAS max current' setting thus acting as fine PAS assist
level.

This type of control is similar to 'Basic PAS, constant throttle' of
'PAS Control Schemes' [1], with the difference that throttle setting
in that article corresponds to speed, while here torque.

Also riding experience on some of the popular (not high end) e-bicycles
having PAS indicates they might be having this kind of control
internally.

[1] https://ebikes.ca/learn/pedal-assist.html
2021-10-05 13:05:31 +05:30
Benjamin Vedder c0fa922251
Merge pull request #344 from RadinnAB/bm_mem_write
blackmagic: Add cmd to write to target memory.
2021-10-02 09:30:33 +02:00
Johan Svard add855f6e6 blackmagic: Add cmd to write to target memory. 2021-10-01 16:29:57 +02:00
Benjamin Vedder 78e10ccb7b
Merge pull request #342 from tharon-rivera/dev_fw_5_03
Support for Spintend ubox single
2021-10-01 09:50:47 +02:00
Benjamin Vedder 6f1b674e22
Merge pull request #340 from mark99i/dev_fw_5_03
Fixes in traction control for scooters
2021-10-01 09:49:08 +02:00
Tharon Rivera 11ad3f862f Support for Spintend ubox single 2021-09-24 20:58:55 -04:00
Benjamin Vedder e7d22911f8 More stormcore power switch fixes 2021-09-15 18:46:08 +02:00
Benjamin Vedder 40ccb48beb Added another nrf revision to bm 2021-09-15 17:49:58 +02:00
Benjamin Vedder bec2534559 Fixed stormcore CAN shutdown 2021-09-15 17:49:09 +02:00
Benjamin Vedder d898d3bf9a Lowered default switching frequency 2021-09-15 17:48:44 +02:00
Mark 2f26f3af37 fixes in traction control for scooters 2021-09-09 01:16:58 +03:00
Benjamin Vedder 0109693e37 Changed CAN_PACKET_POLL_ROTOR_POS to respond with the controller id 2021-08-30 10:36:08 +02:00
Benjamin Vedder c3f397ae4c Added comments about the CAN packet types 2021-08-30 10:29:41 +02:00
Benjamin Vedder a970269a28 Moved CAN_PACKET_POLL_ROTOR_POS to addressed packets 2021-08-30 10:26:10 +02:00
Benjamin Vedder 0bc935b27f Added break to new can command 2021-08-30 10:21:39 +02:00
Benjamin Vedder dbeb8f08e2
Merge pull request #336 from manoukianv/PollEncoderOverCan
add CAN command CAN_PACKET_POLL_ROTOR_POS
2021-08-30 10:18:26 +02:00