I checked my IAR project. It defines the following globals:
USE_STDPERIPH_DRIVER
STM32F10X_MD
ARM_MATH_CM3
Here is the search path for .c/h files:
$PROJ_DIR$\..\..\STM32 PMSM FOC LIBv4.0\ProtectedSources\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x
$PROJ_DIR$\..\..\STM32 PMSM FOC LIBv4.0\ProtectedSources\Libraries\STM32F10x_StdPeriph_Driver\inc
$PROJ_DIR$\..\..\STM32 PMSM FOC LIBv4.0\ProtectedSources\MCLibrary
$PROJ_DIR$\..\..\STM32 PMSM FOC LIBv4.0\ProtectedSources\MCLibrary\inc
$PROJ_DIR$\..\..\STM32 PMSM FOC LIBv4.0\ProtectedSources\MCLibrary\interface
$PROJ_DIR$\..\..\STM32 PMSM FOC LIBv4.0\ProtectedSources\MCLibrary\interface\common
$PROJ_DIR$\..\..\STM32 PMSM FOC LIBv4.0\ProtectedSources\MCApplication\inc
$PROJ_DIR$\..\..\STM32 PMSM FOC LIBv4.0\ProtectedSources\MCApplication\interface
$PROJ_DIR$\..\..\STM32 PMSM FOC LIBv4.0\ProtectedSources\UILibrary\inc
$PROJ_DIR$\..\..\STM32 PMSM FOC LIBv4.0\ProtectedSources\UILibrary\interface
$PROJ_DIR$\
$PROJ_DIR$\SystemDriveParams
Your Eclipse project file is not included there, that would be essential. The library extensively uses #define rubbish.You wanted to say IAR, right?
Please do not ruin my head .
I checked my IAR project. It defines the following globals:
USE_STDPERIPH_DRIVER
STM32F10X_MD
ARM_MATH_CM3
Here is the search path for .c/h files:
$PROJ_DIR$\..\..\STM32 PMSM FOC LIBv4.0\ProtectedSources\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x
$PROJ_DIR$\..\..\STM32 PMSM FOC LIBv4.0\ProtectedSources\Libraries\STM32F10x_StdPeriph_Driver\inc
$PROJ_DIR$\..\..\STM32 PMSM FOC LIBv4.0\ProtectedSources\MCLibrary
$PROJ_DIR$\..\..\STM32 PMSM FOC LIBv4.0\ProtectedSources\MCLibrary\inc
$PROJ_DIR$\..\..\STM32 PMSM FOC LIBv4.0\ProtectedSources\MCLibrary\interface
$PROJ_DIR$\..\..\STM32 PMSM FOC LIBv4.0\ProtectedSources\MCLibrary\interface\common
$PROJ_DIR$\..\..\STM32 PMSM FOC LIBv4.0\ProtectedSources\MCApplication\inc
$PROJ_DIR$\..\..\STM32 PMSM FOC LIBv4.0\ProtectedSources\MCApplication\interface
$PROJ_DIR$\..\..\STM32 PMSM FOC LIBv4.0\ProtectedSources\UILibrary\inc
$PROJ_DIR$\..\..\STM32 PMSM FOC LIBv4.0\ProtectedSources\UILibrary\interface
$PROJ_DIR$\
$PROJ_DIR$\SystemDriveParamsNow that I see, this is described in Chapter 10.3 of the manual, but I'm using the IAR for the first time ...
Where do I declare global variables and define the path of includes?
Here?
Yes, I had already changed the processor to be the same as I am using.
The preprocessor settings are correct. Just like you said.
On this board ... no clues for it to work, right?
It seems that everything is right, but something prevents it from working ...
1) toolchain problem, project setup -> I think as you managed to migrate to IAR using the default projects (I assume you could flash and run the code with it, and get the same result - no PWM, right?) we can cross this out.
2) board compatibility -> I see only the BKIN issue as possible reason why you don't get PWM signals. I remember from all the documentation that there was a side note that, on some STM32F derivates, this feature cannot be disabled in the timer block. Don't remember where that was though. I decided back then to sacrifice one GPIO for that, and tie it to GND. So it is possible that, even though you disabled that feature in the configuration tool, it is still ruining your day. Maybe do a test and desolder that R8 resistor, this way the driver chip could see a HIGH, and PB12 could see a low. Then enable the BKIN feature again, check it is assigned to PB12 and configured HIGH-active.
3) the FOC library has a number of protection mechanisms that cause it to shut down. For example, over/undervoltage. You could easily see via RS232 and the STMC Workbench's remote control, if one of them is alarmed. I didn't ask that yet: I assume that you supply the board with 24V, right?
You could also start debugging the code, and see if one of the protection mechanisms is shutting down the PWM. But as most of the FOC libary is only available as a binary blob, that can be very difficulty. A good starting point could be MCTasks.c --> TSK_SafetyTask(). This function is regularly called from an interrupt service, and checks for problems.
This would be a method of securing this issue ...
Is the polarity of BKIN high?
You were right.
But it's strange because I measured the voltage and it's correct.
I measured 1.95V at resistor R14 (Vbus ~ 24.3V).
I lowered the voltage to 15V and still have that error.
I've commented this line and I already have PWM in the outputs ....
#define OV_VOLTAGE_THRESHOLD_V 32 /*!< Over-voltage
threshold */
#define UD_VOLTAGE_THRESHOLD_V 18 /*!< Under-voltage
threshold */
#define VBUS_PARTITIONING_FACTOR 0.0833 /*!< It expresses how
much the Vbus is attenuated
before being converted into
digital value */
#define MCU_SUPPLY_VOLTAGE 3.30
Have you stepped into TSK_SafetyTask_PWMOFF ? Are you sure that it is the voltage monitor that is tripping?The files generated by the configurator are those compiled. I see this when I change values and the files in the compiler change as well.
I'll forget for now the EVB STEVAL-IHM040V1.
It is best to start over, but using EVB P-NUCLEO-IHM001 (as it should have done from the beginning, my fault).
While I'm doing some calibration ... I leave some questions.
How can I configure another serial port?
Do I have to do all the setup in the registers?
Or can I use the serial port using the SDK?
I know it may sound silly questions ... but for now it's causing me some confusion ...
The STMWB has templates for NUCLEO-IHM07 and -08, you can check if these have identical microcontroller pinout. Then you'd only have to copy the motor parameters. There is a top row button that gives you an overview of the pin assignments, it looks like a chip.
Re the serial port: Do you mean on the Windows machine, or do you mean the microcontroller pin assignment? The latter is in STMCWB under Control Stage -> User Interface (enable it there), and Control Stage -> Digital I/O. For the Windows machine, click on the symbol that looks like an analog gauge.
p.s. overvoltage protection can be very important, if your system can go into regenerative operation, and your bus voltage has the ability to charge up. For example, if the controller abruptly decelerates the motor and the mass that is attached to its shaft, then you'll have a considerable amount of energy being fed back into the DC bus, charging the bus capacitor. If nothing is keeping the voltage down, you can easily run into overvoltage, and boom. If your system supply will be a simple DC/DC converter, that can easily happen. If your supply is a battery that is directly connected to the bus, then that will suck in the excessive energy. Unless you have a fuse that can blow (which is what happened to me...).
Because in the future the goal is to send speeds via serial port.
So far everything is going well .
I already switched to my motor and it works fine. I will now try to enable the encoder control.
PS: before that I have to solve another problem. Sometimes I have overcurrent errors. I have to see how I can change the threshold (I've already changed "Over Current Protection" but it's still the same effect).
static int i=0;
i++;
FOCVars[M1].Iqdref.qI_Component1 = 0;
if( (i%300) < 150 )
{
FOCVars[M1].Iqdref.qI_Component2 = (int16_t)( 1.0f * (65536.0f * (float)(AMPLIFICATION_GAIN / MCU_SUPPLY_VOLTAGE) ) );
}
else
{
FOCVars[M1].Iqdref.qI_Component2 = 0;
}
I run this in a cyclic interrupt, in my case at 2kHz. And I make sure that no velocity control is in place, that would interfere with it. uint16_t FOC_CurrController(uint8_t bMotor)
{
Curr_Components Iab, Ialphabeta, Iqd;
#if defined(HFINJECTION) || (defined(DUALDRIVE) && defined(HFINJECTION2))
Curr_Components IqdHF = {0,0};
#endif
Volt_Components Valphabeta, Vqd;
int16_t hElAngledpp;
uint16_t hCodeError;
hElAngledpp = SPD_GetElAngle(STC_GetSpeedSensor(oSTC[bMotor]));
static int16_t k=0; k+=1; hElAngledpp=k; <<<<<<<<<< inserted, very slow motor rotation
PWMC_GetPhaseCurrents(oCurrSensor[bMotor], &Iab);
...
PS: before that I have to solve another problem. Sometimes I have overcurrent errors. I have to see how I can change the threshold (I've already changed "Over Current Protection" but it's still the same effect).
There is only one mechanism reporting overcurrent, and that is the BKIN feature. An overcurrent can only be reported by the hardware comparator(s). There is no need for a software based overcurrent monitor, because the FOC algorithm *controls* the current (unless there is loop instability).
09:39:34 **** Incremental Build of configuration P-NUCLEO-IHM001_SINGLEDRIVE for project STM32F30x_UserProject ****
make all
'Building target: STM32F30x_UserProject.elf'
'Invoking: MCU GCC Linker'
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -L"C:\Program Files (x86)\STMicroelectronics\FOC SDK\v4.3.0\STM32 PMSM FOC LIB\Web\Project\AC6\MC Library Compiled" -L"C:\Program Files (x86)\STMicroelectronics\FOC SDK\v4.3.0\STM32 PMSM FOC LIB\Web\Project\AC6\MC Library Compiled\MCO_SD" --specs=rdimon.specs -T"C:\Program Files (x86)\STMicroelectronics\FOC SDK\v4.3.0\STM32 PMSM FOC LIB\Web\Project\AC6\STM32F30x_UserProject\STM32F302R8Tx_FLASH.ld" -Wl,-Map=output.map -Wl,--gc-sections -lm -o "STM32F30x_UserProject.elf" @"objects.list" -lMC_Library_STM32F302x8_single_drive -lMC_Lib_PS_CM4
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.7.0.201602121829/tools/compiler/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: cannot find -lMC_Library_STM32F302x8_single_drive
collect2.exe: error: ld returned 1 exit status
make: *** [STM32F30x_UserProject.elf] Error 1
make all
'Building target: STM32F30x_UserProject.elf'
'Invoking: MCU GCC Linker'
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -L"C:\Program Files (x86)\STMicroelectronics\FOC SDK\v4.3.0\STM32 PMSM FOC LIB\Web\Project\AC6\MC Library Compiled" -L"C:\Program Files (x86)\STMicroelectronics\FOC SDK\v4.3.0\STM32 PMSM FOC LIB\Web\Project\AC6\MC Library Compiled\MCO_SD" --specs=rdimon.specs -T"C:\Program Files (x86)\STMicroelectronics\FOC SDK\v4.3.0\STM32 PMSM FOC LIB\Web\Project\AC6\STM32F30x_UserProject\STM32F302R8Tx_FLASH.ld" -Wl,-Map=output.map -Wl,--gc-sections -lm -o "STM32F30x_UserProject.elf" @"objects.list" -lMC_Library_STM32F302x8_single_drive -lMC_Lib_PS_CM4
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.7.0.201602121829/tools/compiler/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: C:\Program Files (x86)\STMicroelectronics\FOC SDK\v4.3.0\STM32 PMSM FOC LIB\Web\Project\AC6\MC Library Compiled\libMC_Library_STM32F302x8_single_drive.a(BusVoltageSensorClass.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.7.0.201602121829/tools/compiler/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: C:\Program Files (x86)\STMicroelectronics\FOC SDK\v4.3.0\STM32 PMSM FOC LIB\Web\Project\AC6\MC Library Compiled\libMC_Library_STM32F302x8_single_drive.a(CircleLimitationClass.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.7.0.201602121829/tools/compiler/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: C:\Program Files (x86)\STMicroelectronics\FOC SDK\v4.3.0\STM32 PMSM FOC LIB\Web\Project\AC6\MC Library Compiled\libMC_Library_STM32F302x8_single_drive.a(DigitalOutputClass_F30X.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.7.0.201602121829/tools/compiler/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: C:\Program Files (x86)\STMicroelectronics\FOC SDK\v4.3.0\STM32 PMSM FOC LIB\Web\Project\AC6\MC Library Compiled\libMC_Library_STM32F302x8_single_drive.a(FeedForwardCtrlClass.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.7.0.201602121829/tools/compiler/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: C:\Program Files (x86)\STMicroelectronics\FOC SDK\v4.3.0\STM32 PMSM FOC LIB\Web\Project\AC6\MC Library Compiled\libMC_Library_STM32F302x8_single_drive.a(FluxWeakeningCtrlClass.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.7.0.201602121829/tools/compiler/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: C:\Program Files (x86)\STMicroelectronics\FOC SDK\v4.3.0\STM32 PMSM FOC LIB\Web\Project\AC6\MC Library Compiled\libMC_Library_STM32F302x8_single_drive.a(MC_Math.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.7.0.201602121829/tools/compiler/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: C:\Program Files (x86)\STMicroelectronics\FOC SDK\v4.3.0\STM32 PMSM FOC LIB\Web\Project\AC6\MC Library Compiled\libMC_Library_STM32F302x8_single_drive.a(MCIRQHandlerClass.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.7.0.201602121829/tools/compiler/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: C:\Program Files (x86)\STMicroelectronics\FOC SDK\v4.3.0\STM32 PMSM FOC LIB\Web\Project\AC6\MC Library Compiled\libMC_Library_STM32F302x8_single_drive.a(MotorPowerMeasurementClass.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.7.0.201602121829/tools/compiler/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: C:\Program Files (x86)\STMicroelectronics\FOC SDK\v4.3.0\STM32 PMSM FOC LIB\Web\Project\AC6\MC Library Compiled\libMC_Library_STM32F302x8_single_drive.a(NTC_F30X_TemperatureSensorClass.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.7.0.201602121829/tools/compiler/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: C:\Program Files (x86)\STMicroelectronics\FOC SDK\v4.3.0\STM32 PMSM FOC LIB\Web\Project\AC6\MC Library Compiled\libMC_Library_STM32F302x8_single_drive.a(PID_PIRegulatorClass.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.7.0.201602121829/tools/compiler/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: C:\Program Files (x86)\STMicroelectronics\FOC SDK\v4.3.0\STM32 PMSM FOC LIB\Web\Project\AC6\MC Library Compiled\libMC_Library_STM32F302x8_single_drive.a(PIRegulatorClass.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.7.0.201602121829/tools/compiler/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: C:\Program Files (x86)\STMicroelectronics\FOC SDK\v4.3.0\STM32 PMSM FOC LIB\Web\Project\AC6\MC Library Compiled\libMC_Library_STM32F302x8_single_drive.a(PQD_MotorPowerMeasurementClass.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.7.0.201602121829/tools/compiler/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: C:\Program Files (x86)\STMicroelectronics\FOC SDK\v4.3.0\STM32 PMSM FOC LIB\Web\Project\AC6\MC Library Compiled\libMC_Library_STM32F302x8_single_drive.a(PWMnCurrFdbkClass.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.7.0.201602121829/tools/compiler/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: C:\Program Files (x86)\STMicroelectronics\FOC SDK\v4.3.0\STM32 PMSM FOC LIB\Web\Project\AC6\MC Library Compiled\libMC_Library_STM32F302x8_single_drive.a(R3_1_F30X_PWMnCurrFdbkClass.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.7.0.201602121829/tools/compiler/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: C:\Program Files (x86)\STMicroelectronics\FOC SDK\v4.3.0\STM32 PMSM FOC LIB\Web\Project\AC6\MC Library Compiled\libMC_Library_STM32F302x8_single_drive.a(RampExtMngrClass.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.7.0.201602121829/tools/compiler/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: C:\Program Files (x86)\STMicroelectronics\FOC SDK\v4.3.0\STM32 PMSM FOC LIB\Web\Project\AC6\MC Library Compiled\libMC_Library_STM32F302x8_single_drive.a(Rdivider_F30X_BusVoltageSensorClass.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.7.0.201602121829/tools/compiler/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: C:\Program Files (x86)\STMicroelectronics\FOC SDK\v4.3.0\STM32 PMSM FOC LIB\Web\Project\AC6\MC Library Compiled\libMC_Library_STM32F302x8_single_drive.a(RevupCtrlClass.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.7.0.201602121829/tools/compiler/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: C:\Program Files (x86)\STMicroelectronics\FOC SDK\v4.3.0\STM32 PMSM FOC LIB\Web\Project\AC6\MC Library Compiled\libMC_Library_STM32F302x8_single_drive.a(SpeednPosFdbkClass.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.7.0.201602121829/tools/compiler/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: C:\Program Files (x86)\STMicroelectronics\FOC SDK\v4.3.0\STM32 PMSM FOC LIB\Web\Project\AC6\MC Library Compiled\libMC_Library_STM32F302x8_single_drive.a(SpeednTorqCtrlClass.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.7.0.201602121829/tools/compiler/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: C:\Program Files (x86)\STMicroelectronics\FOC SDK\v4.3.0\STM32 PMSM FOC LIB\Web\Project\AC6\MC Library Compiled\libMC_Library_STM32F302x8_single_drive.a(StateMachineClass.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.7.0.201602121829/tools/compiler/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: C:\Program Files (x86)\STMicroelectronics\FOC SDK\v4.3.0\STM32 PMSM FOC LIB\Web\Project\AC6\MC Library Compiled\libMC_Library_STM32F302x8_single_drive.a(STO_CORDIC_SpeednPosFdbkClass.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.7.0.201602121829/tools/compiler/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: C:\Program Files (x86)\STMicroelectronics\FOC SDK\v4.3.0\STM32 PMSM FOC LIB\Web\Project\AC6\MC Library Compiled\libMC_Library_STM32F302x8_single_drive.a(STO_SpeednPosFdbkClass.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.7.0.201602121829/tools/compiler/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: C:\Program Files (x86)\STMicroelectronics\FOC SDK\v4.3.0\STM32 PMSM FOC LIB\Web\Project\AC6\MC Library Compiled\libMC_Library_STM32F302x8_single_drive.a(TemperatureSensorClass.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.7.0.201602121829/tools/compiler/bin/../lib/gcc/arm-none-eabi/5.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: C:\Program Files (x86)\STMicroelectronics\FOC SDK\v4.3.0\STM32 PMSM FOC LIB\Web\Project\AC6\MC Library Compiled\libMC_Library_STM32F302x8_single_drive.a(VirtualSpeedSensor_SpeednPosFdbkClass.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
Motor control/MC Application/src/MCInterfaceClass.o: In function `MCI_StopSpeedRamp':
C:/Program Files (x86)/STMicroelectronics/FOC SDK/v4.3.0/STM32 PMSM FOC LIB/Web/MCApplication/src/MCInterfaceClass.c:491: undefined reference to `STC_StopSpeedRamp'
Motor control/MC Application/src/MCTasks.o: In function `TSK_MediumFrequencyTaskM1':
C:/Program Files (x86)/STMicroelectronics/FOC SDK/v4.3.0/STM32 PMSM FOC LIB/Web/MCApplication/src/MCTasks.c:1339: undefined reference to `STC_ForceSpeedReferenceToCurrentSpeed'
collect2.exe: error: ld returned 1 exit status
make: *** [STM32F30x_UserProject.elf] Error 1
All solved so far.
Now the problem is the encoder.
The motor gives a small start, but then stops.
The motor gets "stuck" (current is flowing).
The encoder is already configured but I can not start up with the control.
My problem is the low revs.
At low speeds the sensorless control does not work because there is no sufficient current through the shunts.
My encoder is a magnetic IC that generates 1024 pulses per mechanical rotation.
This IC also has outputs corresponding to the sensor hall, but I do not think the magnet is calibrated with the rotor.
Monday I will test with sensorless as a primary control and with auxiliary control using encoder.
I'm going to accelerate to 2000 RPM and then I'm slowly going down to 100 RPM. Below the 350RPM the sensorless control can not rotate the motor.