forked from ZhuYanzhen1/miniFOC
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify most of the files in the algorithm folder to a format recogniz…
…ed by Doxygen.
- Loading branch information
1 parent
872217c
commit 1fdb661
Showing
16 changed files
with
188 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,44 @@ | ||
// | ||
// Created by Lao·Zhu on 2021/8/24. | ||
// | ||
/**************************************************************************//** | ||
\file config.h | ||
\brief used to place important parameter configurations for users | ||
\author Lao·Zhu | ||
\version V1.0.1 | ||
\date 9. October 2021 | ||
******************************************************************************/ | ||
|
||
#ifndef MINIFOC__CONFIG_H_ | ||
#define MINIFOC__CONFIG_H_ | ||
|
||
#define VBUS 8.4f // Bus voltage is 8.4V | ||
#define POLAR_PAIRS 7 // BLDC motor has 7 polar pairs | ||
#define ENCODER_RESO 4096 // Encoder resolution is 2^8=4096 | ||
#define CALI_TORQUE 0.3f // Calibrating torque is 0.3 | ||
/*! \brief bus voltage is 8.4V */ | ||
#define VBUS 8.4f | ||
/*! \brief set BLDC polar pairs to 7 */ | ||
#define POLAR_PAIRS 7 | ||
/*! \brief SC60228 resolution is 2^8 = 4096 */ | ||
#define ENCODER_RESO 4096 | ||
/*! \brief set calibrate torque to 0.3 */ | ||
#define CALI_TORQUE 0.3f | ||
|
||
#define UART_BAUDRATE 115200 // UART baudrate set to 115200 | ||
#define PWM_FREQUENCY 20 // PWM frequency set to 20kHz | ||
#define TIM2_FREQUENCY 8 // timer2 interrupt frequency set to 8kHz | ||
#define TIM13_FREQUENCY 100 // timer13 interrupt frequency set to 100Hz | ||
#define SPEED_UP_FREQ 200 // speed update frequency set to 200Hz | ||
#define SPI_PRESCALE SPI_PSC_16 // SPI frequency is 72 / 16 = 4.5MHz | ||
/*! \brief set UART baud rate to 115200 */ | ||
#define UART_BAUDRATE 115200 | ||
/*! \brief set PWM frequency to 20kHz */ | ||
#define PWM_FREQUENCY 20 | ||
/*! \brief set FOC loop frequency to 8kHz */ | ||
#define TIM2_FREQUENCY 8 | ||
/*! \brief set speed/angle PID loop frequency to 100Hz */ | ||
#define TIM13_FREQUENCY 100 | ||
/*! \brief set speed update frequency to 200Hz */ | ||
#define SPEED_UP_FREQ 200 | ||
/*! \brief set SPI frequency to 72 / 16 = 4.5MHz */ | ||
#define SPI_PRESCALE SPI_PSC_16 | ||
|
||
#define UART_PRIORITY 1 // UART preemption priority set to 1 | ||
#define TIM2_PRIORITY 2 // TIMER2 preemption priority set to 3 | ||
#define TIM13_PRIORITY 3 // TIMER13 preemption priority set to 2 | ||
/*! \brief UART preemption priority set to 1 */ | ||
#define UART_PRIORITY 1 | ||
/*! \brief TIMER2 preemption priority set to 2 */ | ||
#define TIM2_PRIORITY 2 | ||
/*! \brief TIMER13 preemption priority set to 3 */ | ||
#define TIM13_PRIORITY 3 | ||
|
||
#define FMC_WRITE_START_ADDR 0x08007C00UL // User flash space start address, 1KB user flash | ||
/*! \brief User flash space start address, 1KB user flash */ | ||
#define FMC_WRITE_START_ADDR 0x08007C00UL | ||
|
||
#endif //MINIFOC__CONFIG_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.