|
void | motorInit () |
| Initializes the GPIO pins for the motor. More...
|
|
void | M1HIntHandler (void) |
| Hall sensor interrupt for motor 1. More...
|
|
void | M2HIntHandler (void) |
| Hall sensor interrupt for motor 2. More...
|
|
void | motor1ControlPWM (int control) |
| Sets the PWM value and direction to motor 1. More...
|
|
void | motor2ControlPWM (int control) |
| Sets the PWM value and direction to motor 2. More...
|
|
void | motor1Commutate (int State, int control) |
| Commutate motor 1 with a given pwm. More...
|
|
void | motor2Commutate (int State, int control) |
| Commutate motor 2 with a given pwm. More...
|
|
void | motor1PWM (int pwm1, int pwm2, int pwm3) |
| Sets the PWM value to motor 1. More...
|
|
void | motor2PWM (int pwm1, int pwm2, int pwm3) |
| Sets the PWM value to motor 2. More...
|
|
int | getmotor1PWM (void) |
| Returns the current PWM of motor 1. More...
|
|
int | getmotor2PWM (void) |
| Returns the current PWM of motor 2. More...
|
|
int32_t | getmotor1HALLS (void) |
| Returns the current state of the halls for motor 1. More...
|
|
int32_t | getmotor2HALLS (void) |
| Returns the current state of the halls for motor 2. More...
|
|
void | MotorSPIinit (void) |
| Initializes the SPI channels for the motor drivers. More...
|
|
void | motorDriverInit (void) |
| Initializes the SPI commands to set the motor's configuration for 1x PWM mode. More...
|
|
void | M1_INL_WRITE (int a, int b, int c) |
| Commutation table for motor 1. More...
|
|
void | M2_INL_WRITE (int a, int b, int c) |
| Commutation table for motor 2. More...
|
|
The motor source code.
This file contains the motor functions
- Author
- Benjamen Lim
-
Huan Weng
-
Blake Strebel
void motor1ControlPWM |
( |
int |
control | ) |
|
Sets the PWM value and direction to motor 1.
This function handles all the commutation for motor 1. This is done via hall sensing to determine the position the BLDC motor is in.
Example: motor2ControlPWM(200); // sets the motor speed to 5% of default, clockwise delayMS(100); //delay for 100 ms motor2ControlPWM(-200); // sets motor speed to 5% of default, counter clockwise.
- Parameters
-
control | The pwmValue ranges from -maximum pwm period to the positive period. The default pwm period is 4000, 30kHz. |
- Returns
- Void
void motor2ControlPWM |
( |
int |
control | ) |
|
Sets the PWM value and direction to motor 2.
This function handles all the commutation for motor 2. This is done via hall sensing to determine the position the BLDC motor is in.
Example: motor2ControlPWM(200); // sets the motor speed to 5% of default, clockwise delayMS(100); //delay for 100 ms motor2ControlPWM(-200); // sets motor speed to 5% of default, counter clockwise.
- Parameters
-
control | The pwmValue ranges from -maximum pwm period to the positive period. The default pwm period is 4000, 30kHz. |
- Returns
- Void