Speeduino
Loading...
Searching...
No Matches
Macros | Typedefs | Functions | Variables
crankMaths.cpp File Reference
#include "globals.h"
#include "crankMaths.h"
#include "bit_shifts.h"

Macros

#define SECOND_DERIV_ENABLED   0
 

Typedefs

typedef uint32_t UQ24X8_t
 
typedef uint16_t UQ1X15_t
 

Functions

void setAngleConverterRevolutionTime (uint32_t revolutionTime)
 Set the revolution time, from which some of the degree<-->angle conversions are derived.
 
uint32_t angleToTimeMicroSecPerDegree (uint16_t angle)
 
uint16_t timeToAngleDegPerMicroSec (uint32_t time)
 

Variables

static constexpr uint8_t UQ24X8_Shift = 8U
 
static UQ24X8_t microsPerDegree
 uS per degree at current RPM in UQ24.8 fixed point
 
static constexpr uint8_t microsPerDegree_Shift = UQ24X8_Shift
 
static constexpr uint8_t UQ1X15_Shift = 15U
 
static UQ1X15_t degreesPerMicro
 Degrees per uS in UQ1.15 fixed point.
 
static constexpr uint8_t degreesPerMicro_Shift = UQ1X15_Shift
 

Macro Definition Documentation

◆ SECOND_DERIV_ENABLED

#define SECOND_DERIV_ENABLED   0

Typedef Documentation

◆ UQ1X15_t

◆ UQ24X8_t

Function Documentation

◆ angleToTimeMicroSecPerDegree()

uint32_t angleToTimeMicroSecPerDegree ( uint16_t  angle)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setAngleConverterRevolutionTime()

void setAngleConverterRevolutionTime ( uint32_t  revolutionTime)

Set the revolution time, from which some of the degree<-->angle conversions are derived.

Parameters
revolutionTimeThe crank revolution time.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ timeToAngleDegPerMicroSec()

uint16_t timeToAngleDegPerMicroSec ( uint32_t  time)
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ degreesPerMicro

UQ1X15_t degreesPerMicro
static

Degrees per uS in UQ1.15 fixed point.

Ranges from 8 (0.000246) at MIN_RPM to 3542 (0.108) at MAX_RPM

◆ degreesPerMicro_Shift

constexpr uint8_t degreesPerMicro_Shift = UQ1X15_Shift
staticconstexpr

◆ microsPerDegree

UQ24X8_t microsPerDegree
static

uS per degree at current RPM in UQ24.8 fixed point

◆ microsPerDegree_Shift

constexpr uint8_t microsPerDegree_Shift = UQ24X8_Shift
staticconstexpr

◆ UQ1X15_Shift

constexpr uint8_t UQ1X15_Shift = 15U
staticconstexpr

◆ UQ24X8_Shift

constexpr uint8_t UQ24X8_Shift = 8U
staticconstexpr