Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Privacy
Imprint
Contact
Login methods
Sign in
Toggle navigation
Menu
Open sidebar
Fabian Mink
dcmotor_stm32f767zi_drv8871
Commits
91e847db
Commit
91e847db
authored
Jan 18, 2022
by
Fabian Mink
Browse files
control moved to controlCode.ci (for demonstration)
parent
10a95113
Changes
4
Hide whitespace changes
Inline
Side-by-side
.settings/language.settings.xml
View file @
91e847db
...
...
@@ -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=
"-1
3
266
67772986208294
"
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 "${INPUTS}""
prefer-non-shared=
"true"
>
<provider
class=
"com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector"
console=
"false"
env-hash=
"-1266
316849950418096
"
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 "${INPUTS}""
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=
"-1
3
266
67772986208294
"
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 "${INPUTS}""
prefer-non-shared=
"true"
>
<provider
class=
"com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector"
console=
"false"
env-hash=
"-1266
316849950418096
"
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 "${INPUTS}""
prefer-non-shared=
"true"
>
<language-scope
id=
"org.eclipse.cdt.core.gcc"
/>
<language-scope
id=
"org.eclipse.cdt.core.g++"
/>
</provider>
...
...
Core/Src/main.c
View file @
91e847db
...
...
@@ -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
.
0
f
,
0
.
0625
f
);
filter_iir1_init
(
&
voltage_iir1
,
10
.
0
f
,
0
.
0625
f
);
//CHR
control_pictrl_init
(
&
speed_pi
,
0
.
57
,
78
,
62.5e-3
f
);
//without overshoot
//control_pictrl_init(&speed_pi, 0.1, 35, 62.5e-3f);
speed_pi
.
max
=
15
.
0
f
;
speed_pi
.
min
=
-
15
.
0
f
;
//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
.
0
f
;
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
.
0
f
;
//*** 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
;
}
}
...
...
controlCode.ci
0 → 100644
View file @
91e847db
//***** 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
dcmotor_stm32f767zi_drv8871 Debug.launch
View file @
91e847db
...
...
@@ -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=
"{"fItems":[{"fDisplayName":"Reset","fIsSuppressible":false,"fResetAttribute":"
R
eset","fResetStrategies":[{"fDisplayName":"
R
eset","fLaunchAttribute":"
monitor
reset","fGdbCommands":["monitor reset"],"fCmdOptions":[]},{"fDisplayName":"None","fLaunchAttribute":"no_reset","fGdbCommands":[],"fCmdOptions":[]}],"fGdbCommandGroup":{"name":"Additional commands","commands":[]}}]}"
/>
<stringAttribute
key=
"com.st.stm32cube.ide.mcu.debug.stlinkrestart_configurations"
value=
"{"fItems":[{"fDisplayName":"Reset","fIsSuppressible":false,"fResetAttribute":"
Software system r
eset","fResetStrategies":[{"fDisplayName":"
Software system r
eset","fLaunchAttribute":"
system_reset","fGdbCommands":["monitor reset\r\n"],"fCmdOptions":["-g"]},{"fDisplayName":"Hardware reset","fLaunchAttribute":"hardware_
reset","fGdbCommands":["monitor reset
hardware\r\n
"],"fCmdOptions":[
"-g"]},{"fDisplayName":"Core reset","fLaunchAttribute":"core_reset","fGdbCommands":["monitor reset core\r\n"],"fCmdOptions":["-g"
]},{"fDisplayName":"None","fLaunchAttribute":"no_reset","fGdbCommands":[],"fCmdOptions":[
"-g"
]}],"fGdbCommandGroup":{"name":"Additional commands","commands":[]}}]}"
/>
<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=
"<?xml version="1.0" encoding="UTF-8" standalone="no"?>&
#13; &
lt;memoryBlockExpressionList context="reserved-for-future-use"/>
"
/>
<stringAttribute
key=
"org.eclipse.dsf.launch.MEMORY_BLOCKS"
value=
"<?xml version="1.0" encoding="UTF-8" standalone="no"?><memoryBlockExpressionList context="reserved-for-future-use"/>"
/>
<stringAttribute
key=
"process_factory_id"
value=
"org.eclipse.cdt.dsf.gdb.GdbProcessFactory"
/>
</launchConfiguration>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment