Source file: /~heha/enas/Kleingeräte/ika-rkt.zip/PMSM_tables.c

#include "PMSM_tables.h"
#include <avr/signature.h>

// Das sind die ersten 120° einer Sinustabelle, 64 Stützstellen
PROGMEM const uint8_t sineTable[] = {
0,      8,      17,     25,     33,     42,     50,     58,
66,     74,     82,     90,     98,     105,    113,    120,
128,    135,    142,    149,    155,    162,    168,    174,
180,    186,    192,    197,    202,    207,    212,    217,
221,    225,    229,    232,    236,    239,    241,    244,
246,    248,    250,    252,    253,    254,    254,    255,
255,    255,    254,    254,    253,    252,    250,    248,
246,    244,    241,    239,    236,    232,    229,    225
};


uint8_t PROGMEM const blockCommutationTableForward[] = {
 0x00,
 /* 0b001 → */	0b100001,
 /* 0b010 → */	0b000110,
 /* 0b011 → */	0b100100,
 /* 0b100 → */	0b011000,
 /* 0b101 → */	0b001001,
 /* 0b110 → */	0b010010,
 0x00
};


uint8_t PROGMEM const blockCommutationTableReverse[] = {
 0x00,
 /* 0b001 → */	0b010010,
 /* 0b010 → */	0b001001,
 /* 0b011 → */	0b011000,
 /* 0b100 → */	0b100100,
 /* 0b101 → */	0b000110,
 /* 0b110 → */	0b100001,
 0x00
};


PROGMEM const uint8_t HallSequenceForward[] = {
 0xff,
 /* 0b001 → */	0b011,
 /* 0b010 → */	0b110,
 /* 0b011 → */	0b010,
 /* 0b100 → */	0b101,
 /* 0b101 → */	0b001,
 /* 0b110 → */	0b100,
 0xff
};


PROGMEM const uint8_t HallSequenceReverse[] = {
 0xff,
 /* 0b001 → */	0b101,
 /* 0b010 → */	0b011,
 /* 0b011 → */	0b001,
 /* 0b100 → */	0b110,
 /* 0b101 → */	0b100,
 /* 0b110 → */	0b010,
 0xff
};


PROGMEM const uint16_t CSOffsetsForward[8] = {
  0,
  5 * (SINE_TABLE_LENGTH/6),
  1 * (SINE_TABLE_LENGTH/6),
  0 * (SINE_TABLE_LENGTH/6),
  3 * (SINE_TABLE_LENGTH/6),
  4 * (SINE_TABLE_LENGTH/6),
  2 * (SINE_TABLE_LENGTH/6),
  0
};


PROGMEM const uint16_t CSOffsetsReverse[8] = {
  0,
  1 * (SINE_TABLE_LENGTH/6),
  5 * (SINE_TABLE_LENGTH/6),
  0 * (SINE_TABLE_LENGTH/6),
  3 * (SINE_TABLE_LENGTH/6),
  2 * (SINE_TABLE_LENGTH/6),
  4 * (SINE_TABLE_LENGTH/6),
  0
};
Detected encoding: UTF-80