Commit 91e847db authored by Fabian Mink's avatar Fabian Mink
Browse files

control moved to controlCode.ci (for demonstration)

parent 10a95113
......@@ -6,7 +6,7 @@
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1326667772986208294" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1266316849950418096" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
......@@ -18,7 +18,7 @@
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1326667772986208294" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1266316849950418096" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
......
......@@ -67,9 +67,9 @@ uint16_t enc_pos_raw;
uint16_t enc_pos_raw_z1;
iir1_filter_t speed_iir1;
iir1_filter_t voltage_iir1;
pictrl_t speed_pi;
float speed_raw;
float speed_filt;
static uint16_t datarec_divcnt = 0;
/* USER CODE END PV */
......@@ -680,13 +680,6 @@ void hw_init(void){
filter_iir1_init(&speed_iir1, 20.0f, 0.0625f);
filter_iir1_init(&voltage_iir1, 10.0f, 0.0625f);
//CHR
control_pictrl_init(&speed_pi, 0.57, 78, 62.5e-3f);
//without overshoot
//control_pictrl_init(&speed_pi, 0.1, 35, 62.5e-3f);
speed_pi.max = 15.0f;
speed_pi.min = -15.0f;
//Encoder
LL_TIM_EnableCounter(TIM3);
......@@ -787,24 +780,7 @@ void main_pwm_ctrl(void){
speed_filt = filter_iir1(&speed_iir1, speed_raw);
// *** Control ***
speed_pi.max = udcfval;
speed_pi.min = -udcfval;
// Open-Loop (apply voltage)
if((val_para_mode & 0x02) == 0){
speed_pi.i_val = 0.0f;
uref = val_para_uref[0];
if((val_para_mode & 0x01)){
uref = val_para_uref[1];
}
}
// Closed-Loop (PI Speed controller)
if(val_para_mode & 0x02){
float nref = val_para_nref[0];
if((val_para_mode & 0x01)){
nref = val_para_nref[1];
}
uref = control_pictrl2(&speed_pi, nref, speed_filt);
}
uref = 0.0f;
//*** Voltage output / PWM ***
......@@ -837,14 +813,13 @@ void main_pwm_ctrl(void){
//*** Transient data recorder ***
static int divcnt = 0;
if(val_para_mode & 0x01){
if(divcnt < val_para_datarecClkdiv){
divcnt++;
if(datarec_divcnt < val_para_datarecClkdiv){
datarec_divcnt++;
}
else {
datarec();
divcnt = 0;
datarec_divcnt = 0;
}
}
......
//***** in: *******
void main_pwm_ctrl(void)
//zunaechst:
//Open Loop Control: Set output voltage
uref = val_para_uref[0];
if(val_para_mode == 0){
uref = val_para_uref[0];
}
else {
uref = val_para_uref[1];
}
//Bei USER CODE BEGIN PV anlegen:
pictrl_t speed_pi;
//** in Initialisierung: **
void hw_init(void)
//Chien Hrones Reswick:
control_pictrl_init(&speed_pi, 0.57, 78, 62.5e-3f);
//without overshoot
//control_pictrl_init(&speed_pi, 0.1, 35, 62.5e-3f);
speed_pi.max = udcfval;
speed_pi.min = -udcfval;
// Open-Loop (apply voltage)
if((val_para_mode & 0x02) == 0){
speed_pi.i_val = 0.0f;
uref = val_para_uref[0];
if((val_para_mode & 0x01)){
uref = val_para_uref[1];
}
}
// Closed-Loop (PI Speed controller)
if(val_para_mode & 0x02){
float nref = val_para_nref[0];
if((val_para_mode & 0x01)){
nref = val_para_nref[1];
}
uref = control_pictrl2(&speed_pi, nref, speed_filt);
}
\ No newline at end of file
......@@ -36,7 +36,7 @@
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.stlink_check_serial_number" value="false"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.stlink_txt_serial_number" value=""/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.watchdog_config" value="none"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkrestart_configurations" value="{&quot;fItems&quot;:[{&quot;fDisplayName&quot;:&quot;Reset&quot;,&quot;fIsSuppressible&quot;:false,&quot;fResetAttribute&quot;:&quot;Reset&quot;,&quot;fResetStrategies&quot;:[{&quot;fDisplayName&quot;:&quot;Reset&quot;,&quot;fLaunchAttribute&quot;:&quot;monitor reset&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset&quot;],&quot;fCmdOptions&quot;:[]},{&quot;fDisplayName&quot;:&quot;None&quot;,&quot;fLaunchAttribute&quot;:&quot;no_reset&quot;,&quot;fGdbCommands&quot;:[],&quot;fCmdOptions&quot;:[]}],&quot;fGdbCommandGroup&quot;:{&quot;name&quot;:&quot;Additional commands&quot;,&quot;commands&quot;:[]}}]}"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkrestart_configurations" value="{&quot;fItems&quot;:[{&quot;fDisplayName&quot;:&quot;Reset&quot;,&quot;fIsSuppressible&quot;:false,&quot;fResetAttribute&quot;:&quot;Software system reset&quot;,&quot;fResetStrategies&quot;:[{&quot;fDisplayName&quot;:&quot;Software system reset&quot;,&quot;fLaunchAttribute&quot;:&quot;system_reset&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset\r\n&quot;],&quot;fCmdOptions&quot;:[&quot;-g&quot;]},{&quot;fDisplayName&quot;:&quot;Hardware reset&quot;,&quot;fLaunchAttribute&quot;:&quot;hardware_reset&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset hardware\r\n&quot;],&quot;fCmdOptions&quot;:[&quot;-g&quot;]},{&quot;fDisplayName&quot;:&quot;Core reset&quot;,&quot;fLaunchAttribute&quot;:&quot;core_reset&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset core\r\n&quot;],&quot;fCmdOptions&quot;:[&quot;-g&quot;]},{&quot;fDisplayName&quot;:&quot;None&quot;,&quot;fLaunchAttribute&quot;:&quot;no_reset&quot;,&quot;fGdbCommands&quot;:[],&quot;fCmdOptions&quot;:[&quot;-g&quot;]}],&quot;fGdbCommandGroup&quot;:{&quot;name&quot;:&quot;Additional commands&quot;,&quot;commands&quot;:[]}}]}"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.swv.swv_wait_for_sync" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doHalt" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doReset" value="false"/>
......@@ -68,6 +68,6 @@
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;memoryBlockExpressionList context=&quot;reserved-for-future-use&quot;/&gt;&#13;&#10;"/>
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&lt;memoryBlockExpressionList context=&quot;reserved-for-future-use&quot;/&gt;"/>
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
</launchConfiguration>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment