From 80967413d823d7d23a2b44caf715c850b38169ea Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sun, 24 Jun 2018 18:08:59 -0600 Subject: Initial D4S support for Anduril. (but only the parts which can't be public yet) --- spaghetti-monster/fsm-ramping.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'spaghetti-monster/fsm-ramping.h') diff --git a/spaghetti-monster/fsm-ramping.h b/spaghetti-monster/fsm-ramping.h index 86742f6..d530f6a 100644 --- a/spaghetti-monster/fsm-ramping.h +++ b/spaghetti-monster/fsm-ramping.h @@ -73,6 +73,26 @@ void gradual_tick(); #define MAX_1x7135 60 // where it switches from PWM to current control #define HALFSPEED_LEVEL 17 #define QUARTERSPEED_LEVEL 6 + #elif defined(FSM_EMISAR_D4S_DRIVER) + // 3x7135 + FET + #if 0 + // ../../bin/level_calc.py 2 150 7135 1 6 450 FET 1 10 1810 + // (because it made the ramp look better than accurate values) + PROGMEM const uint8_t pwm1_levels[] = { 1,1,2,2,3,3,4,5,5,6,7,7,8,9,10,11,12,13,14,15,16,18,19,20,22,23,25,26,28,30,32,33,35,37,39,42,44,46,48,51,53,56,58,61,64,67,70,73,76,79,83,86,89,93,97,100,104,108,112,116,121,125,129,134,139,143,148,153,158,163,169,174,180,185,191,197,203,209,215,222,228,235,241,248,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0 }; + PROGMEM const uint8_t pwm2_levels[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,4,6,9,11,14,16,19,22,24,27,30,33,36,39,42,45,48,51,54,57,61,64,67,71,74,78,82,85,89,93,96,100,104,108,112,116,121,125,129,133,138,142,147,151,156,160,165,170,175,180,185,190,195,200,205,210,216,221,227,232,238,243,249,255 }; + #define MAX_1x7135 85 + #define HALFSPEED_LEVEL 11 + #define QUARTERSPEED_LEVEL 5 + #else + // ../../bin/level_calc.py 2 150 7135 1 11.2 450 FET 1 10 4000 + // (with a x**9 curve instead of x**3) + // (because it made the ramp look better than accurate values) + PROGMEM const uint8_t pwm1_levels[] = { 1,1,2,2,3,3,4,4,5,5,6,6,7,8,8,9,10,10,11,12,13,14,15,16,17,18,19,21,22,23,25,26,27,29,31,32,34,36,38,40,42,44,46,49,51,54,56,59,62,65,68,71,74,78,81,85,89,93,97,101,106,110,115,120,125,130,136,141,147,153,160,166,173,180,187,195,202,210,219,227,236,245,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0 }; + PROGMEM const uint8_t pwm2_levels[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,4,5,7,8,10,11,13,14,16,18,19,21,23,25,27,29,31,34,36,38,41,43,46,48,51,54,57,60,63,66,69,72,76,79,83,87,91,95,99,103,107,112,116,121,126,131,136,141,146,152,158,163,169,175,182,188,195,202,209,216,223,231,239,247,255 }; + #define MAX_1x7135 83 + #define HALFSPEED_LEVEL 13 + #define QUARTERSPEED_LEVEL 6 + #endif #else // ../../bin/level_calc.py 2 150 7135 4 0.33 150 FET 1 10 1500 //PROGMEM const uint8_t pwm1_levels[] = { 4,4,4,5,5,5,6,6,7,7,8,9,10,11,12,13,14,15,17,18,20,21,23,25,27,30,32,34,37,40,43,46,49,52,56,59,63,67,71,76,80,85,90,95,100,106,112,118,124,130,137,144,151,158,166,173,181,190,198,207,216,225,235,245,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0 }; -- cgit v1.2.3