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

2FOC current filter implemented. #524

Merged
merged 4 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#
#Tue Jul 09 10:08:33 CEST 2024
#Tue Oct 08 13:11:26 CEST 2024
default.languagetoolchain.version=1.24
default.Pack.dfplocation=C\:\\Program Files\\Microchip\\MPLABX\\v6.15\\packs\\Microchip\\dsPIC33F-GP-MC_DFP\\1.3.64
conf.ids=default
default.languagetoolchain.dir=C\:\\Program Files (x86)\\Microchip\\xc16\\v1.24\\bin
host.id=jxni-i95q-5
host.id=28y3-ir0s-s0
default.platformTool.md5=null
configurations-xml=686f227af389f0381a28d871fb823d8b
configurations-xml=a12254ccc674a1f41ee2e934cd1ea72a
com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=e62346c0c0ecee2637e613b49cb7b7fa
proj.dir=C\:\\Users\\jlosi\\Workspace\\ICUB-FIRM\\icub-firmware\\emBODY\\eBcode\\arch-dspic\\board\\2foc\\appl\\2FOC-V3\\2FOC-V3.X
proj.dir=C\:\\Users\\ascalzo\\Documents\\Work\\Repos\\2FOC-FILTERED\\icub-firmware\\emBODY\\eBcode\\arch-dspic\\board\\2foc\\appl\\2FOC-V3\\2FOC-V3.X
host.platform=windows
default.com-microchip-mplab-nbide-toolchain-xc16-XC16LanguageToolchain.md5=07f7da95e66d00aa4668de5175f752c5
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<configurationDescriptor version="65">
<logicalFolder name="root" displayName="root" projectFiles="true">
<logicalFolder name="f1" displayName="Assembler" projectFiles="true">
<itemPath>../asm/MeasCurr.inc</itemPath>
<itemPath>../asm/MeasCurr.s</itemPath>
</logicalFolder>
<logicalFolder name="HeaderFiles"
displayName="Header Files"
projectFiles="true">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,7 @@
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<file>file:/C:/Users/jlosi/Workspace/ICUB-FIRM/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/src/traps.c</file>
<file>file:/C:/Users/jlosi/Workspace/ICUB-FIRM/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/include/iCubCanProto_classes.h</file>
<file>file:/C:/Users/jlosi/Workspace/ICUB-FIRM/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/src/System.c</file>
<file>file:/C:/Users/jlosi/Workspace/ICUB-FIRM/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/include/can_icubProto.h</file>
<file>file:/C:/Users/jlosi/Workspace/ICUB-FIRM/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/src/can_icubProto_trasmitter.c</file>
<file>file:/C:/Users/jlosi/Workspace/ICUB-FIRM/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/include/UserTypes.h</file>
<file>file:/C:/Users/jlosi/Workspace/ICUB-FIRM/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/src/ADC.c</file>
<file>file:/C:/Users/jlosi/Workspace/ICUB-FIRM/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/include/System.h</file>
<file>file:/C:/Users/jlosi/Workspace/ICUB-FIRM/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/src/PWM.c</file>
<file>file:/C:/Users/jlosi/Workspace/ICUB-FIRM/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/include/ecan.h</file>
<file>file:/C:/Users/jlosi/Workspace/ICUB-FIRM/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/include/2FOC.h</file>
<file>file:/C:/Users/jlosi/Workspace/ICUB-FIRM/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/include/iCubCanProto_bootloaderMessages.h</file>
<file>file:/C:/Users/jlosi/Workspace/ICUB-FIRM/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/src/i2cTsens.c</file>
<file>file:/C:/Users/jlosi/Workspace/ICUB-FIRM/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/src/Faults.c</file>
<file>file:/C:/Users/jlosi/Workspace/ICUB-FIRM/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/src/DHES.c</file>
<file>file:/C:/Users/jlosi/Workspace/ICUB-FIRM/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/src/ecan.c</file>
<file>file:/C:/Users/jlosi/Workspace/ICUB-FIRM/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/include/PWM.h</file>
<file>file:/C:/Users/jlosi/Workspace/ICUB-FIRM/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/include/iCubCanProto_motorControlMessages.h</file>
<file>file:/C:/Users/jlosi/Workspace/ICUB-FIRM/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/include/i2cTsens.h</file>
<file>file:/C:/Users/jlosi/Workspace/ICUB-FIRM/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/include/Faults.h</file>
<file>file:/C:/Users/jlosi/Workspace/ICUB-FIRM/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/src/DCLink.c</file>
<file>file:/C:/Users/jlosi/Workspace/ICUB-FIRM/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/src/can_icubProto_parser.c</file>
<file>file:/C:/Users/jlosi/Workspace/ICUB-FIRM/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/src/2FOC.c</file>
<file>file:/C:/Users/jlosi/Workspace/ICUB-FIRM/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/include/ADC.h</file>
<file>file:/C:/Users/jlosi/Workspace/ICUB-FIRM/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/include/iCubCanProtocol.h</file>
<file>file:/C:/Users/jlosi/Workspace/ICUB-FIRM/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/include/iCubCanProto_types.h</file>
<file>file:/C:/Users/jlosi/Workspace/ICUB-FIRM/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/include/UserParms.h</file>
<file>file:/C:/Users/jlosi/Workspace/ICUB-FIRM/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/include/can_icubProto_parser.h</file>
<file>file:/C:/Users/jlosi/Workspace/ICUB-FIRM/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/include/iCubCanProto_analogSensorMessages.h</file>
<file>file:/C:/Users/jlosi/Workspace/ICUB-FIRM/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/src/qep.c</file>
<file>file:/C:/Users/jlosi/Workspace/ICUB-FIRM/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/include/qep.h</file>
<file>file:/C:/Users/ascalzo/Documents/Work/Repos/2FOC-FILTERED/icub-firmware/emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/src/2FOC.c</file>
</group>
</open-files>
</project-private>
45 changes: 0 additions & 45 deletions emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/asm/MeasCurr.inc

This file was deleted.

163 changes: 0 additions & 163 deletions emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/asm/MeasCurr.s

This file was deleted.

77 changes: 0 additions & 77 deletions emBODY/eBcode/arch-dspic/board/2foc/appl/2FOC-V3/asm/park.inc

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@

#include "MeasCurr.h"

// number of samples taken to calculate zero calibration
#define ADC_CAL_N_SAMPLES 200

// Timeout for polling loops during zero calibration
#define ADC_CAL_TIMEOUT 1000
extern SFRAC16 ADCBuffer[4];

extern volatile tMeasCurrParm MeasCurrParm;

Expand All @@ -22,6 +18,7 @@ int ADCGetVDCLink();
unsigned int ADCVDCLinkTo100mV(int vdc);
// pewrform offset calibration
void ADCDoOffsetCalibration();
void ADCDoGainCalibration();
// setup ADC for PWM sync and DMA
void ADCConfigPWMandDMAMode();
void ADCInterruptAndDMAEnable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ typedef struct {
SFRAC16 Offseta;

SFRAC16 qKb; // Q15
SFRAC16 Offsetbc;
SFRAC16 Offsetc;

SFRAC16 qKc; // Q15
} tMeasCurrParm;
} tMeasCurrParm;

void MeasAndCompIaIcCalculateIb();
void MeasAndCompIaIb();
//void MeasAndCompIaIcCalculateIb();
//void MeasAndCompIaIb();

#endif

Loading