Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bioloid_stm32_fw
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
humanoides
bioloid_stm32_fw
Commits
496dbbfa
Commit
496dbbfa
authored
9 years ago
by
Sergi Hernandez
Browse files
Options
Downloads
Patches
Plain Diff
Solved a problem with the motion timing.
parent
89f632b5
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Makefile
+1
-17
1 addition, 17 deletions
Makefile
src/bioloid_stm32.c
+1
-1
1 addition, 1 deletion
src/bioloid_stm32.c
src/eeprom.c
+1
-1
1 addition, 1 deletion
src/eeprom.c
src/motion_manager.c
+7
-3
7 additions, 3 deletions
src/motion_manager.c
with
10 additions
and
22 deletions
Makefile
+
1
−
17
View file @
496dbbfa
...
...
@@ -2,23 +2,7 @@
# modified by zerom for WinARM 8/2010
PROJECT_NAME
=
bioloid_firmware
#TARGET_FILES=$(wildcard src/*.c)
TARGET_FILES
=
src/bioloid_stm32.c
TARGET_FILES
+=
src/system_stm32f4xx.c
TARGET_FILES
+=
src/stm32f4xx_hal_msp.c
TARGET_FILES
+=
src/gpio.c
TARGET_FILES
+=
src/eeprom.c
TARGET_FILES
+=
src/ram.c
TARGET_FILES
+=
src/adc_dma.c
TARGET_FILES
+=
src/zigbee.c
TARGET_FILES
+=
src/bioloid_time.c
TARGET_FILES
+=
src/bioloid_dyn_slave.c
TARGET_FILES
+=
src/bioloid_dyn_master_sensors.c
TARGET_FILES
+=
src/bioloid_dyn_master_servos.c
TARGET_FILES
+=
src/motion_pages.c
TARGET_FILES
+=
src/motion_manager.c
TARGET_FILES
+=
src/action.c
TARGET_FILES
+=
src/bioloid_gyro.c
TARGET_FILES
=
$(
wildcard src/
*
.c
)
TARGET_PROCESSOR
=
STM32F407VG
HAL_PATH
=
../../STM32_processor/hal/f4
...
...
This diff is collapsed.
Click to expand it.
src/bioloid_stm32.c
+
1
−
1
View file @
496dbbfa
...
...
@@ -27,7 +27,7 @@ int32_t main(void)
bioloid_time_init
();
/* initialize zigbee module */
zigbee_init
();
zigbee_enable_power
();
//
zigbee_enable_power();
/* initialize the dynamixel slave interface */
bioloid_dyn_slave_init
();
bioloid_dyn_slave_start
();
...
...
This diff is collapsed.
Click to expand it.
src/eeprom.c
+
1
−
1
View file @
496dbbfa
...
...
@@ -52,7 +52,7 @@
#define DEFAULT_DEVICE_ID 0x0002
#define DEFAULT_BAUDRATE 0x0001
#define DEFAULT_RETURN_DELAY 0x0000
#define DEFAULT_MM_PERIOD 0x
01FF
#define DEFAULT_MM_PERIOD 0x
1E78
#define DEFAULT_BAL_KNEE_GAIN 0x04BE // 1/54 in fixed point format 0|16
#define DEFAULT_BAL_ANKLE_ROLL_GAIN 0x0CCD // 1/20
#define DEFAULT_BAL_ANKLE_PITCH_GAIN 0x0E39 // 1/18
...
...
This diff is collapsed.
Click to expand it.
src/motion_manager.c
+
7
−
3
View file @
496dbbfa
...
...
@@ -147,7 +147,7 @@ void MANAGER_TIMER_IRQHandler(void)
{
__HAL_TIM_CLEAR_IT
(
&
MANAGER_TIM_Handle
,
TIM_IT_CC1
);
capture
=
HAL_TIM_ReadCapturedValue
(
&
MANAGER_TIM_Handle
,
TIM_CHANNEL_1
);
__HAL_TIM_SET_COMPARE
(
&
MANAGER_TIM_Handle
,
TIM_CHANNEL_1
,
(
capture
+
manager_motion_period
));
__HAL_TIM_SET_COMPARE
(
&
MANAGER_TIM_Handle
,
TIM_CHANNEL_1
,
(
capture
+
manager_motion_period
_us
));
// call the action process
action_process
();
// call the joint motion process
...
...
@@ -185,6 +185,10 @@ void manager_init(uint16_t period_us)
// detect the servos connected
dyn_master_scan
(
&
bioloid_dyn_master_servos
,
&
num
,
servo_ids
);
ram_data
[
BIOLOID_MM_NUM_SERVOS
]
=
num
;
if
(
num
>
0
)
gpio_set_led
(
TXD_LED
);
if
(
num
==
18
)
gpio_set_led
(
RXD_LED
);
manager_num_servos
=
0
;
for
(
i
=
0
;
i
<
MANAGER_MAX_NUM_SERVOS
;
i
++
)
{
...
...
@@ -335,7 +339,7 @@ uint16_t manager_get_period_us(void)
void
manager_set_period
(
uint16_t
period_us
)
{
manager_motion_period
=
(
period_us
*
1000000
)
>>
16
;
manager_motion_period
=
(
period_us
<<
16
)
/
1000000
;
manager_motion_period_us
=
period_us
;
ram_data
[
BIOLOID_MM_PERIOD_L
]
=
period_us
&
0x00FF
;
ram_data
[
BIOLOID_MM_PERIOD_H
]
=
(
period_us
&
0xFF00
)
>>
8
;
...
...
@@ -350,7 +354,7 @@ inline void manager_enable(void)
TIM_OCInitStructure
.
OCPolarity
=
TIM_OCPOLARITY_HIGH
;
TIM_OCInitStructure
.
OCFastMode
=
TIM_OCFAST_DISABLE
;
capture
=
HAL_TIM_ReadCapturedValue
(
&
MANAGER_TIM_Handle
,
TIM_CHANNEL_1
);
TIM_OCInitStructure
.
Pulse
=
capture
+
manager_motion_period
;
TIM_OCInitStructure
.
Pulse
=
capture
+
manager_motion_period
_us
;
HAL_TIM_OC_ConfigChannel
(
&
MANAGER_TIM_Handle
,
&
TIM_OCInitStructure
,
TIM_CHANNEL_1
);
HAL_TIM_OC_Start_IT
(
&
MANAGER_TIM_Handle
,
TIM_CHANNEL_1
);
ram_data
[
BIOLOID_MM_CNTRL
]
|=
MANAGER_ENABLE
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment