Commit Graph

405 Commits

Author SHA1 Message Date
Marcos Chaparro d80227b9b4 Rename sin/cos m_conf structure fields
Use m_foc prefix so in VESC Tool they are edited in
FOC->Encoder.
Generate confgenerator.c and .h using VESC Tool.

Signed-off-by: Marcos Chaparro <mchaparro@powerdesigns.ca>
2019-04-08 21:05:46 -03:00
tipsmiller 3639c6c5f8 Remove custom app. Add new entry for adc ctrl type 2019-04-08 17:45:46 -06:00
Marcos Chaparro 8c4fc35ca0 Move sin/cos signal pin definitions to hwconf/
Signed-off-by: Marcos Chaparro <mchaparro@powerdesigns.ca>
2019-04-08 18:59:07 -03:00
tipsmiller 48a1e395dd Change HW version to 4.12. Working "clone" of app_adc as custom app. 2019-04-07 19:05:26 -06:00
Gavin Miller 32853a9c4c Copy functionality from app_adc 2019-04-07 13:51:25 -06:00
Marcos Chaparro 29934c90b6 Fix codacy warning
Signed-off-by: Marcos Chaparro <mchaparro@powerdesigns.ca>
2019-04-06 10:46:34 -03:00
Maximiliano Cordoba 4a94d0ec4c Add command to connect a virtual motor with configurable parameters
This commit adds a motor model running within the vesc firmware,and
from the vesc terminal a user or a test script can set the
mechanical load torque, inertia, phase resistance, Lq and Ld phase
inductances (this generic model includes IPM motors), flux linkage
and battery voltage.

Virtual motor parameters set at the command line should match with
vesc configuration, for example phase resistance, inductance and
flux linkage should match and have the correct observer gain.
Observer works with the virtual motor, with some hiccups during
startup
For solid results its better to use sensored mode. If vesc is
configured to use an SPI encoder the virtual motor phase angle
will be injected as an encoder angle readout.

For safety PWM outputs are disabled during simulation.

Signed-off-by: Maximiliano Cordoba <mcordoba@powerdesigns.ca>
2019-04-06 10:36:00 -03:00
Marcos Chaparro de707e0975 Add SinCos encoder checks and fault management
Sin/Cos signals are checked to make sure the module of the vector
is larger than 1V and smaller than 1.65V. A working encoder will
never have both sin and cos signals at 0V (zero amplitude module).
Both sin and cos at 3.3V is also not a possible value.

Errors are logged independently for signals too large and for
signals too small, provinding the user more insight when an encoder
fault happens. In the terminal, the 'encoder' command will show
the error counts and error rates of the encoder being used.

Signed-off-by: Marcos Chaparro <mchaparro@powerdesigns.ca>
2019-04-02 10:37:15 -03:00
Marcos Chaparro 153deef9af Add configurable low pass filtering to SinCos encoder analog signals
Signed-off-by: Marcos Chaparro <mchaparro@powerdesigns.ca>
2019-04-01 08:35:22 -03:00
Marcos Chaparro b155d5219a Basic SinCos encoder support
Reads sine and cosine on ADC_IND_EXT and ADC_IND_EXT2, usually
used for ACCEL and REGEN inputs. Provides offset and gain
compensation and is implemented using floating point math.

Note it includes the full mc_interface.h into encoder.c only
to access the ADC readings, and no filtering is performed on
the signals.

Signed-off-by: Marcos Chaparro <mchaparro@powerdesigns.ca>
2019-04-01 08:35:22 -03:00
Benjamin Vedder fb9442889a
Merge pull request #80 from paltatech/powerdesigns-revB-support
Extend support to older PowerDesigns RevB boards
2019-03-31 11:37:59 +02:00
Benjamin Vedder 75abfc2593 Made build script non-verbose and removed some codacy warnings 2019-03-31 11:21:28 +02:00
Benjamin Vedder 1161f8417c Added SWD programming support (based on Black Magic Probe) and open loop duty cycle control 2019-03-31 10:49:18 +02:00
Marcos Chaparro 3ab585cb9a Force high current measuments when using big powerstages
Signed-off-by: Marcos Chaparro <mchaparro@powerdesigns.ca>
2019-03-28 20:33:21 -03:00
Marcos Chaparro b2311b9eca Extend support to older PowerDesigns RevB boards
Signed-off-by: Marcos Chaparro <mchaparro@powerdesigns.ca>
2019-03-25 18:02:26 -03:00
Benjamin Vedder 39bb8a6b09 FW 3.53: Limit foc_current_filter_const range, 1Mbit/de NRF speed, lower detect f_sw for resistance, no temp_comp by default 2019-03-20 22:46:36 +01:00
Benjamin Vedder 3bf1c13b76 Added missing firmwares 2019-03-10 15:22:27 +01:00
Benjamin Vedder 0bf3cc65ed Fixed codacy warnings 2019-03-10 15:19:05 +01:00
Benjamin Vedder 65298263b6 75/300 R2 support, terminal sync cmd, IMU support, option to disable permanent UART, collected timer functions in one place 2019-03-10 14:57:42 +01:00
Benjamin Vedder 0db2f200f6 Updated some comments in commands to make it easier to follow 2019-03-05 07:33:31 +01:00
Benjamin Vedder 9cbddf4066 Increased AS5047 error rate threshold 2019-03-04 20:05:20 +01:00
Benjamin Vedder aa13c3b345 Fixed build with servo out enabled, added prebuild firmwares 2019-03-04 19:29:05 +01:00
Benjamin Vedder 35c1c72ab4 Commands restructuring for thread safety, 75/300 vreg fix, fixed relative current commands 2019-03-04 19:23:38 +01:00
Benjamin Vedder 01e72eb555 Autogenerated config parsing with signatures, fixed previous PRs 2019-03-01 21:36:58 +01:00
Benjamin Vedder a8b3f9d3e1 Merge branch 'master' of https://github.com/vedderb/bldc 2019-03-01 17:18:43 +01:00
Benjamin Vedder 2584774d4a
Merge pull request #72 from Flytrex/encoder-check-PR
AS5047 encoder parity check
2019-03-01 17:18:33 +01:00
Benjamin Vedder f9ce429447 Ramping updates 2019-03-01 17:18:07 +01:00
vadim e70be9e17a filter out zero encoder reading - can be caused by gnd short 2019-03-01 11:45:34 +02:00
vadim 8cc3ea519a update the help text for the terminal with the new encoder command 2019-03-01 11:00:32 +02:00
vadim 611ad1e1d1 reset the erro rate in encoder deinint as well 2019-02-28 19:31:27 +02:00
vadim 9488eb9008 moved encoder fault triggering to timer thread, added FOC mode check 2019-02-28 18:58:17 +02:00
vadim c7515fbda5 reset error rate when initializing encoder 2019-02-28 11:08:09 +02:00
vadim f668b89db5 trigger a fault when AS5047 encoder SPI communication is broken 2019-02-25 14:43:02 +02:00
vadim 5b09d687b8 debug function for encoder CRC 2019-02-25 14:37:54 +02:00
vadim 46d9361886 reject encoder readings with bad CRC 2019-02-25 14:34:17 +02:00
Benjamin Vedder cf949d00c0
Update README.md 2019-02-20 09:46:50 +01:00
Benjamin Vedder a70fad1861 Updated Travis CI badge 2019-02-19 23:14:54 +01:00
Benjamin Vedder 5e4d35a854 Fix issue 47 2019-02-19 22:18:30 +01:00
Benjamin Vedder 18b79a3a09 Fixed some issues found by codacy 2019-02-19 22:06:34 +01:00
Benjamin Vedder d50b4b5fc3 Updated codacy badge 2019-02-19 21:35:03 +01:00
Benjamin Vedder c76942009b Some fixes after the merge 2019-02-19 18:55:18 +01:00
Benjamin Vedder a546cc4dd5
Merge pull request #71 from paltatech/powerdesigns-dev
Powerdesigns dev
2019-02-19 17:57:59 +01:00
Marcos Chaparro 723abcb09f Remove ST DAC library and use the DAC by direct register access
Signed-off-by: Marcos Chaparro <mchaparro@powerdesigns.ca>
2019-02-19 11:40:49 -03:00
Marcos Chaparro 761c490fdd Calculate deadtime for gpdrive.c
Signed-off-by: Marcos Chaparro <mchaparro@powerdesigns.ca>
2019-02-19 11:01:28 -03:00
Marcos Chaparro 93ebffa2ee Avoid watchdog resets if CAN is not used
Signed-off-by: Marcos Chaparro <mchaparro@powerdesigns.ca>
2019-02-19 10:59:38 -03:00
Marcos Chaparro b344e873b6 Remove duplicated flux linkage detection function
Signed-off-by: Marcos Chaparro <mchaparro@powerdesigns.ca>
2019-02-19 10:55:40 -03:00
Marcos Chaparro 32cf05629d Resolve merge conficts with major 2019 release
Signed-off-by: Marcos Chaparro <mchaparro@powerdesigns.ca>
2019-02-18 20:25:52 -03:00
Benjamin Vedder 123bb00ab4 Major 2019 update 2019-02-18 19:30:19 +01:00
Marcos Chaparro fe0984c5d1 Add HW_VERSION_PALTA to CI build
Signed-off-by: Marcos Chaparro <mchaparro@powerdesigns.ca>
2019-02-02 12:12:47 -03:00
Marcos Chaparro 80c34d17f6 Add conf_general_calculate_deadtime declaration
Signed-off-by: Marcos Chaparro <mchaparro@powerdesigns.ca>
2019-02-01 07:03:37 -03:00