Motor Evaluation Kit NEVC-MCTRL-100-t01-1.0.0
Firmware for NEVB-MCTRL-100-01 for trapezoidal control of BLDC motors using Hall-effect sensors
|
Motor Control Tables. More...
Go to the source code of this file.
Macros | |
#define | __AVR_ATmega32U4__ 1 |
Define macro for ATmega32U4 micro controller. | |
Variables | |
const uint8_t | blockCommutationTableForward [32] |
Block Commutation Port Direction Masks for Forward Driving. | |
const uint8_t | blockCommutationTableReverse [32] |
Block Commutation Port Direction Masks for Reverse Driving. | |
const uint8_t | expectedHallSequenceForward [7] |
Table of Expected Hall Sensor Values in Forward Direction. | |
const uint8_t | expectedHallSequenceReverse [7] |
Table of Expected Hall Sensor Values in Reverse Direction. | |
Motor Control Tables.
This file contains table definitions used for motor control, including block commutation masks, expected hall sensor sequences, and related settings.
Definition in file tables.h.
#define __AVR_ATmega32U4__ 1 |
const uint8_t blockCommutationTableForward[32] |
Block Commutation Port Direction Masks for Forward Driving.
This array contains port and output compare override masks for block commutation when running in the forward direction. It defines how the timer controls the output compare (OC) pins and the output state of corresponding pins for each commutation step.
The masks control the following:
Hall | Phase A/PORTB | Phase B/PORTC | Phase C/PORTD | TCCR4E |
---|---|---|---|---|
000 | 0 | 0 | 0 | 0 |
001 | 1 | 0 | 0 | OC_ENABLE_PORTD |
010 | 0 | 1 | 0 | OC_ENABLE_PORTB |
011 | 0 | 0 | 1 | OC_ENABLE_PORTC |
100 | 1 | 0 | 0 | OC_ENABLE_PORTC |
101 | 0 | 0 | 1 | OC_ENABLE_PORTB |
110 | 0 | 1 | 0 | OC_ENABLE_PORTD |
111 | 1 | 0 | 0 | 0 |
Definition at line 80 of file tables.h.
const uint8_t blockCommutationTableReverse[32] |
Block Commutation Port Direction Masks for Reverse Driving.
This array contains port and output compare override masks for block commutation when running in the reverse direction. It defines how the timer controls the output compare (OC) pins and the output state of corresponding pins for each commutation step.
The masks control the following:
Hall | Phase A/PORTB | Phase B/PORTC | Phase C/PORTD | TCCR4E |
---|---|---|---|---|
000 | 0 | 0 | 0 | 0 |
001 | 1 | 0 | 0 | OC_ENABLE_PORTD |
010 | 0 | 1 | 0 | OC_ENABLE_PORTB |
011 | 0 | 0 | 1 | OC_ENABLE_PORTC |
100 | 1 | 0 | 0 | OC_ENABLE_PORTC |
101 | 0 | 0 | 1 | OC_ENABLE_PORTB |
110 | 0 | 1 | 0 | OC_ENABLE_PORTD |
111 | 1 | 0 | 0 | 0 |
Definition at line 128 of file tables.h.
const uint8_t expectedHallSequenceForward[7] |
Table of Expected Hall Sensor Values in Forward Direction.
This array represents the expected next hall sensor value when the motor is running in the forward direction. Each element in the array corresponds to the next anticipated hall sensor value, indexed by the current hall sensor value.
For example, if the current hall sensor value is '2', the next expected hall sensor value in the forward direction is '6'.
Definition at line 149 of file tables.h.
const uint8_t expectedHallSequenceReverse[7] |
Table of Expected Hall Sensor Values in Reverse Direction.
This array represents the expected next hall sensor value when the motor is running in the reverse direction. Each element in the array corresponds to the next anticipated hall sensor value, indexed by the current hall sensor value.
For example, if the current hall sensor value is '2', the next expected hall sensor value in the reverse direction is '3'.
Definition at line 163 of file tables.h.