Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.15.0 #110

Merged
merged 13 commits into from
Jul 3, 2024
Merged
19 changes: 4 additions & 15 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
### Changes this version:
- TMC E-Stop handled even during calibration by pausing and disabling driver
- E-Stop checked correctly after startup. You can now disable force and delay startup by setting E-Stop during startup.
- Digital and Analog sources are disabled by default
- Biss-C 1 rotation offset glitch at first packet fixed
- Reverted CAN retransmission to enabled temporarily. Fixes 2 axis ODrive issues.

### Changes since v1.14.0
- Save TMC space vector PWM mode in flash. Should be usually on for BLDC motors if the star point is isolated.
- Allow using the motors flux component to dissipate energy with the TMC4671 instead of the brake resistor. May cause noticable braking in the motor but takes stress off the resistor.
- Axis speed limiter usable and saved in flash.
- Removed unused hall direction flash setting.
- Added local button pulse mode
- Only activate brake resistor if vint and vext are >6.5V. Prevents board from activating resistor if only usb powered and a fault reset loop
- Changed behaviour of direction enable and axis enable bits in set_effect report to always apply direction vector
- Fix for Forza Motorsport
- Added independend friction and inertia effects to axis
- ODrive class can save encoder position offset
- Reverted the forza fix for 2 axis setups.
- TODO: test and report if behaviour works for all games with the angle always being used for 1 axis modes (Games must send 90° on X axis effects instead of 0°).
2 changes: 1 addition & 1 deletion Configurator
18 changes: 15 additions & 3 deletions Firmware/FFBoard/Inc/Axis.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "FastAvg.h"

#define INTERNAL_AXIS_DAMPER_SCALER 0.7
#define INTERNAL_AXIS_FRICTION_SCALER 0.7
#define INTERNAL_AXIS_INERTIA_SCALER 0.7


struct Control_t {
Expand All @@ -48,6 +50,7 @@ struct AxisFlashAddrs
uint16_t power = ADR_AXIS1_POWER;
uint16_t degrees = ADR_AXIS1_DEGREES;
uint16_t effects1 = ADR_AXIS1_EFFECTS1;
uint16_t effects2 = ADR_AXIS1_EFFECTS2;
uint16_t encoderRatio = ADR_AXIS1_ENC_RATIO;

uint16_t speedAccelFilter = ADR_AXIS1_SPEEDACCEL_FILTER;
Expand Down Expand Up @@ -84,7 +87,7 @@ struct GearRatio_t{
enum class Axis_commands : uint32_t{
power=0x00,degrees=0x01,esgain,zeroenc,invert,idlespring,axisdamper,enctype,drvtype,
pos,maxspeed,maxtorquerate,fxratio,curtorque,curpos,curspd,curaccel,reductionScaler,
filterSpeed, filterAccel, filterProfileId,cpr
filterSpeed, filterAccel, filterProfileId,cpr,axisfriction,axisinertia
};

class Axis : public PersistentStorage, public CommandHandler, public ErrorHandler
Expand Down Expand Up @@ -146,7 +149,7 @@ class Axis : public PersistentStorage, public CommandHandler, public ErrorHandle
void updateMetrics(float new_pos);
int32_t updateIdleSpringForce();
void setIdleSpringStrength(uint8_t spring);
void setDamperStrength(uint8_t damper);
void setFxStrengthAndFilter(uint8_t val,uint8_t& valToSet, Biquad& filter);
void calculateAxisEffects(bool ffb_on);
int32_t getTorque(); // current torque scaled as a 32 bit signed value
int16_t updateEndstop();
Expand All @@ -164,6 +167,7 @@ class Axis : public PersistentStorage, public CommandHandler, public ErrorHandle
private:
// Axis damper is lower than default scale of HID Damper
const float AXIS_DAMPER_RATIO = INTERNAL_SCALER_DAMPER * INTERNAL_AXIS_DAMPER_SCALER / 255.0;
const float AXIS_INERTIA_RATIO = INTERNAL_SCALER_INERTIA * INTERNAL_AXIS_INERTIA_SCALER / 255.0;

AxisFlashAddrs flashAddrs;
volatile Control_t* control;
Expand Down Expand Up @@ -254,15 +258,23 @@ class Axis : public PersistentStorage, public CommandHandler, public ErrorHandle
const biquad_constant_t filterSpeedCst[4] = {{ 30, 55 }, { 60, 55 }, { 120, 55 }, {120, 55}};
const biquad_constant_t filterAccelCst[4] = {{ 40, 30 }, { 55, 30 }, { 70, 30 }, {120, 55}};
const biquad_constant_t filterDamperCst = {60, 55};
const biquad_constant_t filterFrictionCst = {50, 20};
const biquad_constant_t filterInertiaCst = {20, 20};
uint8_t filterProfileId = 1; // Default medium (1) as this is the most common encoder resolution and users can go lower or higher if required.
const float filter_f = 1000; // 1khz
const int32_t damperClip = 20000;
const int32_t intFxClip = 20000;
uint8_t damperIntensity = 30;
FastAvg<float,5> spdlimiterAvg;

uint8_t frictionIntensity = 0;
uint8_t inertiaIntensity = 0;

Biquad speedFilter = Biquad(BiquadType::lowpass, filterSpeedCst[filterProfileId].freq/filter_f, filterSpeedCst[filterProfileId].q/100.0, 0.0);
Biquad accelFilter = Biquad(BiquadType::lowpass, filterAccelCst[filterProfileId].freq/filter_f, filterAccelCst[filterProfileId].q/100.0, 0.0);
Biquad damperFilter = Biquad(BiquadType::lowpass, filterDamperCst.freq/filter_f, filterDamperCst.q / 100.0, 0.0); // enable on class constructor
Biquad frictionFilter = Biquad(BiquadType::lowpass, filterFrictionCst.freq/filter_f, filterFrictionCst.q / 100.0, 0.0); // enable on class constructor
Biquad inertiaFilter = Biquad(BiquadType::lowpass, filterInertiaCst.freq/filter_f, filterInertiaCst.q / 100.0, 0.0); // enable on class constructor


void setFxRatio(uint8_t val);
void updateTorqueScaler();
Expand Down
8 changes: 7 additions & 1 deletion Firmware/FFBoard/Inc/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@
* For more settings see target_constants.h in a target specific folder
*/

static const uint8_t SW_VERSION_INT[3] = {1,14,4}; // Version as array. 8 bit each!
static const uint8_t SW_VERSION_INT[3] = {1,15,0}; // Version as array. 8 bit each!
#ifndef MAX_AXIS
#define MAX_AXIS 2 // ONLY USE 2 for now else screws HID Reports
#endif
#if !(MAX_AXIS > 0 && MAX_AXIS <= 3)
#error "MAX_AXIS must be between 1 and 3"
#endif

#define FLASH_VERSION 0 // Counter to increase whenever a full flash erase is required.

//#define DEBUGLOG // Uncomment to enable some debug printouts
Expand Down
2 changes: 0 additions & 2 deletions Firmware/FFBoard/Src/AxesManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ bool AxesManager::setAxisCount(int8_t count) {
if (!this->validAxisRange(count)) {
return false; // invalid number of axis
}
// Really need to use some form of mutex
Flash_Write(ADR_AXIS_COUNT, count);

while (count < axis_count) {
uint8_t pos = axis_count-1;
Expand Down
81 changes: 67 additions & 14 deletions Firmware/FFBoard/Src/Axis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,22 @@ Axis::Axis(char axis,volatile Control_t* control) :CommandHandler("axis", CLSID_
drv_chooser = ClassChooser<MotorDriver>(axis1_drivers);
setInstance(0);
this->flashAddrs = AxisFlashAddrs({ADR_AXIS1_CONFIG, ADR_AXIS1_MAX_SPEED, ADR_AXIS1_MAX_ACCEL,
ADR_AXIS1_ENDSTOP, ADR_AXIS1_POWER, ADR_AXIS1_DEGREES,ADR_AXIS1_EFFECTS1,ADR_AXIS1_ENC_RATIO,
ADR_AXIS1_ENDSTOP, ADR_AXIS1_POWER, ADR_AXIS1_DEGREES,ADR_AXIS1_EFFECTS1,ADR_AXIS1_EFFECTS2,ADR_AXIS1_ENC_RATIO,
ADR_AXIS1_SPEEDACCEL_FILTER});
}
else if (axis == 'Y')
{
drv_chooser = ClassChooser<MotorDriver>(axis2_drivers);
setInstance(1);
this->flashAddrs = AxisFlashAddrs({ADR_AXIS2_CONFIG, ADR_AXIS2_MAX_SPEED, ADR_AXIS2_MAX_ACCEL,
ADR_AXIS2_ENDSTOP, ADR_AXIS2_POWER, ADR_AXIS2_DEGREES,ADR_AXIS2_EFFECTS1, ADR_AXIS2_ENC_RATIO,
ADR_AXIS2_ENDSTOP, ADR_AXIS2_POWER, ADR_AXIS2_DEGREES,ADR_AXIS2_EFFECTS1,ADR_AXIS2_EFFECTS2, ADR_AXIS2_ENC_RATIO,
ADR_AXIS2_SPEEDACCEL_FILTER});
}
else if (axis == 'Z')
{
setInstance(2);
this->flashAddrs = AxisFlashAddrs({ADR_AXIS3_CONFIG, ADR_AXIS3_MAX_SPEED, ADR_AXIS3_MAX_ACCEL,
ADR_AXIS3_ENDSTOP, ADR_AXIS3_POWER, ADR_AXIS3_DEGREES,ADR_AXIS3_EFFECTS1,ADR_AXIS3_ENC_RATIO,
ADR_AXIS3_ENDSTOP, ADR_AXIS3_POWER, ADR_AXIS3_DEGREES,ADR_AXIS3_EFFECTS1,ADR_AXIS3_EFFECTS2,ADR_AXIS3_ENC_RATIO,
ADR_AXIS3_SPEEDACCEL_FILTER});
}

Expand Down Expand Up @@ -131,6 +131,8 @@ void Axis::registerCommands(){
registerCommand("invert", Axis_commands::invert, "Invert axis",CMDFLAG_GET | CMDFLAG_SET);
registerCommand("idlespring", Axis_commands::idlespring, "Idle spring strength",CMDFLAG_GET | CMDFLAG_SET);
registerCommand("axisdamper", Axis_commands::axisdamper, "Independent damper effect",CMDFLAG_GET | CMDFLAG_SET);
registerCommand("axisfriction", Axis_commands::axisfriction, "Independent friction effect",CMDFLAG_GET | CMDFLAG_SET);
registerCommand("axisinertia", Axis_commands::axisinertia, "Independent inertia effect",CMDFLAG_GET | CMDFLAG_SET);
registerCommand("enctype", Axis_commands::enctype, "Encoder type get/set/list",CMDFLAG_GET | CMDFLAG_SET | CMDFLAG_INFOSTRING);
registerCommand("drvtype", Axis_commands::drvtype, "Motor driver type get/set/list",CMDFLAG_GET | CMDFLAG_SET | CMDFLAG_INFOSTRING);
registerCommand("pos", Axis_commands::pos, "Encoder position",CMDFLAG_GET);
Expand Down Expand Up @@ -200,7 +202,12 @@ void Axis::restoreFlash(){
uint16_t effects;
if(Flash_Read(flashAddrs.effects1, &effects)){
setIdleSpringStrength(effects & 0xff);
setDamperStrength((effects >> 8) & 0xff);
setFxStrengthAndFilter((effects >> 8) & 0xff,damperIntensity,damperFilter);
}

if(Flash_Read(flashAddrs.effects2, &effects)){
setFxStrengthAndFilter(effects & 0xff,frictionIntensity,frictionFilter);
setFxStrengthAndFilter((effects >> 8) & 0xff,inertiaIntensity,inertiaFilter);
}

uint16_t ratio;
Expand Down Expand Up @@ -231,6 +238,7 @@ void Axis::saveFlash(){
Flash_Write(flashAddrs.power, power);
Flash_Write(flashAddrs.degrees, (degreesOfRotation & 0x7fff) | (invertAxis << 15));
Flash_Write(flashAddrs.effects1, idlespringstrength | (damperIntensity << 8));
Flash_Write(flashAddrs.effects2, frictionIntensity | (inertiaIntensity << 8));
Flash_Write(flashAddrs.encoderRatio, gearRatio.numerator | (gearRatio.denominator << 8));

// save CF biquad
Expand Down Expand Up @@ -538,13 +546,13 @@ void Axis::setIdleSpringStrength(uint8_t spring){
}

/**
* Sets the independent damper intensity
* Sets friction, inertia or damper values and resets filter
*/
void Axis::setDamperStrength(uint8_t damper){
if(damperIntensity == 0 && damper != 0)
damperFilter.calcBiquad();
void Axis::setFxStrengthAndFilter(uint8_t val,uint8_t& valToSet, Biquad& filter){
if(valToSet == 0 && val != 0)
filter.calcBiquad();

this->damperIntensity = damper;
valToSet = val;
}

/**
Expand All @@ -561,8 +569,29 @@ void Axis::calculateAxisEffects(bool ffb_on){
// Always active damper
if(damperIntensity != 0){
float speedFiltered = (metric.current.speed) * (float)damperIntensity * AXIS_DAMPER_RATIO;
axisEffectTorque -= damperFilter.process(clip<float, int32_t>(speedFiltered, -damperClip, damperClip));
axisEffectTorque -= damperFilter.process(clip<float, int32_t>(speedFiltered, -intFxClip, intFxClip));
}

// Always active inertia
if(inertiaIntensity != 0){
float accelFiltered = metric.current.accel * (float)inertiaIntensity * AXIS_INERTIA_RATIO;
axisEffectTorque -= inertiaFilter.process(clip<float, int32_t>(accelFiltered, -intFxClip, intFxClip));
}

// Always active friction. Based on effectsCalculator implementation
if(frictionIntensity != 0){
float speed = metric.current.speed * INTERNAL_SCALER_FRICTION;
float speedRampupCeil = 4096;
float rampupFactor = 1.0;
if (fabs (speed) < speedRampupCeil) { // if speed in the range to rampup we apply a sinus curbe to ramup
float phaseRad = M_PI * ((fabs (speed) / speedRampupCeil) - 0.5);// we start to compute the normalized angle (speed / normalizedSpeed@5%) and translate it of -1/2PI to translate sin on 1/2 periode
rampupFactor = ( 1 + sin(phaseRad ) ) / 2; // sin value is -1..1 range, we translate it to 0..2 and we scale it by 2
}
int8_t sign = speed >= 0 ? 1 : -1;
float force = (float)frictionIntensity * rampupFactor * sign * INTERNAL_AXIS_FRICTION_SCALER * 32;
axisEffectTorque -= frictionFilter.process(clip<float, int32_t>(force, -intFxClip, intFxClip));
}

}

/**
Expand Down Expand Up @@ -603,7 +632,6 @@ void Axis::updateMetrics(float new_pos) { // pos is degrees
metric.current.accel = accelFilter.process((currentSpeed - _lastSpeed))* 1000.0; // deg/s/s
_lastSpeed = currentSpeed;

metric.current.torque = 0;
}


Expand Down Expand Up @@ -792,7 +820,29 @@ CommandStatus Axis::command(const ParsedCommand& cmd,std::vector<CommandReply>&
}
else if (cmd.type == CMDtype::set)
{
setDamperStrength(cmd.val);
setFxStrengthAndFilter(cmd.val,this->damperIntensity,this->damperFilter);
}
break;

case Axis_commands::axisfriction:
if (cmd.type == CMDtype::get)
{
replies.emplace_back(frictionIntensity);
}
else if (cmd.type == CMDtype::set)
{
setFxStrengthAndFilter(cmd.val,this->frictionIntensity,this->frictionFilter);
}
break;

case Axis_commands::axisinertia:
if (cmd.type == CMDtype::get)
{
replies.emplace_back(inertiaIntensity);
}
else if (cmd.type == CMDtype::set)
{
setFxStrengthAndFilter(cmd.val,this->inertiaIntensity,this->inertiaFilter);
}
break;

Expand Down Expand Up @@ -898,9 +948,12 @@ CommandStatus Axis::command(const ParsedCommand& cmd,std::vector<CommandReply>&
break;

case Axis_commands::cpr:
if (cmd.type == CMDtype::get && this->drv->getEncoder() != nullptr)
if (cmd.type == CMDtype::get)
{
uint32_t cpr = this->drv->getEncoder()->getCpr();
uint32_t cpr = 0;
if(this->drv->getEncoder() != nullptr){
cpr = this->drv->getEncoder()->getCpr();
}
//#ifdef TMC4671DRIVER // CPR should be consistent with position. Maybe change TMC to prescale to encoder count or correct readout in UI
// TMC4671 *tmcdrv = dynamic_cast<TMC4671 *>(this->drv.get()); // Special case for TMC. Get the actual encoder resolution
// if (tmcdrv && tmcdrv->hasIntegratedEncoder())
Expand Down
17 changes: 14 additions & 3 deletions Firmware/FFBoard/Src/HidFFB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,21 @@ void HidFFB::set_effect(FFB_SetEffect_t* effect){
}

float phaseX = M_PI*2.0 * (effect->directionX/36000.0);
// Angular vector if dirEnable used or axis enabled otherwise 0 if axis disabled
effect_p->axisMagnitudes[0] = (directionEnable || (effect->enableAxis & X_AXIS_ENABLE) ? sin(phaseX) : 0);
effect_p->axisMagnitudes[1] = (directionEnable || (effect->enableAxis & Y_AXIS_ENABLE) ? cos(phaseX) : 0);

if(axisCount == 1){
/*
* Angular vector if dirEnable used or axis enabled otherwise 0 if axis disabled
* Compatibility fix.
* Some single axis games send no directionEnable but enableAxis but still use phase vectors to scale a single axis effect
*/
effect_p->axisMagnitudes[0] = (directionEnable || (effect->enableAxis & X_AXIS_ENABLE) ? sin(phaseX) : 0);
}else{
/*
* Some 2 axis games send no vector and require the axis to be enable via enableAxis
*/
effect_p->axisMagnitudes[0] = directionEnable ? sin(phaseX) : (effect->enableAxis & X_AXIS_ENABLE ? 1 : 0); // Angular vector if dirEnable used otherwise full or 0 if axis enabled
effect_p->axisMagnitudes[1] = directionEnable ? cos(phaseX) : (effect->enableAxis & Y_AXIS_ENABLE ? 1 : 0); // Angular vector if
}

#if MAX_AXIS == 3
float phaseY = M_PI*2.0 * (effect->directionY/36000.0);
Expand Down
2 changes: 1 addition & 1 deletion Firmware/FFBoard/Src/SystemCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void SystemCommands::registerCommands(){
CommandHandler::registerCommand("main", FFBoardMain_commands::main, "Query or change mainclass",CMDFLAG_GET | CMDFLAG_SET);
CommandHandler::registerCommand("swver", FFBoardMain_commands::swver, "Firmware version",CMDFLAG_GET);
CommandHandler::registerCommand("hwtype", FFBoardMain_commands::hwtype, "Hardware type",CMDFLAG_GET);
CommandHandler::registerCommand("flashraw", FFBoardMain_commands::flashraw, "Write value to flash address",CMDFLAG_SETADR);
CommandHandler::registerCommand("flashraw", FFBoardMain_commands::flashraw, "Write value to flash address",CMDFLAG_SETADR | CMDFLAG_GETADR);
CommandHandler::registerCommand("flashdump", FFBoardMain_commands::flashdump, "Read all flash variables (val:adr)",CMDFLAG_GET);
CommandHandler::registerCommand("errors", FFBoardMain_commands::errors, "Read error states",CMDFLAG_GET);
CommandHandler::registerCommand("errorsclr", FFBoardMain_commands::errorsclr, "Reset errors",CMDFLAG_GET);
Expand Down
3 changes: 1 addition & 2 deletions Firmware/FFBoard/Src/USBdevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ void USBdevice::registerUsb(){
void USBdevice::Run(){
tusb_init();
while(1){
tud_task();
Delay(1);
tud_task(); // Run until no usb events left
}
}

Expand Down
3 changes: 2 additions & 1 deletion Firmware/FFBoard/UserExtensions/Inc/ODriveCAN.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ enum class ODriveEncoderFlags : uint32_t {ERROR_NONE = 0,ERROR_UNSTABLE_GAIN = 0
enum class ODriveAxisError : uint32_t {AXIS_ERROR_NONE = 0x00000000,AXIS_ERROR_INVALID_STATE = 0x00000001, AXIS_ERROR_WATCHDOG_TIMER_EXPIRED = 0x00000800,AXIS_ERROR_MIN_ENDSTOP_PRESSED = 0x00001000, AXIS_ERROR_MAX_ENDSTOP_PRESSED = 0x00002000,AXIS_ERROR_ESTOP_REQUESTED = 0x00004000,AXIS_ERROR_HOMING_WITHOUT_ENDSTOP = 0x00020000,AXIS_ERROR_OVER_TEMP = 0x00040000,AXIS_ERROR_UNKNOWN_POSITION = 0x00080000};

enum class ODriveCAN_commands : uint32_t{
canid,canspd,errors,state,maxtorque,vbus,anticogging,connected
canid,canspd,errors,state,maxtorque,vbus,anticogging,connected,storepos
};

class ODriveCAN : public MotorDriver,public PersistentStorage, public Encoder, public CanHandler, public CommandHandler, cpp_freertos::Thread{
Expand Down Expand Up @@ -106,6 +106,7 @@ class ODriveCAN : public MotorDriver,public PersistentStorage, public Encoder, p

uint32_t lastPosTime = 0;
bool posWaiting = false;
bool reloadPosAfterStartup = false;

int8_t nodeId = 0; // 6 bits can ID
int8_t motorId = 0;
Expand Down
9 changes: 7 additions & 2 deletions Firmware/FFBoard/UserExtensions/Inc/eeprom_addresses.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

#include "main.h"
// Change this to the amount of currently registered variables
#define NB_OF_VAR 148
#define NB_OF_VAR 153
extern const uint16_t VirtAddVarTab[NB_OF_VAR];

// Amount of variables in exportable list
#define NB_EXPORTABLE_ADR 133
#define NB_EXPORTABLE_ADR 138
extern const uint16_t exportableFlashAddresses[NB_EXPORTABLE_ADR];


Expand Down Expand Up @@ -99,6 +99,7 @@ uint16_t EE_ReadVariable(uint16_t VirtAddress, uint16_t* Data) will return 1 if
#define ADR_AXIS1_EFFECTS1 0x308 // 0-7 idlespring, 8-15 damper
#define ADR_AXIS1_SPEEDACCEL_FILTER 0x309 // Speed/Accel filter Lowpass profile
#define ADR_AXIS1_ENC_RATIO 0x30A // Accel filter Lowpass
#define ADR_AXIS1_EFFECTS2 0x30B // 0-7 Friction, 8-15 Inertia
// TMC1
#define ADR_TMC1_MOTCONF 0x320 // 0-2: MotType 3-5: PhiE source 6-15: Poles
#define ADR_TMC1_CPR 0x321
Expand All @@ -123,6 +124,7 @@ uint16_t EE_ReadVariable(uint16_t VirtAddress, uint16_t* Data) will return 1 if
#define ADR_AXIS2_EFFECTS1 0x348 // 0-7 idlespring, 8-15 damper
#define ADR_AXIS2_SPEEDACCEL_FILTER 0x349 // Speed/Accel filter Lowpass profile
#define ADR_AXIS2_ENC_RATIO 0x34A // Store the encoder ratio for an axis
#define ADR_AXIS2_EFFECTS2 0x34B // 0-7 Friction, 8-15 Inertia
// TMC2
#define ADR_TMC2_MOTCONF 0x360 // 0-2: MotType 3-5: PhiE source 6-15: Poles
#define ADR_TMC2_CPR 0x361
Expand All @@ -147,6 +149,7 @@ uint16_t EE_ReadVariable(uint16_t VirtAddress, uint16_t* Data) will return 1 if
#define ADR_AXIS3_EFFECTS1 0x388 // 0-7 idlespring, 8-15 damper
#define ADR_AXIS3_SPEEDACCEL_FILTER 0x389 // Speed/Accel filter Lowpass profile
#define ADR_AXIS3_ENC_RATIO 0x38A // Store the encoder ratio for an axis
#define ADR_AXIS3_EFFECTS2 0x38B // 0-7 Friction, 8-15 Inertia
// TMC3
#define ADR_TMC3_MOTCONF 0x3A0 // 0-2: MotType 3-5: PhiE source 6-15: Poles
#define ADR_TMC3_CPR 0x3A1
Expand All @@ -165,6 +168,8 @@ uint16_t EE_ReadVariable(uint16_t VirtAddress, uint16_t* Data) will return 1 if
#define ADR_ODRIVE_CANID 0x3D0 //0-6 ID M0, 7-12 ID M1, 13-15 can speed
#define ADR_ODRIVE_SETTING1_M0 0x3D1
#define ADR_ODRIVE_SETTING1_M1 0x3D2
#define ADR_ODRIVE_OFS_M0 0x3D3 // Encoder offset position reload
#define ADR_ODRIVE_OFS_M1 0x3D4
// VESC Section
#define ADR_VESC1_CANID 0x3E0 //0-7 AxisCanID, 8-16 VescCanId
#define ADR_VESC1_DATA 0x3E1 //0-2 can speed, 3 useVescEncoder
Expand Down
Loading
Loading