Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
diy
2018-gr2-project-selbstbalancierender-roboter
Commits
596b23bc
Commit
596b23bc
authored
Aug 02, 2018
by
Quirin Apfel
Browse files
blub
parent
9cee23c9
Changes
4
Hide whitespace changes
Inline
Side-by-side
HalloRobot/libDIY/include/diy_gparser.h
0 → 100644
View file @
596b23bc
#ifndef DIY_GPARSER_H_INCLUDED
#define DIY_GPARSER_H_INCLUDED
typedef
struct
{
uint8_t
code
;
uint16_t
feed_speed
;
uint16_t
x_pos
;
}
g_code_t
;
uint8_t
diy_parse_g_code
(
char
*
command_string
,
g_code_t
*
g_code
);
#endif // DIY_GPARSER_H_INCLUDED
HalloRobot/libDIY/src/diy_gparser.c
0 → 100644
View file @
596b23bc
#include
"diy_parser.h"
uint8_t
diy_parse_g_code
(
char
*
command_string
,
g_code_t
*
g_code
){
}
HalloRobot/libProject/src/control.c
View file @
596b23bc
...
...
@@ -68,9 +68,13 @@ float pi_control(float e)
*/
float
pid_control
(
float
e
)
{
const
float
K
=
0
.
8
f
;
const
float
T_i
=
0
.
5
f
;
//0.18
float
K
=
0
.
8
f
;
const
float
T_i
=
0
.
1
f
;
//0.18
const
float
T_d
=
0
.
05
;
if
(
e
>
2
||
e
<
-
2
){
K
=
5
.
0
;
}
static
float
e_old
=
0
;
...
...
HalloRobot/main.c
View file @
596b23bc
...
...
@@ -181,7 +181,8 @@ void control_thread(cyg_addrword_t arg)
while
(
1
){
error
=
null_offset_pos
-
phi_cor
;
motor_signal
=
control_func_ptr
(
error
);
null_of
/
\\\
////zs_printf("%f,%f,%f\n",null_offset_pos,phi_cor,motor_signal);
null_offset_pos
=
offset_control
(
motor_signal
);
ezs_printf
(
"%f,%f,%f,%f
\n
"
,
null_offset_pos
,
phi_cor
,
error
,
motor_signal
);
motor_pwm
(
motor_signal
);
#ifdef WCET
uint32_t
current_run
=
ezs_watch_stop
(
&
time_sample
);
...
...
Write
Preview
Supports
Markdown
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