|
brazos-trapezoidal
|
This module treats analog conversions for motor control. More...
#include "uc.h"#include "Compiler_defs.h"#include "C_Extensions.h"#include "SRMicro.h"#include "SRMCAtod.h"
Go to the source code of this file.
Classes | |
| struct | ANALOG_REF_TYPE |
Macros | |
| #define | US10 167U |
| #define | FILTER_FC_HZ 212 |
| #define | FILTER_FS_HZ 1000 |
| #define | FILTER_TAU (1/(2*3.1416*FILTER_FC_HZ)) |
| #define | FILTER_TS (1.0f/FILTER_FS_HZ) |
Functions | |
| float | SRCalcLPKT (float tau, float tc) |
| void | SRMCAtod__Initialize (void) |
| void | SRMCAtod__ISR (void) |
| void | SRMCAtod__ISR2 (void) |
| void | SRMCAtod__DiagnosticHandler (void) |
| void | SRMCAtod__EnableDiagnostic (signed short int commanded_threshold) |
| SRMCATOD_DIAG_ERROR_TYPE | SRMCAtod__GetDiagnosticFeedback (void) |
| void | SRMCAtod__InitReadVref (void) |
| It read the Vref voltage at the start up. More... | |
| void | SRMCAtod__Read_Vref (void) |
| voltage reference reading, filtering and A/D conversion constants correction More... | |
| float | SRMCAtod__GetKRef (void) |
| This function is used to get the ad correction related the VREF. More... | |
Variables | |
| float | SR_Off_Ulpkt |
| current offsets filter time constant (1/x) More... | |
| float | SR_Vr_Ulpkt |
| reference voltage filter time constant (1/x) More... | |
| float | NSR_Vr_Ulpkt |
| ANALOG_REF_TYPE | SR_AdRef |
| ANALOG_REF_TYPE | NSR_AdRef |
| volatile unsigned short | ForcedCurrA |
This module treats analog conversions for motor control.
Analog conversions are triggered by MTU4 timer event in order minimize ringing noise. Trigger for all 3 currents and DC bus voltage occur at the same time
Definition in file SRMCAtod.c.
| #define FILTER_FC_HZ 212 |
Definition at line 23 of file SRMCAtod.c.
| #define FILTER_FS_HZ 1000 |
Definition at line 24 of file SRMCAtod.c.
| #define FILTER_TAU (1/(2*3.1416*FILTER_FC_HZ)) |
Definition at line 25 of file SRMCAtod.c.
| #define FILTER_TS (1.0f/FILTER_FS_HZ) |
Definition at line 26 of file SRMCAtod.c.
| #define US10 167U |
Definition at line 21 of file SRMCAtod.c.
| void SRMCAtod__DiagnosticHandler | ( | void | ) |
This function is a handler used to check 12 bits AD registers and converters status. May be used to test stuck at register failure and conversion errors. Checks all converters with all possible fixed values. this handler has no time dependency, may be used on handlers at 16KHz, 250us, 1ms 5ms or 25ms. Use functions to start tests and get feedbacks
Definition at line 162 of file SRMCAtod.c.
| void SRMCAtod__EnableDiagnostic | ( | signed short int | commanded_threshold | ) |
This function is a handler used to start checking 12 bits AD registers and converters status. Only restarts if feedback was updated or it's waiting for a check request.
Definition at line 171 of file SRMCAtod.c.
| SRMCATOD_DIAG_ERROR_TYPE SRMCAtod__GetDiagnosticFeedback | ( | void | ) |
This function gets converters status.
Definition at line 181 of file SRMCAtod.c.
| float SRMCAtod__GetKRef | ( | void | ) |
This function is used to get the ad correction related the VREF.
Definition at line 280 of file SRMCAtod.c.
| void SRMCAtod__Initialize | ( | void | ) |
It Initializes the module MCAtod peripheral and its variables. All 12 bits channels are converted when MTU4 TADCORB register matches with TCNT.
Definition at line 67 of file SRMCAtod.c.
| void SRMCAtod__InitReadVref | ( | void | ) |
It read the Vref voltage at the start up.
Definition at line 258 of file SRMCAtod.c.
| void SRMCAtod__ISR | ( | void | ) |
Definition at line 76 of file SRMCAtod.c.
| void SRMCAtod__ISR2 | ( | void | ) |
Definition at line 120 of file SRMCAtod.c.
| void SRMCAtod__Read_Vref | ( | void | ) |
voltage reference reading, filtering and A/D conversion constants correction
Definition at line 269 of file SRMCAtod.c.
| volatile unsigned short ForcedCurrA |
End of engine 0 conversion. This is supposed to be simultaneous to the end of engine 1, since they are triggered together.
Definition at line 75 of file SRMCAtod.c.
| ANALOG_REF_TYPE NSR_AdRef |
Definition at line 42 of file SRMCAtod.c.
| float NSR_Vr_Ulpkt |
Definition at line 40 of file SRMCAtod.c.
| ANALOG_REF_TYPE SR_AdRef |
Definition at line 42 of file SRMCAtod.c.
| float SR_Off_Ulpkt |
current offsets filter time constant (1/x)
Definition at line 38 of file SRMCAtod.c.
| float SR_Vr_Ulpkt |
reference voltage filter time constant (1/x)
Definition at line 40 of file SRMCAtod.c.