rainbow

Dependencies:   mbed FastPWM

Committer:
Lightvalve
Date:
Fri Apr 03 11:44:01 2020 +0000
Revision:
62:b5452adfb2cd
Parent:
61:bc8c8270f0ab
Child:
63:3c6869477483
200403

Who changed what in which revision?

UserRevisionLine numberNew contents of line
GiJeongKim 0:51c43836c1d7 1 #include "mbed.h"
GiJeongKim 0:51c43836c1d7 2 #include "FastPWM.h"
GiJeongKim 0:51c43836c1d7 3 #include "INIT_HW.h"
jobuuu 2:a1c0a37df760 4 #include "function_CAN.h"
GiJeongKim 0:51c43836c1d7 5 #include "SPI_EEP_ENC.h"
GiJeongKim 0:51c43836c1d7 6 #include "I2C_AS5510.h"
GiJeongKim 0:51c43836c1d7 7 #include "setting.h"
Lightvalve 11:82d8768d7351 8 #include "function_utilities.h"
Lightvalve 16:903b5a4433b4 9 #include "stm32f4xx_flash.h"
Lightvalve 16:903b5a4433b4 10 #include "FlashWriter.h"
Lightvalve 61:bc8c8270f0ab 11 #include "Eigen/Dense.h"
Lightvalve 61:bc8c8270f0ab 12
Lightvalve 61:bc8c8270f0ab 13 using namespace std;
Lightvalve 61:bc8c8270f0ab 14 using namespace Eigen;
Lightvalve 61:bc8c8270f0ab 15 Timer t;
GiJeongKim 0:51c43836c1d7 16
Lightvalve 31:66738bfecec5 17 ///191008////
Lightvalve 31:66738bfecec5 18
jobuuu 7:e9086c72bb22 19 // dac & check ///////////////////////////////////////////
GiJeongKim 0:51c43836c1d7 20 DigitalOut check(PC_2);
GiJeongKim 0:51c43836c1d7 21 DigitalOut check_2(PC_3);
GiJeongKim 0:51c43836c1d7 22 AnalogOut dac_1(PA_4);
GiJeongKim 0:51c43836c1d7 23 AnalogOut dac_2(PA_5);
Lightvalve 14:8e7590227d22 24 AnalogIn adc1(PC_4); //pressure_1
Lightvalve 14:8e7590227d22 25 AnalogIn adc2(PB_0); //pressure_2
Lightvalve 14:8e7590227d22 26 AnalogIn adc3(PC_1); //current
GiJeongKim 0:51c43836c1d7 27
Lightvalve 24:ef6e1092e9e6 28
jobuuu 7:e9086c72bb22 29 // PWM ///////////////////////////////////////////
Lightvalve 30:8d561f16383b 30 float dtc_v=0.0f;
Lightvalve 30:8d561f16383b 31 float dtc_w=0.0f;
GiJeongKim 0:51c43836c1d7 32
jobuuu 7:e9086c72bb22 33 // I2C ///////////////////////////////////////////
GiJeongKim 0:51c43836c1d7 34 I2C i2c(PC_9,PA_8); // SDA, SCL (for K22F)
GiJeongKim 0:51c43836c1d7 35 const int i2c_slave_addr1 = 0x56;
GiJeongKim 0:51c43836c1d7 36 unsigned int value; // 10bit output of reading sensor AS5510
GiJeongKim 0:51c43836c1d7 37
jobuuu 7:e9086c72bb22 38 // SPI ///////////////////////////////////////////
Lightvalve 16:903b5a4433b4 39 //SPI eeprom(PB_15, PB_14, PB_13); // EEPROM //(SPI_MOSI, SPI_MISO, SPI_SCK);
Lightvalve 16:903b5a4433b4 40 //DigitalOut eeprom_cs(PB_12);
Lightvalve 16:903b5a4433b4 41 //FlashWriter writer(6);//2부터 7까지 되는듯 아마 sector
GiJeongKim 0:51c43836c1d7 42 SPI enc(PC_12,PC_11,PC_10);
GiJeongKim 0:51c43836c1d7 43 DigitalOut enc_cs(PD_2);
Lightvalve 11:82d8768d7351 44 DigitalOut LED(PA_15);
GiJeongKim 0:51c43836c1d7 45
jobuuu 7:e9086c72bb22 46 // UART ///////////////////////////////////////////
GiJeongKim 0:51c43836c1d7 47 Serial pc(PA_9,PA_10); // _ UART
GiJeongKim 0:51c43836c1d7 48
jobuuu 7:e9086c72bb22 49 // CAN ///////////////////////////////////////////
GiJeongKim 0:51c43836c1d7 50 CAN can(PB_8, PB_9, 1000000);
GiJeongKim 0:51c43836c1d7 51 CANMessage msg;
Lightvalve 11:82d8768d7351 52 void onMsgReceived()
Lightvalve 11:82d8768d7351 53 {
Lightvalve 11:82d8768d7351 54 CAN_RX_HANDLER();
Lightvalve 11:82d8768d7351 55 }
jobuuu 2:a1c0a37df760 56
jobuuu 7:e9086c72bb22 57 // Variables ///////////////////////////////////////////
jobuuu 7:e9086c72bb22 58 State pos;
jobuuu 7:e9086c72bb22 59 State vel;
jobuuu 7:e9086c72bb22 60 State Vout;
jobuuu 7:e9086c72bb22 61 State torq;
jobuuu 7:e9086c72bb22 62 State pres_A;
jobuuu 7:e9086c72bb22 63 State pres_B;
jobuuu 7:e9086c72bb22 64 State cur;
Lightvalve 14:8e7590227d22 65 State valve_pos;
Lightvalve 14:8e7590227d22 66
Lightvalve 14:8e7590227d22 67 State INIT_Vout;
Lightvalve 14:8e7590227d22 68 State INIT_Valve_Pos;
Lightvalve 14:8e7590227d22 69 State INIT_Pos;
Lightvalve 14:8e7590227d22 70 State INIT_torq;
jobuuu 5:a4319f79457b 71
Lightvalve 19:23b7c1ad8683 72 extern int CID_RX_CMD;
Lightvalve 19:23b7c1ad8683 73 extern int CID_RX_REF_POSITION;
Lightvalve 49:e7bcfc244d40 74 extern int CID_RX_REF_VALVE_POS;
Lightvalve 45:35fa6884d0c6 75 extern int CID_RX_REF_PWM;
Lightvalve 19:23b7c1ad8683 76
Lightvalve 19:23b7c1ad8683 77 extern int CID_TX_INFO;
Lightvalve 19:23b7c1ad8683 78 extern int CID_TX_POSITION;
Lightvalve 19:23b7c1ad8683 79 extern int CID_TX_TORQUE;
Lightvalve 19:23b7c1ad8683 80 extern int CID_TX_PRES;
Lightvalve 19:23b7c1ad8683 81 extern int CID_TX_VOUT;
Lightvalve 19:23b7c1ad8683 82 extern int CID_TX_VALVE_POSITION;
Lightvalve 19:23b7c1ad8683 83
Lightvalve 62:b5452adfb2cd 84 MatrixXd Input = MatrixXd::Zero(1,6); //input
Lightvalve 61:bc8c8270f0ab 85 MatrixXd h1 = MatrixXd::Zero(22,32);
Lightvalve 61:bc8c8270f0ab 86 MatrixXd h2 = MatrixXd::Zero(32,32);
Lightvalve 61:bc8c8270f0ab 87 MatrixXd h3 = MatrixXd::Zero(32,32);
Lightvalve 61:bc8c8270f0ab 88 MatrixXd hout = MatrixXd::Zero(32,1);
Lightvalve 61:bc8c8270f0ab 89
Lightvalve 61:bc8c8270f0ab 90 MatrixXd b1 = MatrixXd::Zero(32,1);
Lightvalve 61:bc8c8270f0ab 91 MatrixXd b2 = MatrixXd::Zero(32,1);
Lightvalve 61:bc8c8270f0ab 92 MatrixXd b3 = MatrixXd::Zero(32,1);
Lightvalve 61:bc8c8270f0ab 93 MatrixXd bout = MatrixXd::Zero(1,1);
Lightvalve 61:bc8c8270f0ab 94
Lightvalve 61:bc8c8270f0ab 95 MatrixXd X;
Lightvalve 61:bc8c8270f0ab 96 ArrayXf Y;
Lightvalve 61:bc8c8270f0ab 97 //ArrayXf NNoutput = ArrayXf::Zero(1,1);
Lightvalve 61:bc8c8270f0ab 98 float NNoutput;
Lightvalve 62:b5452adfb2cd 99 float input_array[4] ={0.0f};
Lightvalve 62:b5452adfb2cd 100 float position_array[10] = {0.0f};
Lightvalve 61:bc8c8270f0ab 101
Lightvalve 61:bc8c8270f0ab 102
jobuuu 7:e9086c72bb22 103 // =============================================================================
jobuuu 7:e9086c72bb22 104 // =============================================================================
jobuuu 7:e9086c72bb22 105 // =============================================================================
jobuuu 7:e9086c72bb22 106
Lightvalve 12:6f2531038ea4 107 /*******************************************************************************
Lightvalve 12:6f2531038ea4 108 * REFERENCE MODE
Lightvalve 12:6f2531038ea4 109 ******************************************************************************/
Lightvalve 13:747daba9cf59 110 enum _REFERENCE_MODE {
Lightvalve 13:747daba9cf59 111 MODE_REF_NO_ACT = 0, //0
Lightvalve 12:6f2531038ea4 112 MODE_REF_DIRECT, //1
Lightvalve 12:6f2531038ea4 113 MODE_REF_COS_INC, //2
Lightvalve 12:6f2531038ea4 114 MODE_REF_LINE_INC, //3
Lightvalve 12:6f2531038ea4 115 MODE_REF_SIN_WAVE, //4
Lightvalve 12:6f2531038ea4 116 MODE_REF_SQUARE_WAVE, //5
Lightvalve 12:6f2531038ea4 117 };
Lightvalve 12:6f2531038ea4 118
Lightvalve 12:6f2531038ea4 119 /*******************************************************************************
Lightvalve 12:6f2531038ea4 120 * CONTROL MODE
Lightvalve 12:6f2531038ea4 121 ******************************************************************************/
Lightvalve 13:747daba9cf59 122 enum _CONTROL_MODE {
Lightvalve 12:6f2531038ea4 123 //control mode
Lightvalve 12:6f2531038ea4 124 MODE_NO_ACT = 0, //0
Lightvalve 47:fdcb8bd86fd6 125 MODE_VALVE_POSITION_CONTROL, //1
Lightvalve 47:fdcb8bd86fd6 126 MODE_JOINT_CONTROL, //2
Lightvalve 50:3c630b5eba9f 127
Lightvalve 47:fdcb8bd86fd6 128 MODE_VALVE_OPEN_LOOP, //3
Lightvalve 12:6f2531038ea4 129 MODE_JOINT_POSITION_TORQUE_CONTROL_VALVE_POSITION, //4
Lightvalve 12:6f2531038ea4 130 MODE_VALVE_POSITION_TORQUE_CONTROL_LEARNING, //5
Lightvalve 13:747daba9cf59 131
Lightvalve 12:6f2531038ea4 132 MODE_JOINT_POSITION_PRES_CONTROL_PWM, //6
Lightvalve 12:6f2531038ea4 133 MODE_JOINT_POSITION_PRES_CONTROL_VALVE_POSITION, //7
Lightvalve 12:6f2531038ea4 134 MODE_VALVE_POSITION_PRES_CONTROL_LEARNING, //8
Lightvalve 13:747daba9cf59 135
Lightvalve 12:6f2531038ea4 136 MODE_TEST_CURRENT_CONTROL, //9
Lightvalve 12:6f2531038ea4 137 MODE_TEST_PWM_CONTROL, //10
Lightvalve 21:e5f1a43ea6f9 138
Lightvalve 14:8e7590227d22 139 MODE_CURRENT_CONTROL, //11
Lightvalve 14:8e7590227d22 140 MODE_JOINT_POSITION_TORQUE_CONTROL_CURRENT, //12
Lightvalve 14:8e7590227d22 141 MODE_JOINT_POSITION_PRES_CONTROL_CURRENT, //13
Lightvalve 13:747daba9cf59 142
Lightvalve 12:6f2531038ea4 143 //utility
Lightvalve 12:6f2531038ea4 144 MODE_TORQUE_SENSOR_NULLING = 20, //20
Lightvalve 12:6f2531038ea4 145 MODE_VALVE_NULLING_AND_DEADZONE_SETTING, //21
Lightvalve 12:6f2531038ea4 146 MODE_FIND_HOME, //22
Lightvalve 57:f4819de54e7a 147 MODE_VALVE_GAIN_SETTING, //23
Lightvalve 12:6f2531038ea4 148 MODE_PRESSURE_SENSOR_NULLING, //24
Lightvalve 12:6f2531038ea4 149 MODE_PRESSURE_SENSOR_CALIB, //25
Lightvalve 12:6f2531038ea4 150 MODE_ROTARY_FRICTION_TUNING, //26
Lightvalve 13:747daba9cf59 151
Lightvalve 12:6f2531038ea4 152 MODE_DDV_POS_VS_PWM_ID = 30, //30
Lightvalve 12:6f2531038ea4 153 MODE_DDV_DEADZONE_AND_CENTER, //31
Lightvalve 12:6f2531038ea4 154 MODE_DDV_POS_VS_FLOWRATE, //32
Lightvalve 57:f4819de54e7a 155 MODE_SYSTEM_ID, //33
Lightvalve 12:6f2531038ea4 156 };
Lightvalve 12:6f2531038ea4 157
Lightvalve 61:bc8c8270f0ab 158
Lightvalve 61:bc8c8270f0ab 159
GiJeongKim 0:51c43836c1d7 160 int main()
GiJeongKim 0:51c43836c1d7 161 {
jobuuu 6:df07d3491e3a 162 /*********************************
jobuuu 1:e04e563be5ce 163 *** Initialization
jobuuu 6:df07d3491e3a 164 *********************************/
Lightvalve 57:f4819de54e7a 165 LED = 1;
Lightvalve 61:bc8c8270f0ab 166 pc.baud(9600);
Lightvalve 21:e5f1a43ea6f9 167
GiJeongKim 0:51c43836c1d7 168 // i2c init
Lightvalve 8:5d2eebdad025 169 i2c.frequency(400 * 1000); // 0.4 mHz
Lightvalve 8:5d2eebdad025 170 wait_ms(2); // Power Up wait
Lightvalve 8:5d2eebdad025 171 look_for_hardware_i2c(); // Hardware present
Lightvalve 8:5d2eebdad025 172 init_as5510(i2c_slave_addr1);
Lightvalve 11:82d8768d7351 173 make_delay();
jobuuu 2:a1c0a37df760 174
GiJeongKim 0:51c43836c1d7 175 // // spi init
Lightvalve 16:903b5a4433b4 176 //eeprom.format(8,3);
Lightvalve 16:903b5a4433b4 177 //eeprom.frequency(5000000); //5M
GiJeongKim 0:51c43836c1d7 178 enc.format(8,0);
GiJeongKim 0:51c43836c1d7 179 enc.frequency(5000000); //5M
Lightvalve 11:82d8768d7351 180 make_delay();
Lightvalve 21:e5f1a43ea6f9 181
Lightvalve 16:903b5a4433b4 182 //rom
Lightvalve 19:23b7c1ad8683 183 ROM_CALL_DATA();
Lightvalve 16:903b5a4433b4 184 make_delay();
Lightvalve 13:747daba9cf59 185
GiJeongKim 0:51c43836c1d7 186 // ADC init
jobuuu 5:a4319f79457b 187 Init_ADC();
Lightvalve 11:82d8768d7351 188 make_delay();
jobuuu 2:a1c0a37df760 189
GiJeongKim 0:51c43836c1d7 190 // Pwm init
GiJeongKim 0:51c43836c1d7 191 Init_PWM();
GiJeongKim 0:51c43836c1d7 192 TIM4->CR1 ^= TIM_CR1_UDIS;
Lightvalve 11:82d8768d7351 193 make_delay();
Lightvalve 13:747daba9cf59 194
Lightvalve 11:82d8768d7351 195 // TMR3 init
Lightvalve 11:82d8768d7351 196 Init_TMR3();
Lightvalve 11:82d8768d7351 197 TIM3->CR1 ^= TIM_CR1_UDIS;
Lightvalve 11:82d8768d7351 198 make_delay();
Lightvalve 21:e5f1a43ea6f9 199
Lightvalve 50:3c630b5eba9f 200 // TMR2 init
Lightvalve 56:6f50d9d3bfee 201 // Init_TMR2();
Lightvalve 56:6f50d9d3bfee 202 // TIM2->CR1 ^= TIM_CR1_UDIS;
Lightvalve 56:6f50d9d3bfee 203 // make_delay();
Lightvalve 21:e5f1a43ea6f9 204
GiJeongKim 0:51c43836c1d7 205 // CAN
jobuuu 2:a1c0a37df760 206 can.attach(&CAN_RX_HANDLER);
Lightvalve 11:82d8768d7351 207 CAN_ID_INIT();
Lightvalve 11:82d8768d7351 208 make_delay();
Lightvalve 34:bb2ca2fc2a8e 209
Lightvalve 23:59218d4a256d 210 //Timer priority
Lightvalve 23:59218d4a256d 211 NVIC_SetPriority(TIM3_IRQn, 2);
Lightvalve 57:f4819de54e7a 212 //NVIC_SetPriority(TIM2_IRQn, 3);
Lightvalve 54:647072f5307a 213 NVIC_SetPriority(TIM4_IRQn, 3);
Lightvalve 34:bb2ca2fc2a8e 214
Lightvalve 23:59218d4a256d 215 //can.reset();
Lightvalve 19:23b7c1ad8683 216 can.filter(msg.id, 0xFFFFF000, CANStandard);
Lightvalve 34:bb2ca2fc2a8e 217
GiJeongKim 0:51c43836c1d7 218 // spi _ enc
GiJeongKim 0:51c43836c1d7 219 spi_enc_set_init();
Lightvalve 11:82d8768d7351 220 make_delay();
Lightvalve 13:747daba9cf59 221
Lightvalve 11:82d8768d7351 222 //DAC init
Lightvalve 58:2eade98630e2 223 if (SENSING_MODE == 0) {
Lightvalve 58:2eade98630e2 224 dac_1 = TORQUE_VREF / 3.3f;
Lightvalve 58:2eade98630e2 225 dac_2 = 0.0f;
Lightvalve 58:2eade98630e2 226 } else if (SENSING_MODE == 1) {
Lightvalve 58:2eade98630e2 227 dac_1 = PRES_A_VREF / 3.3f;
Lightvalve 58:2eade98630e2 228 dac_2 = PRES_B_VREF / 3.3f;
Lightvalve 58:2eade98630e2 229 }
Lightvalve 11:82d8768d7351 230 make_delay();
Lightvalve 13:747daba9cf59 231
Lightvalve 19:23b7c1ad8683 232 for (int i=0; i<50; i++) {
Lightvalve 11:82d8768d7351 233 if(i%2==0)
Lightvalve 38:118df027d851 234 ID_index_array[i] = - i * 0.5f;
Lightvalve 11:82d8768d7351 235 else
Lightvalve 38:118df027d851 236 ID_index_array[i] = (i+1) * 0.5f;
Lightvalve 11:82d8768d7351 237 }
Lightvalve 58:2eade98630e2 238
Lightvalve 61:bc8c8270f0ab 239
Lightvalve 61:bc8c8270f0ab 240
Lightvalve 61:bc8c8270f0ab 241
Lightvalve 61:bc8c8270f0ab 242 Input <<
Lightvalve 62:b5452adfb2cd 243 0.052414,0.066907,0.085407,0.109023,0.139169,0.177651;
Lightvalve 61:bc8c8270f0ab 244
Lightvalve 61:bc8c8270f0ab 245
Lightvalve 61:bc8c8270f0ab 246 h1 <<
Lightvalve 61:bc8c8270f0ab 247 -0.02454003319144249,0.13071660697460175,0.08675816655158997,0.1402530074119568,-0.24982963502407074,0.12202739715576172,-0.13030944764614105,-0.11353740841150284,-0.2542628347873688,-0.04588286578655243,-0.14282149076461792,-0.2201535552740097,-0.18691661953926086,0.30389177799224854,-0.1729012429714203,-0.12240276485681534,-0.11355798691511154,0.2349482625722885,-0.24878336489200592,0.07184267044067383,-0.3221011161804199,0.08763179183006287,-0.27257153391838074,-0.06490874290466309,-0.06682667881250381,0.1505383551120758,-0.14478006958961487,-0.07367490231990814,0.23569869995117188,-0.1539779156446457,-0.1400003880262375,0.051764924079179764
Lightvalve 61:bc8c8270f0ab 248 ,-0.19842876493930817,0.18337926268577576,0.24467620253562927,-0.29177823662757874,-0.08481606096029282,0.09983056783676147,0.17972804605960846,-0.07474377751350403,-0.1711931675672531,0.12607872486114502,-0.21832025051116943,-0.1755477339029312,-0.010855759494006634,0.2378554791212082,0.03758585453033447,-0.13797838985919952,-0.15582887828350067,0.08006728440523148,0.280606746673584,0.28338202834129333,-0.06711727380752563,-0.09894979000091553,-0.07788881659507751,0.22705963253974915,-0.0012174372095614672,0.240607351064682,0.1039358377456665,0.18501906096935272,-0.03155122324824333,0.08036407828330994,-0.20284514129161835,0.06699042022228241
Lightvalve 61:bc8c8270f0ab 249 ,0.14068114757537842,0.13828633725643158,-0.0034593045711517334,0.1392701119184494,0.01057615876197815,-0.007689331658184528,0.07328304648399353,-0.14162643253803253,-0.04415355995297432,0.09164466708898544,0.24845272302627563,-0.05588914453983307,-0.054479751735925674,0.24456734955310822,-0.2598671317100525,-0.15801946818828583,0.2817283868789673,-0.19191598892211914,0.15788163244724274,0.28144943714141846,0.14735294878482819,-0.12544888257980347,0.11103320121765137,-0.20203278958797455,0.0017974432557821274,0.1191059947013855,-0.12710560858249664,0.1702873408794403,-0.09684925526380539,0.2480504810810089,-0.28676652908325195,-0.17398564517498016
Lightvalve 61:bc8c8270f0ab 250 ,0.04844924807548523,-0.06973694264888763,-0.1682211458683014,-0.3513043522834778,-0.22794683277606964,0.08840374648571014,0.026485737413167953,-0.3492684066295624,0.1813228577375412,0.06481858342885971,0.11471711844205856,0.1854662299156189,-0.12381665408611298,0.35136616230010986,-0.10501053929328918,-0.016016438603401184,0.03148011490702629,-0.17074286937713623,-0.1689852625131607,0.1171770691871643,-0.23076696693897247,-0.07204706966876984,-0.12052477896213531,-0.23881052434444427,-0.004284285008907318,0.11600598692893982,0.10962119698524475,-0.012203623540699482,0.33345603942871094,0.1084047257900238,0.015447823330760002,0.1315833479166031
Lightvalve 61:bc8c8270f0ab 251 ,0.12315890938043594,0.16742177307605743,0.0689031183719635,-0.29923000931739807,-0.10478553920984268,0.0034702986013144255,-0.06286507844924927,-0.3965417146682739,-0.24317654967308044,0.2535353899002075,-0.18702425062656403,0.2042631357908249,0.14613179862499237,0.2476590871810913,-0.20543844997882843,0.15613335371017456,-0.024847690016031265,-0.12820857763290405,0.13289833068847656,-0.033144671469926834,0.09313736855983734,0.19325080513954163,-0.20106908679008484,-0.061102136969566345,-0.028910696506500244,-0.2806609869003296,0.033241331577301025,-0.26521533727645874,0.33587634563446045,-0.13370811939239502,0.21700626611709595,0.008141759783029556
Lightvalve 61:bc8c8270f0ab 252 ,0.3156174421310425,0.033245913684368134,0.24999621510505676,0.14565978944301605,0.02309553697705269,-0.05169738829135895,-0.15119729936122894,-0.10350330173969269,-0.3457512855529785,0.03809545189142227,0.25342249870300293,-0.19578632712364197,-0.05333413928747177,0.09492939710617065,0.17943906784057617,-0.21144242584705353,-0.1867227405309677,-0.23938390612602234,-0.2632395327091217,0.06656297296285629,0.0961865782737732,-0.00792744755744934,0.10312435030937195,0.27112916111946106,-0.12544961273670197,0.17053177952766418,-0.23970040678977966,0.16830605268478394,0.18481910228729248,-0.0010759234428405762,0.049939122051000595,-0.059725455939769745
Lightvalve 61:bc8c8270f0ab 253 ,0.021065108478069305,-0.17225059866905212,0.1334478259086609,0.09036531299352646,0.22687482833862305,0.03710803762078285,-0.1765347123146057,0.0036233423743396997,-0.17170532047748566,-0.11777474731206894,-0.054618652909994125,-0.17656885087490082,0.052830975502729416,0.10441931337118149,-0.14971962571144104,-0.24781031906604767,-0.023929525166749954,-0.04490154981613159,0.2847473621368408,0.014796234667301178,-0.14429597556591034,-0.14511936902999878,-0.21516084671020508,-0.20089882612228394,-0.10562898963689804,-0.12727710604667664,-0.09228193759918213,-0.08893769234418869,-0.12074583023786545,-0.028564512729644775,0.008117200806736946,0.08297917991876602
Lightvalve 61:bc8c8270f0ab 254 ,0.19532811641693115,-0.05014912784099579,0.13636812567710876,0.048916492611169815,0.26100409030914307,-0.17881926894187927,0.012918300926685333,0.06905974447727203,0.16022373735904694,0.06287040561437607,-0.1698886901140213,-0.3164767324924469,0.06106283515691757,0.05603136122226715,0.04491907358169556,0.16258767247200012,0.06191227212548256,-0.2078513652086258,-0.26503077149391174,0.019191648811101913,-0.06990422308444977,0.018576622009277344,-0.10467308759689331,-0.023303329944610596,0.11910765618085861,0.014545410871505737,-0.2797531187534332,-0.014093500562012196,-0.09087783098220825,0.003536820411682129,-0.08422576636075974,0.20006318390369415
Lightvalve 61:bc8c8270f0ab 255 ,0.03522654250264168,-0.15291047096252441,0.11232474446296692,0.08317171782255173,0.01103570032864809,-0.23718038201332092,-0.043577663600444794,-0.10673496872186661,-0.08802048116922379,0.06057487800717354,-0.2207462638616562,0.21330848336219788,0.06867198646068573,0.31874582171440125,0.19785529375076294,0.11854913830757141,0.0048002502880990505,0.07107115536928177,0.1471722573041916,-0.021459000185132027,-0.25434109568595886,-0.01829427480697632,-0.2427632212638855,0.06919881701469421,-0.2938772141933441,-0.06733335554599762,-0.07296852767467499,0.21985474228858948,0.27857765555381775,-0.09769320487976074,-0.2202656865119934,0.06659334897994995
Lightvalve 61:bc8c8270f0ab 256 ,-0.18176554143428802,0.05808980390429497,-0.2002866566181183,0.2209930419921875,0.22003944218158722,-0.12194468080997467,0.16832226514816284,-0.32419517636299133,-0.31987497210502625,0.020202845335006714,-0.2701215445995331,0.15670055150985718,0.04660305753350258,0.2134874314069748,-0.21944394707679749,-0.25474902987480164,0.27780312299728394,0.28777045011520386,0.10909196734428406,-0.06471110135316849,-0.1670646369457245,0.13422733545303345,-0.09569443762302399,-0.2635143995285034,-0.14163701236248016,0.04615262150764465,0.11132439970970154,0.23280498385429382,0.23840151727199554,0.24882283806800842,0.0529453419148922,0.13884255290031433
Lightvalve 61:bc8c8270f0ab 257 ,-0.10154614597558975,-0.21454781293869019,-0.05455450713634491,0.2060181051492691,-0.24331730604171753,-0.18322165310382843,0.08804970234632492,-0.09168499708175659,-0.3127654492855072,-0.20708662271499634,-0.26258623600006104,-0.2734098434448242,-0.1649116575717926,0.33747056126594543,0.014040976762771606,0.23592090606689453,-0.13581429421901703,-0.1899891048669815,0.19671878218650818,-0.23027168214321136,0.14086498320102692,-0.20761027932167053,0.19642561674118042,0.00928562879562378,-0.07803404331207275,0.08413159847259521,0.06599533557891846,-0.2540142834186554,0.209262415766716,0.0242612361907959,-0.008453809656202793,0.13509076833724976
Lightvalve 61:bc8c8270f0ab 258 ,0.19965791702270508,0.15909932553768158,-0.2523933947086334,-0.024008844047784805,-0.3288625478744507,-0.3593894839286804,-0.10659854859113693,-0.09668480604887009,-0.25964510440826416,0.24553023278713226,0.2584691643714905,-0.13047806918621063,-0.045685749500989914,-0.027066625654697418,-0.24520277976989746,0.2635043263435364,0.06614753603935242,-0.14302769303321838,-0.22128811478614807,-0.2489294409751892,0.2430250197649002,0.1864563524723053,-0.19150227308273315,0.26879218220710754,-0.3449307382106781,0.1727219521999359,0.2771519124507904,0.08954040706157684,0.2631568908691406,0.12126106023788452,0.12375504523515701,-0.054388467222452164
Lightvalve 61:bc8c8270f0ab 259 ,0.19592446088790894,-0.34142163395881653,0.15802547335624695,0.18388450145721436,0.031184343621134758,-0.08831250667572021,-0.20661622285842896,0.06958860903978348,-0.161506786942482,0.25045934319496155,-0.10389973968267441,0.21004287898540497,-0.2358747273683548,-0.1947477161884308,0.05316495895385742,-0.0015946561470627785,-0.15815018117427826,0.1855827420949936,0.01572786457836628,-0.2823503911495209,-0.19912849366664886,0.022287487983703613,0.01019778847694397,-0.002432197332382202,0.1125744953751564,0.024761438369750977,0.28052565455436707,0.06848252564668655,0.07588296383619308,-0.2828674018383026,-0.1949537843465805,0.0682394951581955
Lightvalve 61:bc8c8270f0ab 260 ,-0.06400725990533829,-0.039301756769418716,0.05148342251777649,0.15645751357078552,-0.015306415967643261,-0.027875764295458794,0.19478058815002441,-0.1143186166882515,-0.11950938403606415,0.21234765648841858,0.2555554211139679,-0.05989915132522583,0.014815526083111763,0.12010202556848526,0.08785843849182129,0.0018573424313217402,-0.014310447499155998,0.08359912782907486,-0.05963675677776337,0.08984222263097763,-0.17661209404468536,-0.01255887746810913,0.09742525219917297,-0.2715410590171814,0.019773131236433983,-0.12170138955116272,0.21204951405525208,-0.0392717681825161,0.22050541639328003,0.1981203556060791,-0.12718753516674042,0.18615314364433289
Lightvalve 61:bc8c8270f0ab 261 ,0.207803875207901,-0.10612393915653229,0.2099064588546753,0.048610176891088486,-0.18356028199195862,0.05922550708055496,0.09807947278022766,0.05448151379823685,0.00759892538189888,0.008583632297813892,-0.02326703630387783,0.03895118832588196,0.142264261841774,-0.17807096242904663,0.03243169188499451,0.29156458377838135,0.16580337285995483,-0.04512497037649155,0.24243946373462677,0.19388025999069214,0.2613176107406616,0.21572408080101013,0.021654754877090454,0.19459950923919678,-0.12517954409122467,0.1592874825000763,0.1632046103477478,-0.2606440782546997,-0.08548226952552795,-0.08548004925251007,-0.13906358182430267,-0.16921734809875488
Lightvalve 61:bc8c8270f0ab 262 ,-0.15630532801151276,0.13156533241271973,-0.11297933757305145,0.12861967086791992,-0.19767631590366364,0.1394348293542862,-0.23108699917793274,0.0800437331199646,-0.21714667975902557,0.08518000692129135,-0.25191619992256165,0.23131662607192993,0.03946883976459503,-0.09874357283115387,0.2303425371646881,-0.19213639199733734,0.1962396651506424,-0.10008331388235092,-0.19810836017131805,-0.2060118019580841,0.14884798228740692,0.05755701661109924,-0.10641518235206604,0.0359015166759491,0.1892276555299759,-0.10104718804359436,-0.10194158554077148,0.0636373832821846,-0.0030684147495776415,0.22902312874794006,0.13050015270709991,0.13367223739624023
Lightvalve 61:bc8c8270f0ab 263 ,0.17304399609565735,-0.11803605407476425,0.1952093541622162,-0.058706384152173996,0.07460742443799973,-0.08487367630004883,0.2371104210615158,-0.27557069063186646,0.20663458108901978,0.1713942438364029,-0.27339255809783936,-0.041794922202825546,0.0006373148644343019,0.022903289645910263,-0.03237643837928772,0.1001778319478035,0.1372859627008438,0.2195289433002472,0.1444065421819687,-0.16924221813678741,0.17550763487815857,0.24889472126960754,-0.005206882953643799,-0.09046423435211182,-0.19790777564048767,-0.23666583001613617,-0.04738515615463257,0.19731944799423218,0.18761177361011505,-0.12751927971839905,-0.307704359292984,-0.1543550342321396
Lightvalve 61:bc8c8270f0ab 264 ,0.32603657245635986,-0.3041064739227295,0.25856587290763855,-0.2557964324951172,-0.3466465473175049,-0.3196622133255005,0.12455102801322937,-0.11209218949079514,0.001982415560632944,0.06973601132631302,0.14987079799175262,-0.20265568792819977,0.21144899725914001,-0.10064118355512619,0.09263011813163757,0.2236812561750412,0.11661216616630554,0.06638764590024948,-0.09710270911455154,-0.1529141068458557,0.2093910574913025,-0.21584033966064453,0.008751243352890015,0.06805345416069031,-0.2336517572402954,0.01942119002342224,0.08388552069664001,0.07689709961414337,-0.1510092169046402,0.2813257873058319,-0.2768191695213318,-0.037080224603414536
Lightvalve 61:bc8c8270f0ab 265 ,-0.003318269969895482,0.08421637862920761,-0.016360998153686523,-0.12425577640533447,-0.35029125213623047,0.16315333545207977,0.1867244839668274,0.04439976066350937,-0.1956385225057602,0.12546296417713165,0.14696259796619415,0.031027860939502716,0.13122601807117462,0.28269803524017334,0.09633612632751465,-0.15478374063968658,0.22323313355445862,-0.0710759162902832,-0.27780935168266296,0.053979892283678055,-0.015637023374438286,-0.1954222172498703,-0.0505031943321228,0.24318388104438782,-0.2976081073284149,-0.10191759467124939,-0.07833482325077057,-0.288814902305603,0.040884505957365036,0.138712078332901,0.20733070373535156,-0.29824215173721313
Lightvalve 61:bc8c8270f0ab 266 ,-0.18242500722408295,-0.3011151850223541,-0.18937499821186066,0.21996764838695526,0.08294257521629333,0.19795776903629303,-0.2721400856971741,-0.2665696442127228,-0.1749664843082428,-0.11208948493003845,-0.12227600067853928,0.13757038116455078,0.15364645421504974,-0.1376083493232727,0.14986392855644226,0.27994680404663086,0.11594970524311066,-0.0993688553571701,0.08206108957529068,-0.30797436833381653,0.1478293389081955,0.029855877161026,0.037324488162994385,-0.16034488379955292,-0.22942794859409332,-0.07402129471302032,0.01556810736656189,0.07635907083749771,0.1468832641839981,0.2229032814502716,0.2030598223209381,0.011082095094025135
Lightvalve 61:bc8c8270f0ab 267 ,-0.031403448432683945,-0.179839089512825,-0.061174169182777405,0.08824600279331207,-0.05152688920497894,0.09737619012594223,-0.019338518381118774,-0.149160236120224,-0.17775475978851318,0.20135465264320374,-0.26330751180648804,-0.20573703944683075,-0.18354615569114685,0.2306104153394699,-0.12902851402759552,-0.32519760727882385,-0.18613660335540771,-0.04431162402033806,0.07692430913448334,0.2852676808834076,0.18445321917533875,-0.1602698266506195,0.1428212821483612,0.24115940928459167,-0.15170736610889435,0.2710312306880951,-0.08893628418445587,0.08192634582519531,0.1068575456738472,-0.2417295277118683,0.018182098865509033,0.011811523698270321
Lightvalve 61:bc8c8270f0ab 268 ,0.1185283288359642,-0.1314961016178131,-0.2746659219264984,0.018920723348855972,0.11404602974653244,0.14093975722789764,-0.1613728106021881,0.010870097205042839,0.05537481606006622,-0.1315172165632248,-0.18558558821678162,-0.12937135994434357,-0.20973187685012817,0.1692427098751068,-0.045904770493507385,0.1710028052330017,0.01777065359055996,0.29331231117248535,-0.12049029022455215,0.04678349569439888,-0.25235429406166077,-0.033619701862335205,-0.042226120829582214,-0.27914759516716003,0.006846277974545956,0.08922392129898071,0.171451598405838,0.050000399351119995,-0.04939000681042671,-0.2795959711074829,0.26425138115882874,-0.2566368877887726;
Lightvalve 61:bc8c8270f0ab 269
Lightvalve 61:bc8c8270f0ab 270 h2 <<
Lightvalve 61:bc8c8270f0ab 271 -0.13349971175193787,-0.10295046865940094,-0.04925942420959473,0.005893866065889597,-0.12596699595451355,0.2987118661403656,0.07975713163614273,0.06396704912185669,-0.30411389470100403,-0.10008957982063293,0.014623122289776802,-0.0538821816444397,0.048359375447034836,0.24325567483901978,0.10184130072593689,-0.24775750935077667,0.07803884148597717,-0.21483641862869263,0.17120853066444397,0.00830860622227192,-0.29617825150489807,-0.22132611274719238,-0.23983746767044067,-0.28275105357170105,-0.3873054087162018,0.30998873710632324,-0.4226490557193756,-0.11779281497001648,0.23828622698783875,0.11771553754806519,-0.37041905522346497,-0.30605563521385193
Lightvalve 61:bc8c8270f0ab 272 ,-0.16083313524723053,0.002147972583770752,-0.04321768879890442,0.20690490305423737,0.022892558947205544,0.008302271366119385,-0.20543429255485535,-0.08731026947498322,0.24677053093910217,0.048597872257232666,0.20651067793369293,0.16381694376468658,0.28672969341278076,-0.3506166338920593,0.06659439951181412,0.04734180495142937,0.03125026077032089,-0.2737269401550293,-0.21843840181827545,0.3144419193267822,0.10113385319709778,0.14034439623355865,-0.16832955181598663,0.33271604776382446,0.19579239189624786,0.14696596562862396,0.06076221913099289,0.24354417622089386,-0.28620439767837524,-0.0511949360370636,0.2096933126449585,0.040742650628089905
Lightvalve 61:bc8c8270f0ab 273 ,-0.1579037755727768,0.28447648882865906,-0.1789936125278473,0.20799604058265686,0.025723248720169067,0.17740526795387268,-0.1666354387998581,-0.06060470640659332,-0.017253071069717407,-0.2790656089782715,-0.16800916194915771,-0.2990717589855194,0.07126197218894958,-0.08032660186290741,-0.1799015998840332,-0.1891922950744629,0.2556300461292267,0.2080206573009491,-0.24888339638710022,0.27691522240638733,-0.21319638192653656,-0.14012537896633148,-0.30466505885124207,-0.013728171586990356,-0.1629670113325119,0.2530798614025116,0.0633285641670227,0.0011726915836334229,-0.14820529520511627,0.2823629677295685,0.10884168744087219,-0.2637729346752167
Lightvalve 61:bc8c8270f0ab 274 ,-0.12927524745464325,-0.01806354522705078,-0.23058539628982544,-0.030255556106567383,-0.6437712907791138,-0.17983144521713257,0.12746267020702362,0.08151327818632126,-0.06944303214550018,0.09271347522735596,-0.0808296874165535,-0.24855418503284454,-0.11665885150432587,0.12946322560310364,-0.0930287167429924,-0.3423658609390259,0.10996055603027344,0.24023392796516418,0.2942558825016022,-0.17709596455097198,-0.1255558878183365,-0.2134709507226944,-0.06394433975219727,-0.24457648396492004,0.10029968619346619,-0.2400282919406891,0.11666780710220337,-0.14067168533802032,-0.22396358847618103,0.2546447217464447,-0.002586635062471032,0.04970479756593704
Lightvalve 61:bc8c8270f0ab 275 ,-0.18258020281791687,0.2506926953792572,-0.0804666131734848,0.05040470138192177,0.02259594015777111,-0.23578980565071106,-0.09264150261878967,0.0013416205765679479,0.043158918619155884,-0.2690317630767822,0.04383622854948044,-0.25736406445503235,-0.21347089111804962,-0.19318343698978424,-0.21244710683822632,-0.13572444021701813,-0.1285906583070755,0.15626338124275208,-0.050212472677230835,0.0982573851943016,0.11135826259851456,0.06453899294137955,0.19172045588493347,-0.22890380024909973,-0.12237071990966797,0.09743352234363556,0.10070990025997162,0.28772199153900146,0.2695164978504181,-0.16498444974422455,0.014173826202750206,-0.2047310173511505
Lightvalve 61:bc8c8270f0ab 276 ,-0.19158349931240082,-0.004258692264556885,0.032371193170547485,-0.3141036927700043,-0.026762403547763824,-0.29336631298065186,0.08645252138376236,-0.16367173194885254,-0.03548547625541687,0.08825305104255676,-0.16509909927845,0.22309480607509613,-0.22282296419143677,0.2915789783000946,-0.24179422855377197,-0.19140881299972534,0.21163100004196167,0.24713221192359924,0.28102827072143555,0.25016462802886963,0.020191945135593414,0.19882827997207642,-0.1307595670223236,-0.059169698506593704,0.2300402969121933,-0.261514276266098,0.22954094409942627,-0.12279488891363144,0.05800282955169678,-0.26823562383651733,0.16349054872989655,0.1337476223707199
Lightvalve 61:bc8c8270f0ab 277 ,-0.21433322131633759,-0.1279313862323761,-0.11171227693557739,0.27164509892463684,-0.26441383361816406,0.2845393121242523,0.07359254360198975,-0.20844537019729614,-0.26620519161224365,0.17144301533699036,-0.061109013855457306,-0.19284695386886597,0.29584869742393494,-0.02723398245871067,-0.11244286596775055,0.0967603325843811,-0.16153597831726074,0.18742787837982178,-0.13470113277435303,0.12359786033630371,0.0469309501349926,0.02421507239341736,-0.07988794147968292,-0.15143592655658722,-0.18177983164787292,0.1452380120754242,0.2337561547756195,-0.17263798415660858,-0.11822041869163513,0.19546762108802795,-0.16657039523124695,-0.033323969691991806
Lightvalve 61:bc8c8270f0ab 278 ,0.29264822602272034,0.11346611380577087,0.04012581706047058,-0.0461408905684948,0.225418359041214,-0.05009126663208008,0.013211707584559917,0.004197537899017334,0.2864855229854584,0.01006925106048584,-0.010690944269299507,0.11204484105110168,-0.16305525600910187,-0.09700464457273483,0.08624142408370972,-0.3024343252182007,-0.29751643538475037,0.2706601917743683,0.19159749150276184,-0.1787676364183426,0.07430826127529144,0.05496254935860634,-0.07979777455329895,0.16874255239963531,-0.37327951192855835,0.09258365631103516,0.44089770317077637,-0.042961325496435165,-0.14135785400867462,0.07403197884559631,0.09825335443019867,0.07322394847869873
Lightvalve 61:bc8c8270f0ab 279 ,0.28564146161079407,0.2890130579471588,-0.021617114543914795,0.08250059932470322,0.3030112683773041,0.07065775990486145,-0.236245796084404,-0.2608001232147217,0.29470762610435486,-0.06864601373672485,0.2483109086751938,-0.20344071090221405,0.2957691252231598,-0.13390012085437775,0.19158922135829926,0.3726794719696045,0.02077532187104225,0.06025278568267822,0.05459544435143471,0.41055813431739807,0.32145416736602783,0.030043581500649452,0.28743305802345276,0.19736182689666748,0.1656898558139801,-0.28868207335472107,-0.039911627769470215,-0.006442106794565916,0.2501918375492096,-0.14010676741600037,-0.10169651359319687,-0.15317825973033905
Lightvalve 61:bc8c8270f0ab 280 ,0.2615049183368683,0.08643358945846558,-0.29237738251686096,-0.2458128184080124,0.20376496016979218,-0.0771239846944809,0.1555452048778534,-0.15540927648544312,0.18755429983139038,-0.07031691074371338,-0.06268419325351715,-0.041090548038482666,0.042330075055360794,0.27333545684814453,-0.008807391859591007,0.1133832335472107,-0.040624819695949554,-0.2859399914741516,-0.26647016406059265,-0.2497035712003708,0.09534543007612228,0.09418291598558426,-0.2307620644569397,0.055859606713056564,-0.07496815174818039,-0.19647599756717682,0.02131301537156105,0.09323979169130325,0.2113950550556183,0.0796298086643219,-0.06491973996162415,-0.3819006681442261
Lightvalve 61:bc8c8270f0ab 281 ,0.19981321692466736,0.1956864297389984,-0.033508092164993286,-0.22838544845581055,-0.12505969405174255,0.026693344116210938,0.07720576971769333,0.14285165071487427,-0.17670965194702148,0.17403557896614075,-0.22244372963905334,0.1680217683315277,-0.1060299277305603,0.1071399599313736,-0.11092887073755264,-0.05349590629339218,0.03990337252616882,0.0716913640499115,0.22807641327381134,-0.13356927037239075,0.1965365707874298,0.1245347261428833,0.07470300793647766,0.1796993613243103,-0.004812136758118868,0.10351252555847168,-0.057905394583940506,-0.18869787454605103,0.13817378878593445,0.17853263020515442,-0.027914874255657196,-0.02365732006728649
Lightvalve 61:bc8c8270f0ab 282 ,-0.2546439468860626,-0.09556084871292114,0.12328919768333435,0.03998832777142525,-0.30052247643470764,0.24699172377586365,-0.32009536027908325,-0.11670328676700592,0.17735600471496582,0.009893029928207397,0.26776403188705444,0.19816415011882782,-0.05558810010552406,-0.19641350209712982,0.3241870105266571,-0.0002136280236300081,-0.015536589547991753,0.10842388868331909,0.2418537586927414,0.25024867057800293,-0.0643463209271431,-0.06727208197116852,0.09996896982192993,0.08140590041875839,-0.12102364748716354,0.09566594660282135,0.026901600882411003,0.24559487402439117,-0.288028746843338,-0.2434448003768921,0.1651056408882141,0.23462900519371033
Lightvalve 61:bc8c8270f0ab 283 ,-0.08816954493522644,0.2728963792324066,-0.07170480489730835,0.08861888200044632,-0.08407828211784363,0.20119628310203552,-0.021976735442876816,0.020944571122527122,-0.15294449031352997,-0.038666754961013794,-0.1334909051656723,0.2502269148826599,0.20107106864452362,-0.2309870719909668,0.26465773582458496,0.09385055303573608,-0.0016800533048808575,0.21900424361228943,0.22734272480010986,0.15115073323249817,-0.3155216872692108,0.03708222880959511,-0.19714993238449097,0.18521378934383392,0.10345728695392609,0.21989409625530243,-0.008119909092783928,-0.27566710114479065,0.18573936820030212,0.15478622913360596,0.03387163206934929,-0.09682217240333557
Lightvalve 61:bc8c8270f0ab 284 ,0.14700931310653687,0.1833711564540863,-0.0858893096446991,0.03548716753721237,-0.03290480375289917,0.2733006179332733,-0.00011049837485188618,-0.1723647564649582,0.000652611255645752,-0.22920364141464233,0.03385178744792938,-0.11219978332519531,0.23820827901363373,0.33258119225502014,0.05578869208693504,-0.21240083873271942,-0.07963520288467407,0.14483880996704102,-0.18910400569438934,-0.1327388882637024,-0.024066906422376633,0.2018621563911438,-0.2228696048259735,0.2577541768550873,-0.16621330380439758,0.06491447985172272,-0.09694764763116837,0.19547560811042786,-0.011228948831558228,0.26896968483924866,-0.360990971326828,-0.2201414704322815
Lightvalve 61:bc8c8270f0ab 285 ,-0.23982827365398407,0.03880670666694641,-0.013682037591934204,-0.11685100197792053,-0.020662933588027954,0.30190005898475647,-0.14934301376342773,-0.15993990004062653,0.1152651309967041,-0.11991468071937561,-0.15497799217700958,0.11116543412208557,-0.2045515924692154,0.2403949797153473,-0.21275603771209717,0.05732181668281555,-0.2770107090473175,0.088544100522995,0.19012078642845154,-0.07119561731815338,-0.18914666771888733,-0.10413256287574768,-0.16050675511360168,0.11598068475723267,-0.03151249885559082,-0.1937510371208191,0.18474078178405762,0.19502457976341248,0.22045472264289856,-0.29474368691444397,0.09864541888237,0.06054645776748657
Lightvalve 61:bc8c8270f0ab 286 ,-0.1617974042892456,0.1317739188671112,0.03260180354118347,-0.19948318600654602,-0.0928228572010994,-0.1987132430076599,-0.1755896806716919,0.11372503638267517,0.05445769429206848,0.07657262682914734,-0.18663887679576874,-0.23218511044979095,0.2056141495704651,0.03608625754714012,0.33959874510765076,-0.3019200563430786,-0.25386664271354675,-0.18997573852539062,-0.06610497832298279,-0.1891406625509262,-0.10423542559146881,-0.11639183014631271,-0.3044300675392151,0.2589237689971924,-0.06821785122156143,0.17655706405639648,0.1661142259836197,-0.24122722446918488,-0.0006675124168395996,-0.2239055633544922,-0.0723206177353859,0.2102394998073578
Lightvalve 61:bc8c8270f0ab 287 ,0.036086976528167725,-0.062024205923080444,0.10704237222671509,-0.1612134575843811,-0.1631729155778885,0.1497061848640442,0.03271482139825821,0.27597710490226746,-0.23304778337478638,-0.035415440797805786,0.1086379662156105,0.07746559381484985,0.13613636791706085,0.09150157123804092,0.25167548656463623,-0.24342824518680573,-0.027234435081481934,0.19620582461357117,0.44021302461624146,-0.23242811858654022,-0.05763920396566391,-0.09912444651126862,-0.19671492278575897,-0.33463647961616516,-0.40228715538978577,-0.000608850852586329,0.06298207491636276,0.39882805943489075,-0.2531542181968689,0.24004116654396057,-0.30925723910331726,-0.26930177211761475
Lightvalve 61:bc8c8270f0ab 288 ,0.1379433274269104,-0.16078773140907288,0.11784148216247559,0.20431241393089294,0.29410573840141296,0.19759181141853333,0.09952005743980408,0.1544932872056961,0.040603965520858765,-0.2119520902633667,0.18040086328983307,-0.38904741406440735,-0.046765703707933426,0.13744039833545685,-0.3137235641479492,0.05679671838879585,0.1565159410238266,0.2297056019306183,0.032699450850486755,0.20715069770812988,-0.016263214871287346,-0.3025153875350952,0.26029130816459656,0.42276427149772644,0.2875830829143524,-0.12763257324695587,-0.20330224931240082,-0.07699788361787796,-0.08671019971370697,-0.019541800022125244,0.4000849425792694,0.17512208223342896
Lightvalve 61:bc8c8270f0ab 289 ,0.09298902750015259,0.2841971218585968,-0.0814327746629715,-0.010091223753988743,-0.12308911234140396,0.11057800054550171,-0.1737426221370697,0.20642486214637756,-0.2925014793872833,0.022429823875427246,-0.06304851174354553,-0.07166500389575958,-0.26361000537872314,0.050878144800662994,0.189671128988266,0.30893731117248535,0.1296386420726776,0.027322769165039062,0.29731038212776184,0.14744597673416138,0.2998683750629425,0.08306887000799179,0.06231796741485596,0.3401893973350525,-0.004573390819132328,0.18759925663471222,-0.16945621371269226,0.01625938154757023,0.14345040917396545,-0.11986468732357025,-0.21137407422065735,0.1280972957611084
Lightvalve 61:bc8c8270f0ab 290 ,-0.14775772392749786,0.29651907086372375,0.02990397810935974,-0.06818585097789764,0.1993788629770279,-0.22813674807548523,0.16850803792476654,0.24565419554710388,-0.2325194776058197,-0.2458522766828537,-0.017307782545685768,-0.12818260490894318,-0.17801909148693085,-0.2504909038543701,0.1731644719839096,0.18156693875789642,0.23218704760074615,0.11064860224723816,-0.15070302784442902,0.10314767062664032,0.3309069275856018,-0.28518369793891907,-0.07374785840511322,0.05567348375916481,-0.01467915065586567,-0.3420534133911133,-0.21914657950401306,0.23488031327724457,-0.2205982804298401,0.28094157576560974,-0.15506510436534882,0.07852166146039963
Lightvalve 61:bc8c8270f0ab 291 ,0.2703488767147064,-0.16041381657123566,0.12738299369812012,-0.045484237372875214,0.06815514713525772,0.1861400008201599,-0.15391220152378082,0.28177282214164734,0.1474648416042328,-0.23766008019447327,0.025048013776540756,0.06622862070798874,0.09594401717185974,-0.1663329154253006,-0.10072105377912521,-0.044219132512807846,-0.2531753182411194,0.08700510859489441,-0.26066508889198303,0.07304855436086655,-0.13394378125667572,0.22174499928951263,-0.18301571905612946,-0.16244065761566162,-0.004656728822737932,0.2568950057029724,0.15513287484645844,-0.2911604344844818,0.08541131019592285,0.08213254809379578,-0.258662611246109,0.04998021572828293
Lightvalve 61:bc8c8270f0ab 292 ,-0.06283275783061981,-0.26753589510917664,-0.10381917655467987,-0.13344663381576538,0.2644997537136078,0.2204643189907074,0.2924788296222687,-0.17931663990020752,-0.09078609943389893,-0.17306232452392578,0.02247890830039978,-0.26996222138404846,0.22075030207633972,-0.3029964864253998,0.21873190999031067,-0.0030784308910369873,0.18228653073310852,0.09971508383750916,-0.242676243185997,-0.1424383968114853,0.19031599164009094,0.3004438579082489,-0.23650792241096497,-0.2683113217353821,0.29957786202430725,0.08561205863952637,-0.1366746425628662,-0.15950153768062592,-0.07675467431545258,-0.2218506634235382,-0.2795913517475128,0.1869203746318817
Lightvalve 61:bc8c8270f0ab 293 ,0.2003176510334015,-0.27792131900787354,0.055196613073349,-0.27959588170051575,0.18430876731872559,-0.05316638946533203,0.16156336665153503,-0.18850930035114288,0.09482413530349731,0.021483391523361206,0.009039878845214844,0.1586727499961853,0.11457142233848572,0.2876913249492645,-0.24802550673484802,0.14089101552963257,-0.06842575967311859,-0.10107968747615814,0.06239110231399536,-0.2528536915779114,-0.27538973093032837,0.15457189083099365,-0.15549622476100922,0.20245882868766785,0.08544808626174927,0.22650876641273499,-0.05268847942352295,0.20387354493141174,0.24724552035331726,0.21444126963615417,0.05186706781387329,-0.11084021627902985
Lightvalve 61:bc8c8270f0ab 294 ,-0.19810965657234192,0.2745245397090912,0.1767616868019104,0.19752147793769836,0.0650932788848877,0.29138168692588806,-0.29061684012413025,0.010446667671203613,0.025284886360168457,-0.10202452540397644,-0.10358673334121704,0.14746251702308655,0.15136101841926575,0.04500553011894226,-0.2497977316379547,-0.29277902841567993,0.02556520700454712,-0.09509801864624023,0.16731274127960205,-0.25266408920288086,-0.3004688322544098,-0.19769597053527832,-0.14847496151924133,0.3053832948207855,0.07563886046409607,-0.10258816182613373,-0.060128673911094666,0.0016401112079620361,-0.29647189378738403,-0.18869297206401825,0.05497395992279053,0.16092956066131592
Lightvalve 61:bc8c8270f0ab 295 ,-0.011267274618148804,-0.25281068682670593,-0.10565309226512909,-0.10787995159626007,0.23997481167316437,0.011940985918045044,0.10584557056427002,-0.22430141270160675,-0.06814777851104736,-0.24531681835651398,-0.07618588954210281,0.12015970051288605,0.0185067281126976,0.002306112553924322,0.17718534171581268,0.3006735146045685,0.1760181039571762,0.04417389631271362,0.20160885155200958,0.16602091491222382,0.2585296034812927,-0.027029002085328102,-0.2520882785320282,0.29521048069000244,0.25318053364753723,0.05056742578744888,0.22924767434597015,-0.03404907137155533,-0.18211489915847778,-0.15127526223659515,0.18461528420448303,0.2534249424934387
Lightvalve 61:bc8c8270f0ab 296 ,-0.10580866038799286,-0.17215237021446228,-0.01352420449256897,-0.13443149626255035,-0.10265451669692993,-0.2169143706560135,0.30098411440849304,-0.2986297905445099,0.07908004522323608,-0.30061498284339905,0.10424068570137024,-0.018799901008605957,-0.18665757775306702,0.005998075008392334,-0.2969498336315155,0.18525955080986023,0.2379322350025177,0.15184926986694336,0.215760737657547,-0.19088758528232574,0.08620095252990723,0.019999295473098755,-0.0752219706773758,0.11181813478469849,0.1881926953792572,0.2210972011089325,0.13236162066459656,-0.06690356135368347,-0.18345263600349426,-0.14861416816711426,0.08577704429626465,-0.09683996438980103
Lightvalve 61:bc8c8270f0ab 297 ,0.03951254487037659,0.23604217171669006,0.012746036052703857,-0.12561996281147003,-0.1283164620399475,0.25823846459388733,0.10610169172286987,0.22718152403831482,0.1749366819858551,0.007794857025146484,0.11289489269256592,0.2725127637386322,-0.13616766035556793,-0.03546282649040222,-0.1685536652803421,-0.24492129683494568,0.15760570764541626,0.017505377531051636,-0.273531436920166,-0.005667984485626221,0.18370777368545532,-0.023328542709350586,0.2379932701587677,-0.048420339822769165,0.10376441478729248,-0.295401930809021,-0.20498433709144592,0.22346952557563782,-0.26649031043052673,-0.08466874063014984,0.23347875475883484,-0.03380200266838074
Lightvalve 61:bc8c8270f0ab 298 ,0.3014208972454071,-0.11652402579784393,0.24921879172325134,0.16919833421707153,-0.33012309670448303,-0.19414515793323517,-0.031346261501312256,-0.11968852579593658,0.23963233828544617,0.21321198344230652,-0.04236738383769989,-0.04909612983465195,-0.15507397055625916,0.041283149272203445,-0.0798816904425621,-0.16132454574108124,-0.22342979907989502,0.2487291395664215,-0.275277704000473,-0.1761859953403473,-0.1089298352599144,0.14958830177783966,-0.09928475320339203,-0.18516667187213898,-0.11554347723722458,0.2378307580947876,0.042566750198602676,-0.09927814453840256,-0.03476092219352722,0.2736774981021881,0.01615159772336483,-0.08927445858716965
Lightvalve 61:bc8c8270f0ab 299 ,-0.17075178027153015,0.009595632553100586,0.2466227114200592,0.033388618379831314,-0.34659287333488464,-0.2819134294986725,-0.07840541750192642,-0.15331926941871643,-0.2516406178474426,0.012286126613616943,0.20758569240570068,-0.2048848569393158,-0.12051127851009369,0.10427423566579819,0.0999673530459404,0.028271911665797234,-0.24087269604206085,-0.048499464988708496,-0.20961162447929382,0.10103815048933029,-0.2312844693660736,-0.22412340342998505,-0.031352698802948,0.27904242277145386,-0.11300363391637802,-0.16207841038703918,-0.33752813935279846,0.3786945641040802,-0.07090267539024353,-0.23986908793449402,-0.30680611729621887,-0.0811222642660141
Lightvalve 61:bc8c8270f0ab 300 ,-0.01348048448562622,0.08233943581581116,0.18838337063789368,0.21852442622184753,-0.04740855097770691,0.19177213311195374,-0.0060100555419921875,0.20933791995048523,0.06356173753738403,0.063028484582901,0.09440034627914429,0.29559019207954407,-0.2545689642429352,-0.09652335941791534,-0.2841038703918457,-0.03553757071495056,0.02329021692276001,-0.08720272779464722,-0.0750999003648758,-0.10468094050884247,-0.03761094808578491,-0.030853450298309326,0.2112145721912384,0.2599640190601349,-0.2969062626361847,-0.13667742908000946,0.24173608422279358,0.09566575288772583,0.021116197109222412,-0.005982398986816406,-0.26417285203933716,0.1879688799381256
Lightvalve 61:bc8c8270f0ab 301 ,-0.1763739138841629,-0.17203155159950256,0.0620841383934021,-0.04815051332116127,-0.08886270225048065,-0.19284456968307495,0.09443464875221252,0.1472807228565216,-0.21029016375541687,0.2210421860218048,-0.26095423102378845,0.23557153344154358,-0.07677116990089417,-0.16641905903816223,-0.16725768148899078,-0.2004043012857437,0.08218716084957123,-0.29308468103408813,-0.057871971279382706,-0.07429885864257812,0.2029605507850647,-0.19719278812408447,-0.22302524745464325,0.2192145586013794,-0.13908077776432037,0.2019682675600052,-0.028201768174767494,0.08898906409740448,0.17976179718971252,-0.22928372025489807,0.3000858724117279,0.08501409739255905
Lightvalve 61:bc8c8270f0ab 302 ,-0.09888127446174622,-0.22750279307365417,-0.22503364086151123,-0.0014225258491933346,-0.012498408555984497,-0.24329537153244019,-0.09442851692438126,0.08175003528594971,-0.016126900911331177,0.06972584128379822,0.05360379442572594,0.22432491183280945,-0.031845152378082275,-0.2877633273601532,0.18349257111549377,0.19327174127101898,-0.09216172993183136,0.04617339372634888,-0.09483018517494202,-0.07904840260744095,-0.035641368478536606,-0.2887636721134186,-0.06047184765338898,-0.3070217967033386,4.397468364913948e-05,-0.19100867211818695,0.28239238262176514,-0.2758784890174866,-0.16326025128364563,0.11664235591888428,-0.03823475539684296,0.11660117655992508;
Lightvalve 61:bc8c8270f0ab 303
Lightvalve 61:bc8c8270f0ab 304
Lightvalve 61:bc8c8270f0ab 305 h3 <<
Lightvalve 61:bc8c8270f0ab 306 -0.2551194727420807,-0.09101890027523041,-0.026477575302124023,-0.24469062685966492,-0.10447631776332855,-1.3142824172973633e-05,0.23563924431800842,0.21467849612236023,-0.17011712491512299,0.034586966037750244,-0.08393588662147522,0.28293344378471375,0.045914679765701294,0.1892293095588684,-0.2476848065853119,0.13452908396720886,0.033751994371414185,0.2061004936695099,-0.022569477558135986,-0.10083381831645966,-0.11890523135662079,0.024368882179260254,-0.22618433833122253,0.044178664684295654,0.25393906235694885,-0.1258748173713684,0.2930828630924225,-0.22120264172554016,0.08456003665924072,0.2922307550907135,-0.21407078206539154,-0.1853330433368683
Lightvalve 61:bc8c8270f0ab 307 ,0.05588451027870178,0.19731858372688293,-0.055143773555755615,0.030042022466659546,-0.13887283205986023,-0.1361943781375885,-0.2855546772480011,0.011247634887695312,0.1085631251335144,0.021339505910873413,0.17599248886108398,0.09762296080589294,-0.05771490931510925,-0.14660483598709106,-0.21469902992248535,0.03876742720603943,-0.21865856647491455,-0.12651903927326202,0.22753819823265076,-0.23926785588264465,-0.14443452656269073,0.06739777326583862,0.14157342910766602,0.049514561891555786,-0.1251431256532669,-0.25851932168006897,0.0932874083518982,0.2900666892528534,-0.023782014846801758,0.050485759973526,0.09447437524795532,0.0058679282665252686
Lightvalve 61:bc8c8270f0ab 308 ,-0.2800689935684204,-0.038760632276535034,0.13974270224571228,0.01585569977760315,0.11945047974586487,-0.19458696246147156,0.11322265863418579,0.25643888115882874,-0.061097174882888794,-0.07816044986248016,-0.07445238530635834,-0.22145158052444458,-0.1081896424293518,-0.09452249109745026,0.16234496235847473,0.1413259506225586,-0.2648085951805115,-0.054869145154953,-0.05491623282432556,0.17325228452682495,0.23639705777168274,0.0748760998249054,-0.1324603259563446,0.15828460454940796,-0.22871175408363342,-0.027338534593582153,-0.06307074427604675,0.13438841700553894,0.13834497332572937,0.1633671224117279,0.259930282831192,-0.21565306186676025
Lightvalve 61:bc8c8270f0ab 309 ,0.2906629145145416,0.20458483695983887,-0.2048129439353943,0.18967533111572266,0.031110908836126328,0.012224288657307625,-0.061309605836868286,-0.17915479838848114,-0.07229355722665787,-0.044261813163757324,-0.09506386518478394,0.24970653653144836,0.084104023873806,0.14075174927711487,0.22106656432151794,-0.23978039622306824,-0.28915077447891235,0.030949801206588745,-0.324018657207489,0.14200536906719208,0.16460198163986206,0.03645682334899902,-0.16484108567237854,-0.2748301029205322,0.2685009241104126,-0.11024686694145203,-0.14180462062358856,-0.06628534197807312,-0.12027380615472794,-0.25852420926094055,0.05653107166290283,0.0037463903427124023
Lightvalve 61:bc8c8270f0ab 310 ,0.07563930749893188,-0.0864691436290741,-0.2677825689315796,0.10359114408493042,-0.08386197686195374,-0.01570148952305317,-0.09772239625453949,0.2470131814479828,-0.11951703578233719,-0.2740214169025421,0.2979947626590729,-0.24627932906150818,-0.33795294165611267,-0.04848279431462288,0.06802645325660706,-0.048776447772979736,0.20131775736808777,0.013118326663970947,-0.025344420224428177,0.16618464887142181,-0.14039944112300873,0.3214682638645172,0.14059734344482422,0.20571765303611755,-0.09259504824876785,0.12758469581604004,0.2975369393825531,-0.2769588828086853,0.27723395824432373,-0.09959287941455841,-0.07189898192882538,0.007399916648864746
Lightvalve 61:bc8c8270f0ab 311 ,0.10931676626205444,0.2396949827671051,0.12925085425376892,-0.01787710189819336,-0.10811276733875275,0.07592436671257019,-0.061815500259399414,0.04091137647628784,0.02548360824584961,-0.15699732303619385,0.08972057700157166,-0.21529507637023926,-0.003787398338317871,-0.1505761295557022,0.2971965968608856,0.25175121426582336,-0.2889891266822815,-0.13035915791988373,0.16576141119003296,0.06524023413658142,0.09726372361183167,-0.25527554750442505,0.023232191801071167,0.27409639954566956,-0.14640875160694122,-0.18302330374717712,0.09057381749153137,0.02826198935508728,-0.27729424834251404,-0.29547566175460815,-0.25800079107284546,0.24402263760566711
Lightvalve 61:bc8c8270f0ab 312 ,-0.21155381202697754,0.22487755119800568,-0.13003289699554443,0.02903335727751255,0.0982653871178627,0.1536569446325302,-0.07957221567630768,0.2444917857646942,0.05783398076891899,-0.28369563817977905,-0.03127405047416687,-0.25618287920951843,0.04224606975913048,-0.11560255289077759,0.25543639063835144,-0.1192857176065445,-0.18917083740234375,0.011466026306152344,0.09430564939975739,0.15590092539787292,0.18224665522575378,-0.09396838396787643,-0.2636158764362335,-0.27819615602493286,-0.2612522840499878,-0.2910519242286682,-0.2693059742450714,-0.2712043225765228,0.22474904358386993,-0.09532724320888519,0.3048698306083679,0.15567372739315033
Lightvalve 61:bc8c8270f0ab 313 ,-0.01093912124633789,-0.23583689332008362,0.28153905272483826,0.2877257764339447,0.08201509714126587,-0.2514142394065857,0.036741942167282104,-0.0059101879596710205,-0.26075154542922974,-0.27182313799858093,0.09319102764129639,-0.08139897882938385,0.1846132129430771,-0.007431956008076668,0.0685860812664032,-0.29903873801231384,0.1317853033542633,0.20550194382667542,-0.12478919327259064,-0.28424710035324097,0.23210765421390533,0.13067273795604706,0.0343703031539917,0.12564969062805176,0.04770389571785927,0.23886635899543762,-0.2778390347957611,0.13853725790977478,0.3018551468849182,0.17161712050437927,-0.017215043306350708,-0.05991865694522858
Lightvalve 61:bc8c8270f0ab 314 ,-0.20420776307582855,0.1970202624797821,0.23591408133506775,-0.282694011926651,0.09019026160240173,0.20012763142585754,0.028453975915908813,0.23323127627372742,0.15246456861495972,-0.1270071268081665,0.20025727152824402,0.13077861070632935,-0.2238168716430664,-0.20709244906902313,-0.0045506954193115234,-0.16448761522769928,0.28163614869117737,0.1971360743045807,0.30405697226524353,-0.28959211707115173,-0.2255709171295166,0.15360668301582336,0.24163606762886047,0.19554737210273743,-0.1804599016904831,0.07604315876960754,-0.1459394246339798,-0.14081311225891113,-0.29656586050987244,0.19529584050178528,-0.05168652534484863,-0.03415781259536743
Lightvalve 61:bc8c8270f0ab 315 ,0.27550336718559265,-0.14170598983764648,-0.21542268991470337,-0.2159879207611084,0.06500789523124695,-0.21155211329460144,-0.01575431227684021,0.0617731511592865,0.13126209378242493,-0.04922589659690857,-0.23877641558647156,-0.06292802095413208,0.01433342695236206,0.14592674374580383,-0.23886999487876892,0.08878573775291443,0.1853090226650238,-0.05102238059043884,-0.13667166233062744,-0.24401302635669708,0.25155118107795715,-0.20339438319206238,0.03535670042037964,0.048473477363586426,-0.13871997594833374,-0.15382859110832214,-0.13837768137454987,0.26085415482521057,0.2491457164287567,0.157204270362854,0.14108964800834656,0.12518465518951416
Lightvalve 61:bc8c8270f0ab 316 ,-0.023678362369537354,0.21583256125450134,-0.0008795078611001372,0.1337454915046692,0.1972961574792862,0.06894860416650772,0.0393199622631073,0.196751207113266,0.021013112738728523,0.2390732765197754,0.17463752627372742,-0.06168833374977112,-0.15600533783435822,-0.13375309109687805,0.080221027135849,-0.2471318244934082,0.026521950960159302,0.28880444169044495,0.18180696666240692,-0.14862056076526642,0.010060903616249561,0.008893917314708233,0.054391685873270035,0.27783286571502686,0.1417618691921234,-0.25962090492248535,0.04291031137108803,0.16766448318958282,0.22548967599868774,-0.2912617325782776,-0.24803094565868378,-0.16964496672153473
Lightvalve 61:bc8c8270f0ab 317 ,0.2680447995662689,0.04988827928900719,-0.2604551613330841,-0.06360144913196564,-0.07355550676584244,0.1419062316417694,0.1912839114665985,-0.17794576287269592,0.21344752609729767,-0.32452166080474854,-0.2607074975967407,0.2547462284564972,0.2808741331100464,0.08698759973049164,0.23152390122413635,-0.07731422781944275,0.21101722121238708,-0.15284278988838196,0.23690250515937805,0.11099313944578171,0.045659054070711136,0.25897544622421265,-0.2734209895133972,0.09973400086164474,-0.2234855592250824,0.18312275409698486,-0.20327457785606384,0.24314641952514648,0.2581717371940613,-0.1739533692598343,-0.27099403738975525,-0.27753785252571106
Lightvalve 61:bc8c8270f0ab 318 ,0.10771462321281433,0.1270637810230255,-0.029593871906399727,0.048757344484329224,0.14432331919670105,0.150037944316864,-0.2502448558807373,-0.05063694715499878,-0.24201413989067078,-0.11501708626747131,0.24353471398353577,0.11519002914428711,-0.20123691856861115,0.04388739541172981,-0.0055807530879974365,0.05870962142944336,-0.0561012327671051,-0.1419317126274109,-0.22982393205165863,-0.012807505205273628,-0.18990859389305115,-0.2882382273674011,0.26737427711486816,-0.18213631212711334,-0.17948952317237854,-0.03866580128669739,0.050366636365652084,0.23561419546604156,0.10195441544055939,0.024399906396865845,-0.264041006565094,0.067328080534935
Lightvalve 61:bc8c8270f0ab 319 ,0.07240793108940125,0.013581753708422184,0.2886071503162384,0.33517664670944214,0.06038776785135269,0.1265794038772583,0.23807910084724426,-0.09019742906093597,0.13383500277996063,-0.2274075150489807,0.13386529684066772,0.030263751745224,-0.15911448001861572,0.10485177487134933,0.13272255659103394,-0.0684008002281189,-0.13351139426231384,0.2471931278705597,0.10377484560012817,0.2869516909122467,0.07341593503952026,0.11802513897418976,-0.07614786922931671,0.3203943371772766,0.15393073856830597,-0.1976800560951233,-0.19668111205101013,0.26847177743911743,-0.2050236016511917,-0.29330405592918396,0.040703099220991135,0.06578359752893448
Lightvalve 61:bc8c8270f0ab 320 ,-0.27890223264694214,0.028393682092428207,0.27142634987831116,0.2020181119441986,-0.017035065218806267,-0.24077828228473663,-0.2505151033401489,-0.2674597501754761,-0.2380676418542862,0.08589410781860352,0.020896315574645996,0.04456409811973572,0.08395307511091232,-0.02637488767504692,-0.02410009503364563,0.10129088163375854,0.22686699032783508,-0.30486053228378296,0.07207807153463364,0.168308824300766,0.11956266313791275,-0.21200691163539886,-0.1238783523440361,0.1856202334165573,-0.1537778228521347,-0.025903940200805664,-0.07543710619211197,0.2098950445652008,0.25567781925201416,0.06508117914199829,0.02118399739265442,0.14526255428791046
Lightvalve 61:bc8c8270f0ab 321 ,0.3047083914279938,0.11099091172218323,-0.11378012597560883,-0.22131715714931488,0.17421483993530273,0.15522044897079468,-0.09724730253219604,-0.25786101818084717,-0.24032863974571228,0.12881293892860413,-0.2581462860107422,0.038040339946746826,0.16599057614803314,-0.03181708604097366,0.062144935131073,-0.28920799493789673,0.03473195433616638,-0.0016761720180511475,0.1232852041721344,-0.33812928199768066,0.17322932183742523,0.21282772719860077,0.23908089101314545,-0.2546650171279907,-0.11406802386045456,-0.031148135662078857,-0.15092508494853973,-0.08215931057929993,0.10083970427513123,0.017086774110794067,-0.15847967565059662,-0.43811115622520447
Lightvalve 61:bc8c8270f0ab 322 ,-0.06136500835418701,-0.11579577624797821,-0.23311558365821838,-0.020844489336013794,0.161813884973526,0.25480687618255615,0.11958792805671692,-0.0384809672832489,-0.10647237300872803,-0.09010881185531616,0.22322741150856018,-0.1071339100599289,0.028004037216305733,-0.20909930765628815,0.040097206830978394,0.08616101741790771,-0.15468145906925201,-0.21275553107261658,-0.23739154636859894,-0.23840199410915375,0.09806761145591736,0.30803728103637695,0.14114680886268616,0.09007054567337036,-0.03398526832461357,0.12031787633895874,-0.184563547372818,0.0523558147251606,-0.1914299577474594,-0.24735762178897858,-0.0892629474401474,-0.11765947937965393
Lightvalve 61:bc8c8270f0ab 323 ,0.1169951856136322,0.06741076707839966,0.014288008213043213,-0.1894388198852539,0.2306886613368988,0.08970087766647339,0.29362860321998596,0.2666439712047577,-0.1488228738307953,0.22382596135139465,-0.1313140094280243,0.02602824568748474,0.029441386461257935,-0.1546926349401474,0.10762849450111389,0.06951633095741272,0.0639207661151886,0.27696695923805237,-0.2749756872653961,0.2684275209903717,-0.240950807929039,-0.08405844867229462,0.26762983202934265,0.09600964188575745,-0.20394444465637207,0.012219250202178955,-0.09225042164325714,-0.12637756764888763,-0.21354423463344574,-0.29393887519836426,-0.056166648864746094,0.002250969409942627
Lightvalve 61:bc8c8270f0ab 324 ,-0.16101892292499542,0.0358797162771225,0.43079784512519836,0.2605867087841034,0.033972837030887604,-0.26316049695014954,0.1589156985282898,-0.17396175861358643,0.29257088899612427,-0.14439350366592407,0.1600557565689087,-0.04377517104148865,-0.11310844868421555,-0.056318942457437515,-0.2592318058013916,0.1978430449962616,0.18047624826431274,0.2863751947879791,-0.16123604774475098,-0.009939590469002724,-0.08062873780727386,0.0892474502325058,0.2678377628326416,0.4043545126914978,-0.11606839299201965,-0.28873488306999207,0.048900723457336426,0.2837308943271637,0.11584324389696121,0.18439257144927979,0.17250561714172363,0.39480021595954895
Lightvalve 61:bc8c8270f0ab 325 ,0.261911004781723,-0.2764647305011749,-0.4822510778903961,-0.0038792183622717857,0.06886842846870422,0.09860533475875854,-0.06670857965946198,-0.030254334211349487,-0.2904336750507355,0.1197996437549591,0.01667046546936035,-0.2924177646636963,0.1934618502855301,-0.08827721327543259,-0.20773646235466003,-0.10781967639923096,-0.15712574124336243,0.16112294793128967,0.15956245362758636,0.168865367770195,0.14229415357112885,0.1682685911655426,-0.3314894437789917,-0.04511234164237976,0.19475895166397095,0.0025720298290252686,-0.02036861702799797,-0.24640622735023499,0.16197645664215088,0.21125611662864685,-0.05115009471774101,-0.5753244161605835
Lightvalve 61:bc8c8270f0ab 326 ,0.14277681708335876,-0.17837506532669067,-0.023754309862852097,-0.19470283389091492,-0.12246686965227127,0.055870335549116135,0.1624150574207306,-0.27022814750671387,-0.09540649503469467,-0.29762372374534607,-0.2852642238140106,0.18551066517829895,0.24858085811138153,0.14418518543243408,-0.03100520372390747,-0.2484396994113922,0.06366744637489319,-0.2764144539833069,0.12580512464046478,0.1863812357187271,-0.3750770390033722,0.30558088421821594,0.22592295706272125,-0.2764151692390442,-0.08330509811639786,-0.19159743189811707,0.25842007994651794,-0.3267556130886078,-0.15882858633995056,-0.10488687455654144,-0.20926116406917572,-0.11732711642980576
Lightvalve 61:bc8c8270f0ab 327 ,0.29069945216178894,-0.22613553702831268,0.019009560346603394,-0.28878214955329895,0.13782989978790283,-0.20606419444084167,0.045349299907684326,-0.17138783633708954,-0.13634654879570007,0.028545528650283813,-0.16238126158714294,-0.15074089169502258,-0.10786417126655579,-0.25459790229797363,0.09875330328941345,0.08164769411087036,0.2294725477695465,0.10683679580688477,-0.2498348206281662,-0.09913146495819092,0.18476957082748413,0.2576355040073395,0.16651621460914612,-0.16394875943660736,0.2908710241317749,0.023651927709579468,-0.1729920208454132,0.2343282699584961,0.114747054874897,0.19045329093933105,0.02994692325592041,-0.18855193257331848
Lightvalve 61:bc8c8270f0ab 328 ,0.1991647183895111,0.12534403800964355,-0.04112154245376587,0.23123982548713684,-0.17588619887828827,-0.302817702293396,-0.1610087752342224,-0.031804412603378296,0.10274738073348999,-0.25018924474716187,0.15975651144981384,-0.057292819023132324,0.1464652419090271,0.08016204833984375,0.2151305377483368,0.2952744662761688,-0.21319252252578735,0.04970458149909973,0.10210192203521729,0.3050673305988312,0.21167120337486267,-0.15151944756507874,0.13887640833854675,0.25299301743507385,-0.11117732524871826,-0.07015113532543182,-0.287551611661911,-0.025779157876968384,-0.07337476313114166,-0.24420931935310364,0.015819430351257324,-0.10595546662807465
Lightvalve 61:bc8c8270f0ab 329 ,0.12202468514442444,0.0985947847366333,-0.2749728858470917,-0.27987486124038696,0.13006313145160675,0.17691220343112946,-0.06113804876804352,-0.11568751931190491,0.24261273443698883,-0.33250051736831665,-0.06917986273765564,-0.11160935461521149,-0.17044304311275482,-0.09174656867980957,-0.06735922396183014,0.05864924192428589,-0.25733181834220886,-0.17565661668777466,-0.07543282955884933,-0.18338191509246826,-0.36578381061553955,0.2753944993019104,0.14209599792957306,-0.1868741661310196,0.3329981863498688,0.1795230209827423,0.22248393297195435,-0.06621203571557999,-0.07096906751394272,0.2425754964351654,-0.21537242829799652,-0.2323274463415146
Lightvalve 61:bc8c8270f0ab 330 ,-0.3055141270160675,-0.25945645570755005,-0.03330126777291298,-0.08714571595191956,-0.23958928883075714,-0.035590264946222305,0.09419310092926025,0.21086838841438293,0.1225021556019783,0.05183860659599304,-0.25001513957977295,-0.004238337278366089,0.11344874650239944,0.11694838851690292,-0.023131370544433594,0.036719828844070435,0.16260939836502075,0.05286213755607605,-0.28451016545295715,-0.09079128503799438,0.11287535727024078,-0.041498955339193344,0.10957061499357224,0.02120070531964302,0.15043161809444427,-0.02825927734375,-0.11904071271419525,-0.2225356101989746,0.04479367658495903,0.1865309774875641,0.25861886143684387,-0.4281558096408844
Lightvalve 61:bc8c8270f0ab 331 ,0.1782623827457428,0.07742311805486679,-0.19943349063396454,0.009202931076288223,0.20097565650939941,0.2655416429042816,-0.2435605823993683,0.1475539207458496,0.26848459243774414,0.07351516932249069,-0.27482104301452637,-0.22968843579292297,-0.0032657950650900602,0.09409500658512115,-0.2527656555175781,-0.3049176335334778,0.032145023345947266,-0.25376296043395996,-0.024714192375540733,-0.1558963507413864,0.03983606398105621,0.1586221307516098,0.09342251718044281,0.06909164786338806,-0.18494604527950287,0.10029953718185425,0.17456218600273132,0.2811775207519531,-0.27735406160354614,0.1616479754447937,-0.17598764598369598,0.048629067838191986
Lightvalve 61:bc8c8270f0ab 332 ,-0.17396044731140137,-0.14763697981834412,-0.05150431767106056,0.11563663184642792,0.0912056639790535,-0.1369282454252243,-0.13985206186771393,-0.1761629432439804,-0.27742800116539,-0.27648791670799255,0.26132693886756897,-0.1146831065416336,0.278407484292984,0.29760831594467163,-0.19851773977279663,-0.10762731730937958,0.14198419451713562,0.10370296239852905,0.052602145820856094,-0.16641484200954437,-0.09225992113351822,-0.04645194485783577,0.15044128894805908,-0.21732264757156372,0.28437143564224243,-0.2665709853172302,0.2882380783557892,0.22249183058738708,-0.052759040147066116,-0.1200934648513794,-0.03501330688595772,-0.097571462392807
Lightvalve 61:bc8c8270f0ab 333 ,-0.12546227872371674,-0.15951892733573914,-0.0388270765542984,0.18754015862941742,-0.16775591671466827,-0.24655738472938538,-0.28310835361480713,-0.020981580018997192,0.009854764677584171,-0.17701463401317596,-0.19499319791793823,0.046816736459732056,-0.03591006621718407,-0.0839812159538269,-0.0649729073047638,0.2468220293521881,0.060016900300979614,-0.16779978573322296,0.026406895369291306,0.0926237553358078,-0.1881830245256424,0.11423873901367188,-0.300096333026886,0.2325722873210907,-0.05620579421520233,0.020356476306915283,-0.21710273623466492,0.23115618526935577,0.2465677708387375,-7.510185241699219e-06,0.10082539170980453,-0.022696541622281075
Lightvalve 61:bc8c8270f0ab 334 ,0.07555973529815674,-0.0029259920120239258,-0.08789914846420288,0.06678077578544617,-0.11083845794200897,0.11010000109672546,-0.14982634782791138,0.12075316905975342,-0.2766430675983429,0.013024389743804932,0.18159812688827515,-0.20200279355049133,0.2637675702571869,-0.1856893002986908,0.2882818281650543,0.05304515361785889,-0.15297894179821014,0.07341468334197998,0.05268138647079468,0.1067940890789032,-0.2661813795566559,-0.2009473443031311,0.1843600869178772,0.2517976462841034,-0.07343396544456482,-0.051110416650772095,-0.23432010412216187,0.16746872663497925,-0.2205146849155426,-0.017525076866149902,0.20926335453987122,-0.2141496241092682
Lightvalve 61:bc8c8270f0ab 335 ,0.06582912802696228,0.2796666920185089,-0.2556927502155304,0.0023079216480255127,0.2043982446193695,0.13894453644752502,0.06556430459022522,0.29767414927482605,0.24966773390769958,-0.16670267283916473,-0.1203770637512207,-0.06570860743522644,-0.015925198793411255,0.17675906419754028,-0.014884740114212036,-0.05300724506378174,0.26490333676338196,0.15243005752563477,-0.07319167256355286,0.2353842556476593,0.23596063256263733,0.1602974534034729,-0.04174882173538208,-0.11559568345546722,-0.06235519051551819,0.21069613099098206,-0.19532959163188934,-0.2486409693956375,0.032513976097106934,-0.2712400257587433,-0.19435247778892517,-0.23200613260269165
Lightvalve 61:bc8c8270f0ab 336 ,-0.1299392580986023,-0.06208275258541107,-0.21278081834316254,0.04117914289236069,-0.25799769163131714,0.0023174630478024483,-0.19175797700881958,0.02903696894645691,-0.3028421998023987,0.016345679759979248,-0.24767392873764038,0.2033931314945221,-0.36241284012794495,0.1515057384967804,0.13206014037132263,0.15829482674598694,-0.21012049913406372,0.2088232934474945,-0.016727611422538757,-0.24573293328285217,0.20467910170555115,0.11925628036260605,-0.3039346933364868,-0.11097411066293716,0.34144315123558044,-0.007939159870147705,-0.20167969167232513,0.059701401740312576,0.20017050206661224,0.18135693669319153,-0.008151531219482422,0.029283329844474792
Lightvalve 61:bc8c8270f0ab 337 ,0.07638216018676758,0.07996532320976257,-0.30373215675354004,-0.2700393795967102,0.11718190461397171,0.05212600901722908,0.2795381247997284,-0.25668495893478394,-0.100021593272686,0.1293344497680664,-0.026776641607284546,0.02524423599243164,0.07603725790977478,0.29519766569137573,-0.029521822929382324,-0.19500072300434113,0.06506577134132385,-0.011876672506332397,0.0938519686460495,0.2426283210515976,0.10203439742326736,0.03793451562523842,-0.15799765288829803,-0.17324526607990265,0.25468015670776367,0.1901901364326477,-0.22690120339393616,-0.09443645179271698,-0.0595262236893177,0.22636333107948303,-0.2613427937030792,0.21909776329994202;
Lightvalve 61:bc8c8270f0ab 338
Lightvalve 61:bc8c8270f0ab 339
Lightvalve 61:bc8c8270f0ab 340 hout <<
Lightvalve 61:bc8c8270f0ab 341 0.3285340666770935
Lightvalve 61:bc8c8270f0ab 342 ,0.2858171761035919
Lightvalve 61:bc8c8270f0ab 343 ,-0.36366742849349976
Lightvalve 61:bc8c8270f0ab 344 ,-0.2632009983062744
Lightvalve 61:bc8c8270f0ab 345 ,-0.25631460547447205
Lightvalve 61:bc8c8270f0ab 346 ,0.33468252420425415
Lightvalve 61:bc8c8270f0ab 347 ,0.002162247896194458
Lightvalve 61:bc8c8270f0ab 348 ,0.1081397533416748
Lightvalve 61:bc8c8270f0ab 349 ,-0.19566167891025543
Lightvalve 61:bc8c8270f0ab 350 ,-0.007266071625053883
Lightvalve 61:bc8c8270f0ab 351 ,0.1744336485862732
Lightvalve 61:bc8c8270f0ab 352 ,-0.19491273164749146
Lightvalve 61:bc8c8270f0ab 353 ,-0.16939763724803925
Lightvalve 61:bc8c8270f0ab 354 ,0.1573415994644165
Lightvalve 61:bc8c8270f0ab 355 ,0.2356991171836853
Lightvalve 61:bc8c8270f0ab 356 ,-0.1462659239768982
Lightvalve 61:bc8c8270f0ab 357 ,0.09851181507110596
Lightvalve 61:bc8c8270f0ab 358 ,-0.21499931812286377
Lightvalve 61:bc8c8270f0ab 359 ,-0.013007339090108871
Lightvalve 61:bc8c8270f0ab 360 ,-0.26934152841567993
Lightvalve 61:bc8c8270f0ab 361 ,-0.10125408321619034
Lightvalve 61:bc8c8270f0ab 362 ,0.16949352622032166
Lightvalve 61:bc8c8270f0ab 363 ,-0.2570975124835968
Lightvalve 61:bc8c8270f0ab 364 ,-0.21437735855579376
Lightvalve 61:bc8c8270f0ab 365 ,0.2278641164302826
Lightvalve 61:bc8c8270f0ab 366 ,0.2520971894264221
Lightvalve 61:bc8c8270f0ab 367 ,-0.38587644696235657
Lightvalve 61:bc8c8270f0ab 368 ,-0.3990364372730255
Lightvalve 61:bc8c8270f0ab 369 ,0.24998146295547485
Lightvalve 61:bc8c8270f0ab 370 ,-0.3257754445075989
Lightvalve 61:bc8c8270f0ab 371 ,-0.41329723596572876
Lightvalve 61:bc8c8270f0ab 372 ,-0.26551106572151184;
Lightvalve 61:bc8c8270f0ab 373
Lightvalve 61:bc8c8270f0ab 374 b1 <<
Lightvalve 61:bc8c8270f0ab 375 0.6920363306999207
Lightvalve 61:bc8c8270f0ab 376 ,0.9509658217430115
Lightvalve 61:bc8c8270f0ab 377 ,-1.7145336866378784
Lightvalve 61:bc8c8270f0ab 378 ,0.4119643270969391
Lightvalve 61:bc8c8270f0ab 379 ,1.0741286277770996
Lightvalve 61:bc8c8270f0ab 380 ,0.8546265363693237
Lightvalve 61:bc8c8270f0ab 381 ,-0.07467586547136307
Lightvalve 61:bc8c8270f0ab 382 ,0.93145751953125
Lightvalve 61:bc8c8270f0ab 383 ,0.5193935036659241
Lightvalve 61:bc8c8270f0ab 384 ,-0.8871728777885437
Lightvalve 61:bc8c8270f0ab 385 ,0.593039333820343
Lightvalve 61:bc8c8270f0ab 386 ,1.6031073331832886
Lightvalve 61:bc8c8270f0ab 387 ,-0.33494266867637634
Lightvalve 61:bc8c8270f0ab 388 ,-0.8010779023170471
Lightvalve 61:bc8c8270f0ab 389 ,-1.087764859199524
Lightvalve 61:bc8c8270f0ab 390 ,1.1554406881332397
Lightvalve 61:bc8c8270f0ab 391 ,0.6632958650588989
Lightvalve 61:bc8c8270f0ab 392 ,-0.224932461977005
Lightvalve 61:bc8c8270f0ab 393 ,0.26702749729156494
Lightvalve 61:bc8c8270f0ab 394 ,0.5859951972961426
Lightvalve 61:bc8c8270f0ab 395 ,-0.31409698724746704
Lightvalve 61:bc8c8270f0ab 396 ,-1.1118980646133423
Lightvalve 61:bc8c8270f0ab 397 ,-1.6770726442337036
Lightvalve 61:bc8c8270f0ab 398 ,-1.2263047695159912
Lightvalve 61:bc8c8270f0ab 399 ,2.018333911895752
Lightvalve 61:bc8c8270f0ab 400 ,-2.0880801677703857
Lightvalve 61:bc8c8270f0ab 401 ,-1.0489267110824585
Lightvalve 61:bc8c8270f0ab 402 ,0.7445360422134399
Lightvalve 61:bc8c8270f0ab 403 ,0.4031659960746765
Lightvalve 61:bc8c8270f0ab 404 ,-1.0887231826782227
Lightvalve 61:bc8c8270f0ab 405 ,1.5438745021820068
Lightvalve 61:bc8c8270f0ab 406 ,-0.4563482999801636;
Lightvalve 61:bc8c8270f0ab 407
Lightvalve 61:bc8c8270f0ab 408 b2 <<
Lightvalve 61:bc8c8270f0ab 409 -0.10466054826974869
Lightvalve 61:bc8c8270f0ab 410 ,-0.7642630338668823
Lightvalve 61:bc8c8270f0ab 411 ,-1.4564176797866821
Lightvalve 61:bc8c8270f0ab 412 ,-0.528777003288269
Lightvalve 61:bc8c8270f0ab 413 ,-0.7297643423080444
Lightvalve 61:bc8c8270f0ab 414 ,0.2625555098056793
Lightvalve 61:bc8c8270f0ab 415 ,0.389851450920105
Lightvalve 61:bc8c8270f0ab 416 ,-0.33048292994499207
Lightvalve 61:bc8c8270f0ab 417 ,-1.20063054561615
Lightvalve 61:bc8c8270f0ab 418 ,-1.912178635597229
Lightvalve 61:bc8c8270f0ab 419 ,0.31253743171691895
Lightvalve 61:bc8c8270f0ab 420 ,0.6883504390716553
Lightvalve 61:bc8c8270f0ab 421 ,-0.04988760128617287
Lightvalve 61:bc8c8270f0ab 422 ,2.26581072807312
Lightvalve 61:bc8c8270f0ab 423 ,0.13501279056072235
Lightvalve 61:bc8c8270f0ab 424 ,1.132785677909851
Lightvalve 61:bc8c8270f0ab 425 ,-1.8237234354019165
Lightvalve 61:bc8c8270f0ab 426 ,-1.5844906568527222
Lightvalve 61:bc8c8270f0ab 427 ,0.26375624537467957
Lightvalve 61:bc8c8270f0ab 428 ,-0.23789723217487335
Lightvalve 61:bc8c8270f0ab 429 ,0.17283980548381805
Lightvalve 61:bc8c8270f0ab 430 ,0.3692796230316162
Lightvalve 61:bc8c8270f0ab 431 ,0.09335066378116608
Lightvalve 61:bc8c8270f0ab 432 ,-1.0231001377105713
Lightvalve 61:bc8c8270f0ab 433 ,1.2738454341888428
Lightvalve 61:bc8c8270f0ab 434 ,1.44853675365448
Lightvalve 61:bc8c8270f0ab 435 ,0.9071134924888611
Lightvalve 61:bc8c8270f0ab 436 ,8.9274239144288e-05
Lightvalve 61:bc8c8270f0ab 437 ,-0.6323830485343933
Lightvalve 61:bc8c8270f0ab 438 ,-0.4208582937717438
Lightvalve 61:bc8c8270f0ab 439 ,-1.1864360570907593
Lightvalve 61:bc8c8270f0ab 440 ,-1.3916414976119995;
Lightvalve 61:bc8c8270f0ab 441
Lightvalve 61:bc8c8270f0ab 442 b3 <<
Lightvalve 61:bc8c8270f0ab 443 -1.963319182395935
Lightvalve 61:bc8c8270f0ab 444 ,-0.4028509557247162
Lightvalve 61:bc8c8270f0ab 445 ,0.3184174597263336
Lightvalve 61:bc8c8270f0ab 446 ,0.1579766422510147
Lightvalve 61:bc8c8270f0ab 447 ,0.1897633820772171
Lightvalve 61:bc8c8270f0ab 448 ,0.866980791091919
Lightvalve 61:bc8c8270f0ab 449 ,-0.45353031158447266
Lightvalve 61:bc8c8270f0ab 450 ,-0.6562485098838806
Lightvalve 61:bc8c8270f0ab 451 ,0.5865635275840759
Lightvalve 61:bc8c8270f0ab 452 ,0.5033581852912903
Lightvalve 61:bc8c8270f0ab 453 ,-0.14371006190776825
Lightvalve 61:bc8c8270f0ab 454 ,0.050810977816581726
Lightvalve 61:bc8c8270f0ab 455 ,-0.5131177306175232
Lightvalve 61:bc8c8270f0ab 456 ,0.5688209533691406
Lightvalve 61:bc8c8270f0ab 457 ,-1.1428403854370117
Lightvalve 61:bc8c8270f0ab 458 ,-0.3598397970199585
Lightvalve 61:bc8c8270f0ab 459 ,-1.3594286441802979
Lightvalve 61:bc8c8270f0ab 460 ,-1.0192245244979858
Lightvalve 61:bc8c8270f0ab 461 ,-0.2365882694721222
Lightvalve 61:bc8c8270f0ab 462 ,0.5294732451438904
Lightvalve 61:bc8c8270f0ab 463 ,1.530857801437378
Lightvalve 61:bc8c8270f0ab 464 ,1.2039998769760132
Lightvalve 61:bc8c8270f0ab 465 ,-1.0573883056640625
Lightvalve 61:bc8c8270f0ab 466 ,-0.7962622046470642
Lightvalve 61:bc8c8270f0ab 467 ,0.7248114347457886
Lightvalve 61:bc8c8270f0ab 468 ,-0.36519983410835266
Lightvalve 61:bc8c8270f0ab 469 ,-0.07752024382352829
Lightvalve 61:bc8c8270f0ab 470 ,0.767806887626648
Lightvalve 61:bc8c8270f0ab 471 ,0.2635451555252075
Lightvalve 61:bc8c8270f0ab 472 ,-2.3236680030822754
Lightvalve 61:bc8c8270f0ab 473 ,0.06150589883327484
Lightvalve 61:bc8c8270f0ab 474 ,1.0375205278396606;
Lightvalve 61:bc8c8270f0ab 475
Lightvalve 61:bc8c8270f0ab 476 bout <<
Lightvalve 61:bc8c8270f0ab 477 -0.3124803602695465;
Lightvalve 61:bc8c8270f0ab 478
jobuuu 6:df07d3491e3a 479 /************************************
jobuuu 1:e04e563be5ce 480 *** Program is operating!
jobuuu 6:df07d3491e3a 481 *************************************/
GiJeongKim 0:51c43836c1d7 482 while(1) {
Lightvalve 57:f4819de54e7a 483 if(timer_while==1000 && OPERATING_MODE==5) {
Lightvalve 17:1865016ca2e7 484 //i2c
Lightvalve 17:1865016ca2e7 485 read_field(i2c_slave_addr1);
Lightvalve 17:1865016ca2e7 486 if(DIR_VALVE_ENC < 0) value = 1023 - value;
Lightvalve 57:f4819de54e7a 487 // if(LED==1) {
Lightvalve 57:f4819de54e7a 488 // LED=0;
Lightvalve 57:f4819de54e7a 489 // } else
Lightvalve 57:f4819de54e7a 490 // LED = 1;
Lightvalve 17:1865016ca2e7 491 timer_while = 0;
Lightvalve 17:1865016ca2e7 492 }
Lightvalve 17:1865016ca2e7 493 timer_while ++;
Lightvalve 61:bc8c8270f0ab 494
Lightvalve 61:bc8c8270f0ab 495 t.reset();
Lightvalve 61:bc8c8270f0ab 496 t.start();
Lightvalve 61:bc8c8270f0ab 497
Lightvalve 62:b5452adfb2cd 498
Lightvalve 62:b5452adfb2cd 499
Lightvalve 62:b5452adfb2cd 500 Input <<
Lightvalve 62:b5452adfb2cd 501 input_array[0],input_array[1],input_array[2],input_array[3],input_array[4];
Lightvalve 62:b5452adfb2cd 502
Lightvalve 61:bc8c8270f0ab 503 X = Input*h1+b1.transpose();
Lightvalve 61:bc8c8270f0ab 504 for(int i=0; i<32; i++){
Lightvalve 61:bc8c8270f0ab 505 if(X(i)<0)
Lightvalve 61:bc8c8270f0ab 506 X(i) = 0;
Lightvalve 61:bc8c8270f0ab 507 }
Lightvalve 61:bc8c8270f0ab 508 X = X*h2+b2.transpose();
Lightvalve 61:bc8c8270f0ab 509 for(int i=0; i<32; i++){
Lightvalve 61:bc8c8270f0ab 510 if(X(i)<0)
Lightvalve 61:bc8c8270f0ab 511 X(i) = 0;
Lightvalve 61:bc8c8270f0ab 512 }
Lightvalve 61:bc8c8270f0ab 513 X = X*h3+b3.transpose();
Lightvalve 61:bc8c8270f0ab 514 for(int i=0; i<32; i++){
Lightvalve 61:bc8c8270f0ab 515 if(X(i)<0)
Lightvalve 61:bc8c8270f0ab 516 X(i) = 0;
Lightvalve 61:bc8c8270f0ab 517 }
Lightvalve 61:bc8c8270f0ab 518 X = X*hout+bout.transpose();
Lightvalve 61:bc8c8270f0ab 519 NNoutput=1.0f/(1.0f+exp(-X(0,0)));
Lightvalve 61:bc8c8270f0ab 520
Lightvalve 61:bc8c8270f0ab 521 t.stop();
Lightvalve 62:b5452adfb2cd 522 printf("NNoutput : %f\n", NNoutput);
Lightvalve 62:b5452adfb2cd 523 printf("time : %f\n", t.read());
Lightvalve 62:b5452adfb2cd 524 wait(1);
Lightvalve 61:bc8c8270f0ab 525
Lightvalve 61:bc8c8270f0ab 526
Lightvalve 62:b5452adfb2cd 527 PWM_out = NNoutput * 24000.0f - 12000.0f;
Lightvalve 62:b5452adfb2cd 528
Lightvalve 61:bc8c8270f0ab 529
Lightvalve 62:b5452adfb2cd 530 if (PWM_out>0.0f) {
Lightvalve 62:b5452adfb2cd 531 dtc_v=0.0f;
Lightvalve 62:b5452adfb2cd 532 dtc_w=PWM_out;
Lightvalve 62:b5452adfb2cd 533 } else {
Lightvalve 62:b5452adfb2cd 534 dtc_v=-PWM_out;
Lightvalve 62:b5452adfb2cd 535 dtc_w=0.0f;
Lightvalve 62:b5452adfb2cd 536 }
Lightvalve 62:b5452adfb2cd 537
Lightvalve 62:b5452adfb2cd 538 //pwm
Lightvalve 62:b5452adfb2cd 539 TIM4->CCR2 = (PWM_ARR)*(1.0f-dtc_v);
Lightvalve 62:b5452adfb2cd 540 TIM4->CCR1 = (PWM_ARR)*(1.0f-dtc_w);
Lightvalve 62:b5452adfb2cd 541
Lightvalve 62:b5452adfb2cd 542
Lightvalve 61:bc8c8270f0ab 543
GiJeongKim 0:51c43836c1d7 544 }
jobuuu 1:e04e563be5ce 545 }
jobuuu 1:e04e563be5ce 546
Lightvalve 33:91b17819ec30 547 float DDV_JOINT_POS_FF(float REF_JOINT_VEL)
Lightvalve 14:8e7590227d22 548 {
Lightvalve 14:8e7590227d22 549
Lightvalve 13:747daba9cf59 550 int i = 0;
Lightvalve 48:889798ff9329 551 float Ref_Valve_Pos_FF = 0.0f;
Lightvalve 14:8e7590227d22 552 for(i=0; i<VALVE_POS_NUM; i++) {
Lightvalve 14:8e7590227d22 553 if(REF_JOINT_VEL >= min(JOINT_VEL[i],JOINT_VEL[i+1]) && REF_JOINT_VEL <= max(JOINT_VEL[i],JOINT_VEL[i+1])) {
Lightvalve 14:8e7590227d22 554 if(i==0) {
Lightvalve 50:3c630b5eba9f 555 if(JOINT_VEL[i+1] == JOINT_VEL[i]) {
Lightvalve 57:f4819de54e7a 556 Ref_Valve_Pos_FF = (float) VALVE_CENTER;
Lightvalve 50:3c630b5eba9f 557 } else {
Lightvalve 57:f4819de54e7a 558 Ref_Valve_Pos_FF = ((float) 10/(JOINT_VEL[i+1] - JOINT_VEL[i]) * (REF_JOINT_VEL - JOINT_VEL[i])) + (float) VALVE_CENTER;
Lightvalve 38:118df027d851 559 }
Lightvalve 14:8e7590227d22 560 } else {
Lightvalve 50:3c630b5eba9f 561 if(JOINT_VEL[i+1] == JOINT_VEL[i-1]) {
Lightvalve 57:f4819de54e7a 562 Ref_Valve_Pos_FF = (float) VALVE_CENTER;
Lightvalve 50:3c630b5eba9f 563 } else {
Lightvalve 57:f4819de54e7a 564 Ref_Valve_Pos_FF = ((float) 10*(ID_index_array[i+1] - ID_index_array[i-1])/(JOINT_VEL[i+1] - JOINT_VEL[i-1]) * (REF_JOINT_VEL - JOINT_VEL[i-1])) + (float) VALVE_CENTER + (float) (10*ID_index_array[i-1]);
Lightvalve 38:118df027d851 565 }
Lightvalve 13:747daba9cf59 566 }
Lightvalve 13:747daba9cf59 567 break;
Lightvalve 13:747daba9cf59 568 }
Lightvalve 13:747daba9cf59 569 }
Lightvalve 14:8e7590227d22 570 if(REF_JOINT_VEL > max(JOINT_VEL[VALVE_POS_NUM-1], JOINT_VEL[VALVE_POS_NUM-2])) {
Lightvalve 33:91b17819ec30 571 Ref_Valve_Pos_FF = (float) VALVE_MAX_POS;
Lightvalve 14:8e7590227d22 572 } else if(REF_JOINT_VEL < min(JOINT_VEL[VALVE_POS_NUM-1], JOINT_VEL[VALVE_POS_NUM-2])) {
Lightvalve 33:91b17819ec30 573 Ref_Valve_Pos_FF = (float) VALVE_MIN_POS;
Lightvalve 13:747daba9cf59 574 }
Lightvalve 36:a46e63505ed8 575
Lightvalve 57:f4819de54e7a 576 Ref_Valve_Pos_FF = (float) VELOCITY_COMP_GAIN * 0.01f * (float) (Ref_Valve_Pos_FF - (float) VALVE_CENTER);
Lightvalve 13:747daba9cf59 577 return Ref_Valve_Pos_FF;
Lightvalve 50:3c630b5eba9f 578
Lightvalve 13:747daba9cf59 579 }
jobuuu 6:df07d3491e3a 580
jobuuu 6:df07d3491e3a 581
Lightvalve 30:8d561f16383b 582 void VALVE_POS_CONTROL(float REF_VALVE_POS)
Lightvalve 14:8e7590227d22 583 {
Lightvalve 13:747daba9cf59 584 int i = 0;
Lightvalve 13:747daba9cf59 585
Lightvalve 38:118df027d851 586 if(REF_VALVE_POS > VALVE_MAX_POS) {
Lightvalve 38:118df027d851 587 REF_VALVE_POS = VALVE_MAX_POS;
Lightvalve 38:118df027d851 588 } else if(REF_VALVE_POS < VALVE_MIN_POS) {
Lightvalve 38:118df027d851 589 REF_VALVE_POS = VALVE_MIN_POS;
Lightvalve 38:118df027d851 590 }
Lightvalve 38:118df027d851 591
Lightvalve 13:747daba9cf59 592 valve_pos_err = REF_VALVE_POS - value;
Lightvalve 13:747daba9cf59 593 valve_pos_err_diff = valve_pos_err - valve_pos_err_old;
Lightvalve 13:747daba9cf59 594 valve_pos_err_old = valve_pos_err;
Lightvalve 13:747daba9cf59 595 valve_pos_err_sum += valve_pos_err;
Lightvalve 13:747daba9cf59 596 if (valve_pos_err_sum > 1000) valve_pos_err_sum = 1000;
Lightvalve 13:747daba9cf59 597 if (valve_pos_err_sum<-1000) valve_pos_err_sum = -1000;
Lightvalve 13:747daba9cf59 598
Lightvalve 13:747daba9cf59 599 VALVE_PWM_RAW_FB = P_GAIN_VALVE_POSITION * valve_pos_err + I_GAIN_VALVE_POSITION * valve_pos_err_sum + D_GAIN_VALVE_POSITION * valve_pos_err_diff;
Lightvalve 14:8e7590227d22 600
Lightvalve 18:b8adf1582ea3 601 for(i=0; i<24; i++) {
Lightvalve 14:8e7590227d22 602 if(REF_VALVE_POS >= min(VALVE_POS_VS_PWM[i],VALVE_POS_VS_PWM[i+1]) && REF_VALVE_POS <= max(VALVE_POS_VS_PWM[i],VALVE_POS_VS_PWM[i+1])) {
Lightvalve 14:8e7590227d22 603 if(i==0) {
Lightvalve 48:889798ff9329 604 VALVE_PWM_RAW_FF = (float) 1000.0f / (float) (VALVE_POS_VS_PWM[i+1] - VALVE_POS_VS_PWM[i]) * ((float) REF_VALVE_POS - VALVE_POS_VS_PWM[i]);
Lightvalve 14:8e7590227d22 605 } else {
Lightvalve 48:889798ff9329 606 VALVE_PWM_RAW_FF = (float) 1000.0f* (float) (ID_index_array[i+1] - ID_index_array[i-1])/(VALVE_POS_VS_PWM[i+1] - VALVE_POS_VS_PWM[i-1]) * ((float) REF_VALVE_POS - VALVE_POS_VS_PWM[i-1]) + 1000.0f * (float) ID_index_array[i-1];
Lightvalve 13:747daba9cf59 607 }
Lightvalve 13:747daba9cf59 608 break;
Lightvalve 13:747daba9cf59 609 }
Lightvalve 13:747daba9cf59 610 }
Lightvalve 59:f308b1656d9c 611 Vout.ref = VALVE_PWM_RAW_FF + VALVE_PWM_RAW_FB;
Lightvalve 13:747daba9cf59 612 }
Lightvalve 13:747daba9cf59 613
Lightvalve 14:8e7590227d22 614 #define LT_MAX_IDX 57
Lightvalve 30:8d561f16383b 615 float LT_PWM_duty[LT_MAX_IDX] = {-100.0f, -80.0f, -60.0f, -50.0f, -40.0f, -35.0f, -30.0f, -25.0f, -20.0f,
Lightvalve 34:bb2ca2fc2a8e 616 -19.0f, -18.0f, -17.0f, -16.0f, -15.0f, -14.0f, -13.0f, -12.0f, -11.0f, -10.0f,
Lightvalve 34:bb2ca2fc2a8e 617 -9.0f, -8.0f, -7.0f, -6.0f, -5.0f, -4.0f, -3.0f, -2.0f, -1.0f, 0.0f,
Lightvalve 34:bb2ca2fc2a8e 618 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f,
Lightvalve 34:bb2ca2fc2a8e 619 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 20.0f,
Lightvalve 34:bb2ca2fc2a8e 620 25.0f, 30.0f, 35.0f, 40.0f, 50.0f, 60.0f, 80.0f, 100.0f
Lightvalve 34:bb2ca2fc2a8e 621 }; // duty
Lightvalve 30:8d561f16383b 622 float LT_Voltage_Output[LT_MAX_IDX] = {-321.4f, -291.3f, -261.5f, -246.8f, -231.7f, -223.9f, -216.1f, -207.9f, -198.8f,
Lightvalve 34:bb2ca2fc2a8e 623 -196.9f, -195.0f, -192.5f, -188.8f, -184.5f, -180.2f, -175.9f, -171.5f, -166.3f, -161.0f,
Lightvalve 34:bb2ca2fc2a8e 624 -156.0f, -149.5f, -139.0f, -126.0f, -107.0f, -87.5f, -64.0f, -38.5f, -9.4f, 0.0f,
Lightvalve 34:bb2ca2fc2a8e 625 12.0f, 43.5f, 69.0f, 94.0f, 114.0f, 132.0f, 146.0f, 155.5f, 162.3f, 168.2f,
Lightvalve 34:bb2ca2fc2a8e 626 173.1f, 178.2f, 182.8f, 187.4f, 191.8f, 196.0f, 199.7f, 201.9f, 203.8f, 205.6f,
Lightvalve 34:bb2ca2fc2a8e 627 214.6f, 222.5f, 230.4f, 238.2f, 253.3f, 268.0f, 297.6f, 327.7f
Lightvalve 34:bb2ca2fc2a8e 628 }; // mV
Lightvalve 13:747daba9cf59 629
Lightvalve 30:8d561f16383b 630 float PWM_duty_byLT(float Ref_V)
Lightvalve 14:8e7590227d22 631 {
Lightvalve 30:8d561f16383b 632 float PWM_duty = 0.0f;
Lightvalve 13:747daba9cf59 633 if(Ref_V<LT_Voltage_Output[0]) {
Lightvalve 30:8d561f16383b 634 PWM_duty = (Ref_V-LT_Voltage_Output[0])/1.5f+LT_PWM_duty[0];
Lightvalve 13:747daba9cf59 635 } else if (Ref_V>=LT_Voltage_Output[LT_MAX_IDX-1]) {
Lightvalve 30:8d561f16383b 636 PWM_duty = (Ref_V-LT_Voltage_Output[LT_MAX_IDX-1])/1.5f+LT_PWM_duty[LT_MAX_IDX-1];
Lightvalve 13:747daba9cf59 637 } else {
Lightvalve 13:747daba9cf59 638 int idx = 0;
Lightvalve 13:747daba9cf59 639 for(idx=0; idx<LT_MAX_IDX-1; idx++) {
Lightvalve 30:8d561f16383b 640 float ini_x = LT_Voltage_Output[idx];
Lightvalve 30:8d561f16383b 641 float fin_x = LT_Voltage_Output[idx+1];
Lightvalve 30:8d561f16383b 642 float ini_y = LT_PWM_duty[idx];
Lightvalve 30:8d561f16383b 643 float fin_y = LT_PWM_duty[idx+1];
Lightvalve 13:747daba9cf59 644 if(Ref_V>=ini_x && Ref_V<fin_x) {
Lightvalve 13:747daba9cf59 645 PWM_duty = (fin_y-ini_y)/(fin_x-ini_x)*(Ref_V-ini_x) + ini_y;
Lightvalve 13:747daba9cf59 646 break;
Lightvalve 13:747daba9cf59 647 }
Lightvalve 13:747daba9cf59 648 }
Lightvalve 13:747daba9cf59 649 }
Lightvalve 14:8e7590227d22 650
Lightvalve 13:747daba9cf59 651 return PWM_duty;
Lightvalve 13:747daba9cf59 652 }
jobuuu 6:df07d3491e3a 653
Lightvalve 57:f4819de54e7a 654
Lightvalve 57:f4819de54e7a 655
Lightvalve 57:f4819de54e7a 656
Lightvalve 57:f4819de54e7a 657
jobuuu 2:a1c0a37df760 658 /*******************************************************************************
jobuuu 2:a1c0a37df760 659 TIMER INTERRUPT
jobuuu 2:a1c0a37df760 660 *******************************************************************************/
jobuuu 2:a1c0a37df760 661
Lightvalve 51:b46bed7fec80 662 float FREQ_TMR4 = (float)FREQ_20k;
Lightvalve 51:b46bed7fec80 663 float DT_TMR4 = (float)DT_20k;
Lightvalve 57:f4819de54e7a 664 long CNT_TMR4 = 0;
Lightvalve 57:f4819de54e7a 665 int TMR4_FREQ_10k = (int)FREQ_10k;
jobuuu 1:e04e563be5ce 666 extern "C" void TIM4_IRQHandler(void)
jobuuu 1:e04e563be5ce 667 {
Lightvalve 19:23b7c1ad8683 668 if (TIM4->SR & TIM_SR_UIF ) {
Lightvalve 21:e5f1a43ea6f9 669
Lightvalve 21:e5f1a43ea6f9 670 /*******************************************************
Lightvalve 21:e5f1a43ea6f9 671 *** Sensor Read & Data Handling
Lightvalve 21:e5f1a43ea6f9 672 ********************************************************/
Lightvalve 13:747daba9cf59 673
Lightvalve 57:f4819de54e7a 674 //Encoder
Lightvalve 57:f4819de54e7a 675 if (CNT_TMR4 % (int) ((int) FREQ_TMR4/TMR4_FREQ_10k) == 0) {
Lightvalve 57:f4819de54e7a 676 ENC_UPDATE();
Lightvalve 57:f4819de54e7a 677 }
Lightvalve 62:b5452adfb2cd 678
Lightvalve 62:b5452adfb2cd 679 for(int i=0; i<10; i++){
Lightvalve 62:b5452adfb2cd 680 position_array[i] = position_array[i+1];
Lightvalve 62:b5452adfb2cd 681 }
Lightvalve 62:b5452adfb2cd 682 position_array[10] = (pos.ref/(float)(ENC_PULSE_PER_POSITION)+10.0f)/90.0f;
Lightvalve 62:b5452adfb2cd 683
Lightvalve 62:b5452adfb2cd 684 for(int i=0; i<5; i++){
Lightvalve 62:b5452adfb2cd 685 input_array[i] = position_array[2*i+2] - (pos.ref/(float)(ENC_PULSE_PER_POSITION)+10.0f)/90.0f;
Lightvalve 62:b5452adfb2cd 686 }
Lightvalve 61:bc8c8270f0ab 687
Lightvalve 61:bc8c8270f0ab 688 ADC1->CR2 |= 0x40000000;
Lightvalve 58:2eade98630e2 689 if (SENSING_MODE == 0) {
Lightvalve 58:2eade98630e2 690 // Torque Sensing (0~210)bar =============================================
Lightvalve 58:2eade98630e2 691 float pres_A_new = (((float) ADC1->DR) - 2047.5f);
Lightvalve 58:2eade98630e2 692 double alpha_update_ft = 1.0f / (1.0f + FREQ_TMR4 / (2.0f * 3.14f * 100.0f)); // f_cutoff : 200Hz
Lightvalve 58:2eade98630e2 693 pres_A.sen = (1.0f - alpha_update_ft) * pres_A.sen + alpha_update_ft * pres_A_new;
Lightvalve 58:2eade98630e2 694 torq.sen = pres_A.sen / TORQUE_SENSOR_PULSE_PER_TORQUE;
Lightvalve 17:1865016ca2e7 695
Lightvalve 58:2eade98630e2 696 } else if (SENSING_MODE == 1) {
Lightvalve 58:2eade98630e2 697 // Pressure Sensing (0~210)bar =============================================
Lightvalve 58:2eade98630e2 698 float pres_A_new = (((float)ADC1->DR) - PRES_A_NULL);
Lightvalve 58:2eade98630e2 699 float pres_B_new = (((float)ADC2->DR) - PRES_B_NULL);
Lightvalve 58:2eade98630e2 700 double alpha_update_pres = 1.0f / (1.0f + FREQ_TMR4 / (2.0f * 3.14f * 200.0f)); // f_cutoff : 500Hz
Lightvalve 58:2eade98630e2 701 pres_A.sen = (1.0f - alpha_update_pres) * pres_A.sen + alpha_update_pres * pres_A_new;
Lightvalve 58:2eade98630e2 702 pres_B.sen = (1.0f - alpha_update_pres) * pres_B.sen + alpha_update_pres * pres_B_new;
Lightvalve 58:2eade98630e2 703 CUR_PRES_A_BAR = pres_A.sen / PRES_SENSOR_A_PULSE_PER_BAR;
Lightvalve 58:2eade98630e2 704 CUR_PRES_B_BAR = pres_B.sen / PRES_SENSOR_B_PULSE_PER_BAR;
Lightvalve 50:3c630b5eba9f 705
Lightvalve 58:2eade98630e2 706 if ((OPERATING_MODE & 0x01) == 0) { // Rotary Actuator
Lightvalve 58:2eade98630e2 707 torq.sen = (PISTON_AREA_A * CUR_PRES_A_BAR - PISTON_AREA_B * CUR_PRES_B_BAR) * 0.0001f; // mm^3*bar >> Nm
Lightvalve 58:2eade98630e2 708 } else if ((OPERATING_MODE & 0x01) == 1) { // Linear Actuator
Lightvalve 58:2eade98630e2 709 torq.sen = (PISTON_AREA_A * CUR_PRES_A_BAR - PISTON_AREA_B * CUR_PRES_B_BAR) * 0.1f; // mm^2*bar >> N
Lightvalve 58:2eade98630e2 710 }
Lightvalve 58:2eade98630e2 711 }
Lightvalve 61:bc8c8270f0ab 712
Lightvalve 58:2eade98630e2 713 // //Pressure sensor A
Lightvalve 58:2eade98630e2 714 // ADC1->CR2 |= 0x40000000; // adc _ 12bit
Lightvalve 58:2eade98630e2 715 // //while((ADC1->SR & 0b10));
Lightvalve 58:2eade98630e2 716 // float alpha_update_pres_A = 1.0f/(1.0f + FREQ_TMR4/(2.0f*3.14f*100.0f));
Lightvalve 58:2eade98630e2 717 // float pres_A_new = ((float)ADC1->DR);
Lightvalve 58:2eade98630e2 718 // pres_A.sen = pres_A.sen*(1.0f-alpha_update_pres_A)+pres_A_new*(alpha_update_pres_A);
Lightvalve 58:2eade98630e2 719 // torq.sen = - (pres_A.sen-2048.0f); //pulse -2047~2047 //SW just changed the sign to correct the direction of loadcell on LIGHT. Correct later.
Lightvalve 58:2eade98630e2 720 //
Lightvalve 58:2eade98630e2 721 //
Lightvalve 58:2eade98630e2 722 // //Pressure sensor B
Lightvalve 58:2eade98630e2 723 // float alpha_update_pres_B = 1.0f/(1.0f + FREQ_TMR4/(2.0f*3.14f*100.0f));
Lightvalve 58:2eade98630e2 724 // float pres_B_new = ((float)ADC2->DR);
Lightvalve 58:2eade98630e2 725 // pres_B.sen = pres_B.sen*(1.0f-alpha_update_pres_B)+pres_B_new*(alpha_update_pres_B);
Lightvalve 58:2eade98630e2 726 // //torq.sen = pres_A.sen * (float) PISTON_AREA_A - pres_B.sen * (float) PISTON_AREA_B;
Lightvalve 17:1865016ca2e7 727
Lightvalve 17:1865016ca2e7 728
Lightvalve 21:e5f1a43ea6f9 729 //Current
Lightvalve 21:e5f1a43ea6f9 730 //ADC3->CR2 |= 0x40000000; // adc _ 12bit
Lightvalve 25:3e6b574cab5c 731 //int raw_cur = ADC3->DR;
Lightvalve 21:e5f1a43ea6f9 732 //while((ADC3->SR & 0b10));
Lightvalve 51:b46bed7fec80 733 float alpha_update_cur = 1.0f/(1.0f + FREQ_TMR4/(2.0f*3.14f*500.0f)); // f_cutoff : 500Hz
Lightvalve 30:8d561f16383b 734 float cur_new = ((float)ADC3->DR-2048.0f)*20.0f/4096.0f; // unit : mA
Lightvalve 30:8d561f16383b 735 cur.sen=cur.sen*(1.0f-alpha_update_cur)+cur_new*(alpha_update_cur);
Lightvalve 25:3e6b574cab5c 736 //cur.sen = raw_cur;
Lightvalve 58:2eade98630e2 737
Lightvalve 57:f4819de54e7a 738 CNT_TMR4++;
Lightvalve 21:e5f1a43ea6f9 739 }
Lightvalve 11:82d8768d7351 740 TIM4->SR = 0x0; // reset the status register
Lightvalve 11:82d8768d7351 741 }
Lightvalve 19:23b7c1ad8683 742
Lightvalve 19:23b7c1ad8683 743
Lightvalve 18:b8adf1582ea3 744 int j =0;
Lightvalve 54:647072f5307a 745 float FREQ_TMR3 = (float)FREQ_5k;
Lightvalve 48:889798ff9329 746 float DT_TMR3 = (float)DT_5k;
Lightvalve 45:35fa6884d0c6 747 int cnt_trans = 0;
Lightvalve 48:889798ff9329 748 double VALVE_POS_RAW_FORCE_FB_LOGGING = 0.0f;
Lightvalve 57:f4819de54e7a 749 int can_rest =0;
Lightvalve 48:889798ff9329 750
Lightvalve 11:82d8768d7351 751 extern "C" void TIM3_IRQHandler(void)
Lightvalve 21:e5f1a43ea6f9 752 {
Lightvalve 19:23b7c1ad8683 753 if (TIM3->SR & TIM_SR_UIF ) {
Lightvalve 57:f4819de54e7a 754
Lightvalve 57:f4819de54e7a 755 if (((OPERATING_MODE&0b110)>>1) == 0) {
Lightvalve 57:f4819de54e7a 756 K_v = 0.4f; // Moog (LPM >> mA) , 100bar
Lightvalve 57:f4819de54e7a 757 mV_PER_mA = 500.0f; // 5000mV/10mA
Lightvalve 57:f4819de54e7a 758 mV_PER_pulse = 0.5f; // 5000mV/10000pulse
Lightvalve 57:f4819de54e7a 759 mA_PER_pulse = 0.001f; // 10mA/10000pulse
Lightvalve 57:f4819de54e7a 760 } else if (((OPERATING_MODE&0b110)>>1) == 1) {
Lightvalve 57:f4819de54e7a 761 K_v = 0.5f; // KNR (LPM >> mA) , 100bar
Lightvalve 57:f4819de54e7a 762 mV_PER_mA = 166.6666f; // 5000mV/30mA
Lightvalve 57:f4819de54e7a 763 mV_PER_pulse = 0.5f; // 5000mV/10000pulse
Lightvalve 57:f4819de54e7a 764 mA_PER_pulse = 0.003f; // 30mA/10000pulse
Lightvalve 57:f4819de54e7a 765 }
Lightvalve 50:3c630b5eba9f 766
Lightvalve 50:3c630b5eba9f 767 if(MODE_POS_FT_TRANS == 1) {
Lightvalve 48:889798ff9329 768 alpha_trans = (float)(1.0f - cos(3.141592f * (float)cnt_trans * DT_TMR3 /3.0f))/2.0f;
Lightvalve 45:35fa6884d0c6 769 cnt_trans++;
Lightvalve 46:2694daea349b 770 torq.err_sum = 0;
Lightvalve 48:889798ff9329 771 if((float)cnt_trans * DT_TMR3 > 3.0f)
Lightvalve 45:35fa6884d0c6 772 MODE_POS_FT_TRANS = 2;
Lightvalve 50:3c630b5eba9f 773 } else if(MODE_POS_FT_TRANS == 3) {
Lightvalve 48:889798ff9329 774 alpha_trans = (float)(1.0f + cos(3.141592f * (float)cnt_trans * DT_TMR3 /3.0f))/2.0f;
Lightvalve 45:35fa6884d0c6 775 cnt_trans++;
Lightvalve 46:2694daea349b 776 torq.err_sum = 0;
Lightvalve 48:889798ff9329 777 if((float) cnt_trans * DT_TMR3 > 3.0f )
Lightvalve 45:35fa6884d0c6 778 MODE_POS_FT_TRANS = 0;
Lightvalve 50:3c630b5eba9f 779 } else if(MODE_POS_FT_TRANS == 2) {
Lightvalve 58:2eade98630e2 780 alpha_trans = 1.0f;
Lightvalve 45:35fa6884d0c6 781 cnt_trans = 0;
Lightvalve 50:3c630b5eba9f 782 } else {
Lightvalve 58:2eade98630e2 783 alpha_trans = 0.0f;
Lightvalve 45:35fa6884d0c6 784 cnt_trans = 0;
Lightvalve 45:35fa6884d0c6 785 }
Lightvalve 45:35fa6884d0c6 786
Lightvalve 50:3c630b5eba9f 787
Lightvalve 57:f4819de54e7a 788 int UTILITY_MODE = 0;
Lightvalve 57:f4819de54e7a 789 int CONTROL_MODE = 0;
Lightvalve 58:2eade98630e2 790
Lightvalve 57:f4819de54e7a 791 if (CONTROL_UTILITY_MODE >= 20 || CONTROL_UTILITY_MODE == 0) {
Lightvalve 57:f4819de54e7a 792 UTILITY_MODE = CONTROL_UTILITY_MODE;
Lightvalve 57:f4819de54e7a 793 CONTROL_MODE = MODE_NO_ACT;
Lightvalve 57:f4819de54e7a 794 } else {
Lightvalve 57:f4819de54e7a 795 CONTROL_MODE = CONTROL_UTILITY_MODE;
Lightvalve 57:f4819de54e7a 796 UTILITY_MODE = MODE_NO_ACT;
Lightvalve 57:f4819de54e7a 797 }
Lightvalve 56:6f50d9d3bfee 798
Lightvalve 56:6f50d9d3bfee 799
Lightvalve 56:6f50d9d3bfee 800
Lightvalve 57:f4819de54e7a 801 // UTILITY MODE ------------------------------------------------------------
Lightvalve 56:6f50d9d3bfee 802
Lightvalve 57:f4819de54e7a 803 switch (UTILITY_MODE) {
Lightvalve 57:f4819de54e7a 804 case MODE_NO_ACT: {
Lightvalve 13:747daba9cf59 805 break;
Lightvalve 13:747daba9cf59 806 }
Lightvalve 14:8e7590227d22 807
Lightvalve 14:8e7590227d22 808 case MODE_TORQUE_SENSOR_NULLING: {
Lightvalve 13:747daba9cf59 809 // DAC Voltage reference set
Lightvalve 14:8e7590227d22 810 if (TMR3_COUNT_TORQUE_NULL < TMR_FREQ_5k * 2) {
Lightvalve 15:bd0d12728506 811 CUR_TORQUE_sum += torq.sen;
Lightvalve 19:23b7c1ad8683 812
Lightvalve 14:8e7590227d22 813 if (TMR3_COUNT_TORQUE_NULL % 10 == 0) {
Lightvalve 30:8d561f16383b 814 CUR_TORQUE_mean = CUR_TORQUE_sum / 10.0f;
Lightvalve 13:747daba9cf59 815 CUR_TORQUE_sum = 0;
Lightvalve 14:8e7590227d22 816
Lightvalve 59:f308b1656d9c 817 TORQUE_VREF += 0.0003f * (0.0f - CUR_TORQUE_mean);
Lightvalve 19:23b7c1ad8683 818
Lightvalve 30:8d561f16383b 819 if (TORQUE_VREF > 3.3f) TORQUE_VREF = 3.3f;
Lightvalve 59:f308b1656d9c 820 if (TORQUE_VREF < 0.0f) TORQUE_VREF = 0.0f;
Lightvalve 50:3c630b5eba9f 821
Lightvalve 16:903b5a4433b4 822 //spi_eeprom_write(RID_TORQUE_SENSOR_VREF, (int16_t) (TORQUE_VREF * 1000.0));
Lightvalve 30:8d561f16383b 823 dac_1 = TORQUE_VREF / 3.3f;
Lightvalve 13:747daba9cf59 824 }
Lightvalve 13:747daba9cf59 825 } else {
Lightvalve 58:2eade98630e2 826 CONTROL_UTILITY_MODE = MODE_NO_ACT;
Lightvalve 14:8e7590227d22 827 TMR3_COUNT_TORQUE_NULL = 0;
Lightvalve 13:747daba9cf59 828 CUR_TORQUE_sum = 0;
Lightvalve 13:747daba9cf59 829 CUR_TORQUE_mean = 0;
Lightvalve 19:23b7c1ad8683 830
Lightvalve 16:903b5a4433b4 831 ROM_RESET_DATA();
Lightvalve 19:23b7c1ad8683 832
Lightvalve 30:8d561f16383b 833 dac_1 = TORQUE_VREF / 3.3f;
Lightvalve 14:8e7590227d22 834
Lightvalve 13:747daba9cf59 835 }
Lightvalve 14:8e7590227d22 836 TMR3_COUNT_TORQUE_NULL++;
Lightvalve 13:747daba9cf59 837 break;
Lightvalve 19:23b7c1ad8683 838 }
Lightvalve 14:8e7590227d22 839
Lightvalve 50:3c630b5eba9f 840 // case MODE_VALVE_NULLING_AND_DEADZONE_SETTING: {
Lightvalve 50:3c630b5eba9f 841 // if (TMR3_COUNT_DEADZONE == 0) {
Lightvalve 50:3c630b5eba9f 842 // if (pos_plus_end == pos_minus_end) need_enc_init = true;
Lightvalve 50:3c630b5eba9f 843 // else temp_time = 0;
Lightvalve 50:3c630b5eba9f 844 // }
Lightvalve 50:3c630b5eba9f 845 // if (need_enc_init) {
Lightvalve 50:3c630b5eba9f 846 // if (TMR3_COUNT_DEADZONE < (int) (0.5f * (float) TMR_FREQ_5k)) {
Lightvalve 50:3c630b5eba9f 847 // V_out = VALVE_VOLTAGE_LIMIT * 1000.0f;
Lightvalve 50:3c630b5eba9f 848 // pos_plus_end = pos.sen;
Lightvalve 50:3c630b5eba9f 849 // } else if (TMR3_COUNT_DEADZONE < TMR_FREQ_5k) {
Lightvalve 50:3c630b5eba9f 850 // V_out = -VALVE_VOLTAGE_LIMIT * 1000.0f;
Lightvalve 50:3c630b5eba9f 851 // pos_minus_end = pos.sen;
Lightvalve 50:3c630b5eba9f 852 // } else if (TMR3_COUNT_DEADZONE == TMR_FREQ_5k) need_enc_init = false;
Lightvalve 50:3c630b5eba9f 853 // temp_time = TMR_FREQ_5k;
Lightvalve 50:3c630b5eba9f 854 // }
Lightvalve 50:3c630b5eba9f 855 //
Lightvalve 50:3c630b5eba9f 856 // if (temp_time <= TMR3_COUNT_DEADZONE && TMR3_COUNT_DEADZONE < (temp_time + TMR_FREQ_5k)) {
Lightvalve 50:3c630b5eba9f 857 // V_out = (float) P_GAIN_JOINT_POSITION * (0.5f * (float) pos_plus_end + 0.5f * (float) pos_minus_end - (float) pos.sen);
Lightvalve 50:3c630b5eba9f 858 // VALVE_CENTER = VALVE_DEADZONE_PLUS = VALVE_DEADZONE_MINUS = 0;
Lightvalve 50:3c630b5eba9f 859 //
Lightvalve 50:3c630b5eba9f 860 // } else if (temp_time <= TMR3_COUNT_DEADZONE && TMR3_COUNT_DEADZONE < (temp_time + (int) (1.9f * (float) TMR_FREQ_5k))) {
Lightvalve 50:3c630b5eba9f 861 // V_out = 0;
Lightvalve 50:3c630b5eba9f 862 // CUR_VELOCITY_sum += CUR_VELOCITY;
Lightvalve 50:3c630b5eba9f 863 // } else if (TMR3_COUNT_DEADZONE == (temp_time + 2 * TMR_FREQ_5k)) {
Lightvalve 50:3c630b5eba9f 864 // if (CUR_VELOCITY_sum == 0) DZ_dir = 1;
Lightvalve 50:3c630b5eba9f 865 // else if (CUR_VELOCITY_sum > 0) DZ_dir = 1;
Lightvalve 50:3c630b5eba9f 866 // else if (CUR_VELOCITY_sum < 0) DZ_dir = -1;
Lightvalve 50:3c630b5eba9f 867 // else DZ_temp_cnt2 = DZ_end;
Lightvalve 50:3c630b5eba9f 868 // CUR_VELOCITY_sum = 0;
Lightvalve 50:3c630b5eba9f 869 // } else if (TMR3_COUNT_DEADZONE > (temp_time + 2 * TMR_FREQ_5k)) {
Lightvalve 50:3c630b5eba9f 870 // if (TMR3_COUNT_DEADZONE > (temp_time + 10 * TMR_FREQ_5k)) DZ_temp_cnt2 = DZ_end;
Lightvalve 50:3c630b5eba9f 871 //
Lightvalve 50:3c630b5eba9f 872 // // Position of Dead Zone
Lightvalve 50:3c630b5eba9f 873 // // (CUR_VELOCITY < 0) (CUR_VELOCITY == 0) (CUR_VELOCITY > 0)
Lightvalve 50:3c630b5eba9f 874 // // | / | / |/
Lightvalve 50:3c630b5eba9f 875 // // | ______/ ___|___/ ______/|
Lightvalve 50:3c630b5eba9f 876 // // |/ / | / |
Lightvalve 50:3c630b5eba9f 877 // // /| / | / |
Lightvalve 50:3c630b5eba9f 878 // // 0V 0V 0V
Lightvalve 50:3c630b5eba9f 879 //
Lightvalve 50:3c630b5eba9f 880 // if (DZ_temp_cnt2 < DZ_end) {
Lightvalve 50:3c630b5eba9f 881 // if (TMR3_COUNT_DEADZONE % 20 != 0) {
Lightvalve 50:3c630b5eba9f 882 // CUR_VELOCITY_sum += CUR_VELOCITY;
Lightvalve 50:3c630b5eba9f 883 // } else {
Lightvalve 50:3c630b5eba9f 884 // V_out -= DZ_dir;
Lightvalve 50:3c630b5eba9f 885 // if (CUR_VELOCITY_sum * DZ_dir < 0) DZ_temp_cnt++;
Lightvalve 50:3c630b5eba9f 886 // CUR_VELOCITY_sum = 0;
Lightvalve 50:3c630b5eba9f 887 // }
Lightvalve 50:3c630b5eba9f 888 // if (DZ_temp_cnt == 5) {
Lightvalve 50:3c630b5eba9f 889 // if (DZ_dir >= 0) VALVE_DEADZONE_MINUS = (int16_t) V_out;
Lightvalve 50:3c630b5eba9f 890 // else VALVE_DEADZONE_PLUS = (int16_t) V_out;
Lightvalve 50:3c630b5eba9f 891 // DZ_dir = -DZ_dir;
Lightvalve 50:3c630b5eba9f 892 // DZ_temp_cnt = 0;
Lightvalve 50:3c630b5eba9f 893 // DZ_temp_cnt2++;
Lightvalve 50:3c630b5eba9f 894 // }
Lightvalve 50:3c630b5eba9f 895 // } else {
Lightvalve 50:3c630b5eba9f 896 // TMR3_COUNT_DEADZONE = -1;
Lightvalve 50:3c630b5eba9f 897 // VALVE_CENTER = VALVE_DEADZONE_PLUS / 2 + VALVE_DEADZONE_MINUS / 2;
Lightvalve 50:3c630b5eba9f 898 // if (VALVE_DEADZONE_PLUS < VALVE_DEADZONE_MINUS) {
Lightvalve 50:3c630b5eba9f 899 // VALVE_DEADZONE_PLUS = VALVE_CENTER;
Lightvalve 50:3c630b5eba9f 900 // VALVE_DEADZONE_MINUS = VALVE_CENTER;
Lightvalve 50:3c630b5eba9f 901 // }
Lightvalve 50:3c630b5eba9f 902 // V_out = 0;
Lightvalve 50:3c630b5eba9f 903 //
Lightvalve 50:3c630b5eba9f 904 // ROM_RESET_DATA();
Lightvalve 50:3c630b5eba9f 905 //
Lightvalve 50:3c630b5eba9f 906 // //spi_eeprom_write(RID_VALVE_DEADZONE_PLUS, VALVE_DEADZONE_PLUS);
Lightvalve 50:3c630b5eba9f 907 // //spi_eeprom_write(RID_VALVE_DEADZONE_MINUS, VALVE_DEADZONE_MINUS);
Lightvalve 50:3c630b5eba9f 908 //
Lightvalve 50:3c630b5eba9f 909 // CONTROL_MODE = MODE_NO_ACT;
Lightvalve 50:3c630b5eba9f 910 // DZ_temp_cnt2 = 0;
Lightvalve 50:3c630b5eba9f 911 // }
Lightvalve 50:3c630b5eba9f 912 // }
Lightvalve 50:3c630b5eba9f 913 // TMR3_COUNT_DEADZONE++;
Lightvalve 50:3c630b5eba9f 914 // break;
Lightvalve 50:3c630b5eba9f 915 // }
Lightvalve 14:8e7590227d22 916
Lightvalve 14:8e7590227d22 917 case MODE_FIND_HOME: {
Lightvalve 29:69f3f5445d6d 918 if (FINDHOME_STAGE == FINDHOME_INIT) {
Lightvalve 14:8e7590227d22 919 cnt_findhome = 0;
Lightvalve 14:8e7590227d22 920 cnt_vel_findhome = 0;
Lightvalve 14:8e7590227d22 921 //REFERENCE_MODE = MODE_REF_NO_ACT; // Stop taking reference data from PODO
Lightvalve 59:f308b1656d9c 922 pos.ref = pos.sen;
Lightvalve 59:f308b1656d9c 923 vel.ref = 0.0f;
Lightvalve 29:69f3f5445d6d 924 FINDHOME_STAGE = FINDHOME_GOTOLIMIT;
Lightvalve 29:69f3f5445d6d 925 } else if (FINDHOME_STAGE == FINDHOME_GOTOLIMIT) {
Lightvalve 29:69f3f5445d6d 926 int cnt_check_enc = (TMR_FREQ_5k/500);
Lightvalve 29:69f3f5445d6d 927 if(cnt_findhome%cnt_check_enc == 0) {
Lightvalve 29:69f3f5445d6d 928 FINDHOME_POSITION = pos.sen;
Lightvalve 29:69f3f5445d6d 929 FINDHOME_VELOCITY = FINDHOME_POSITION - FINDHOME_POSITION_OLD;
Lightvalve 29:69f3f5445d6d 930 FINDHOME_POSITION_OLD = FINDHOME_POSITION;
Lightvalve 29:69f3f5445d6d 931 }
Lightvalve 29:69f3f5445d6d 932 cnt_findhome++;
Lightvalve 14:8e7590227d22 933
Lightvalve 29:69f3f5445d6d 934 if (abs(FINDHOME_VELOCITY) <= 1) {
Lightvalve 29:69f3f5445d6d 935 cnt_vel_findhome = cnt_vel_findhome + 1;
Lightvalve 29:69f3f5445d6d 936 } else {
Lightvalve 29:69f3f5445d6d 937 cnt_vel_findhome = 0;
Lightvalve 29:69f3f5445d6d 938 }
Lightvalve 19:23b7c1ad8683 939
Lightvalve 57:f4819de54e7a 940 if ((cnt_vel_findhome < 3*TMR_FREQ_5k) && cnt_findhome < 10*TMR_FREQ_5k) { // wait for 3sec
Lightvalve 29:69f3f5445d6d 941 //REFERENCE_MODE = MODE_REF_NO_ACT;
Lightvalve 59:f308b1656d9c 942 if (HOMEPOS_OFFSET > 0) pos.ref = pos.ref + 2.0f;
Lightvalve 59:f308b1656d9c 943 else pos.ref = pos.ref - 2.0f;
Lightvalve 61:bc8c8270f0ab 944
Lightvalve 59:f308b1656d9c 945 // pos.err = pos.ref_home_pos - pos.sen;
Lightvalve 59:f308b1656d9c 946 // float VALVE_POS_RAW_POS_FB = 0.0f;
Lightvalve 59:f308b1656d9c 947 // VALVE_POS_RAW_POS_FB = (float) P_GAIN_JOINT_POSITION * pos.err/(float) ENC_PULSE_PER_POSITION * 0.01f;
Lightvalve 59:f308b1656d9c 948 // valve_pos.ref = VALVE_POS_RAW_POS_FB + (float) VALVE_CENTER;
Lightvalve 59:f308b1656d9c 949 // VALVE_POS_CONTROL(valve_pos.ref);
Lightvalve 61:bc8c8270f0ab 950
Lightvalve 59:f308b1656d9c 951 CONTROL_MODE = MODE_JOINT_CONTROL;
Lightvalve 59:f308b1656d9c 952 alpha_trans = 0.0f;
Lightvalve 61:bc8c8270f0ab 953
Lightvalve 34:bb2ca2fc2a8e 954
Lightvalve 29:69f3f5445d6d 955 } else {
Lightvalve 29:69f3f5445d6d 956 ENC_SET(HOMEPOS_OFFSET);
Lightvalve 29:69f3f5445d6d 957 INIT_REF_POS = HOMEPOS_OFFSET;
Lightvalve 29:69f3f5445d6d 958 REF_POSITION = 0;
Lightvalve 29:69f3f5445d6d 959 REF_VELOCITY = 0;
Lightvalve 29:69f3f5445d6d 960 FINDHOME_POSITION = 0;
Lightvalve 29:69f3f5445d6d 961 FINDHOME_POSITION_OLD = 0;
Lightvalve 29:69f3f5445d6d 962 FINDHOME_VELOCITY = 0;
Lightvalve 29:69f3f5445d6d 963 cnt_findhome = 0;
Lightvalve 29:69f3f5445d6d 964 cnt_vel_findhome = 0;
Lightvalve 29:69f3f5445d6d 965 FINDHOME_STAGE = FINDHOME_ZEROPOSE;
Lightvalve 29:69f3f5445d6d 966 }
Lightvalve 29:69f3f5445d6d 967 } else if (FINDHOME_STAGE == FINDHOME_ZEROPOSE) {
Lightvalve 29:69f3f5445d6d 968 int T_move = 2*TMR_FREQ_5k;
Lightvalve 59:f308b1656d9c 969 pos.ref = (0.0f - (float)INIT_REF_POS)*0.5f*(1.0f - cos(3.14159f * (float)cnt_findhome / (float)T_move)) + (float)INIT_REF_POS;
Lightvalve 59:f308b1656d9c 970 vel.ref = 0.0f;
Lightvalve 19:23b7c1ad8683 971
Lightvalve 29:69f3f5445d6d 972 // input for position control
Lightvalve 61:bc8c8270f0ab 973
Lightvalve 59:f308b1656d9c 974 CONTROL_MODE = MODE_JOINT_CONTROL;
Lightvalve 59:f308b1656d9c 975 alpha_trans = 0.0f;
Lightvalve 59:f308b1656d9c 976 // pos.err = pos.ref - (float)pos.sen;
Lightvalve 59:f308b1656d9c 977 // float VALVE_POS_RAW_POS_FB = 0.0f;
Lightvalve 59:f308b1656d9c 978 // VALVE_POS_RAW_POS_FB = (float) P_GAIN_JOINT_POSITION * 0.01f * pos.err/(float) ENC_PULSE_PER_POSITION;
Lightvalve 59:f308b1656d9c 979 // valve_pos.ref = VALVE_POS_RAW_POS_FB + (float) VALVE_CENTER;
Lightvalve 59:f308b1656d9c 980 // VALVE_POS_CONTROL(valve_pos.ref);
Lightvalve 29:69f3f5445d6d 981
Lightvalve 29:69f3f5445d6d 982 cnt_findhome++;
Lightvalve 29:69f3f5445d6d 983 if (cnt_findhome >= T_move) {
Lightvalve 29:69f3f5445d6d 984 //REFERENCE_MODE = MODE_REF_DIRECT;
Lightvalve 29:69f3f5445d6d 985 cnt_findhome = 0;
Lightvalve 30:8d561f16383b 986 pos.ref = 0.0f;
Lightvalve 30:8d561f16383b 987 vel.ref = 0.0f;
Lightvalve 30:8d561f16383b 988 pos.ref_home_pos = 0.0f;
Lightvalve 30:8d561f16383b 989 vel.ref_home_pos = 0.0f;
Lightvalve 29:69f3f5445d6d 990 FINDHOME_STAGE = FINDHOME_INIT;
Lightvalve 57:f4819de54e7a 991 CONTROL_UTILITY_MODE = MODE_JOINT_CONTROL;
Lightvalve 29:69f3f5445d6d 992 }
Lightvalve 13:747daba9cf59 993 }
Lightvalve 19:23b7c1ad8683 994
Lightvalve 13:747daba9cf59 995 break;
Lightvalve 13:747daba9cf59 996 }
Lightvalve 14:8e7590227d22 997
Lightvalve 50:3c630b5eba9f 998 // case MODE_VALVE_GAIN_SETTING: {
Lightvalve 50:3c630b5eba9f 999 // if (TMR3_COUNT_FLOWRATE == 0) {
Lightvalve 50:3c630b5eba9f 1000 // if (pos_plus_end == pos_minus_end) need_enc_init = true;
Lightvalve 50:3c630b5eba9f 1001 // else {
Lightvalve 50:3c630b5eba9f 1002 // V_out = -VALVE_VOLTAGE_LIMIT * 1000.0f;
Lightvalve 50:3c630b5eba9f 1003 // temp_time = (int) (0.5f * (float) TMR_FREQ_5k);
Lightvalve 50:3c630b5eba9f 1004 // }
Lightvalve 50:3c630b5eba9f 1005 // }
Lightvalve 50:3c630b5eba9f 1006 // if (need_enc_init) {
Lightvalve 50:3c630b5eba9f 1007 // if (TMR3_COUNT_FLOWRATE < (int) (0.5f * (float) TMR_FREQ_5k)) {
Lightvalve 50:3c630b5eba9f 1008 // V_out = VALVE_VOLTAGE_LIMIT * 1000.0f;
Lightvalve 50:3c630b5eba9f 1009 // pos_plus_end = pos.sen;
Lightvalve 50:3c630b5eba9f 1010 // } else if (TMR3_COUNT_FLOWRATE < TMR_FREQ_5k) {
Lightvalve 50:3c630b5eba9f 1011 // V_out = -VALVE_VOLTAGE_LIMIT * 1000.0f;
Lightvalve 50:3c630b5eba9f 1012 // pos_minus_end = pos.sen;
Lightvalve 50:3c630b5eba9f 1013 // } else if (TMR3_COUNT_FLOWRATE == TMR_FREQ_5k) {
Lightvalve 50:3c630b5eba9f 1014 // need_enc_init = false;
Lightvalve 50:3c630b5eba9f 1015 // check_vel_pos_init = (int) (0.9f * (float) (pos_plus_end - pos_minus_end));
Lightvalve 50:3c630b5eba9f 1016 // check_vel_pos_fin = (int) (0.95f * (float) (pos_plus_end - pos_minus_end));
Lightvalve 50:3c630b5eba9f 1017 // check_vel_pos_interv = check_vel_pos_fin - check_vel_pos_init;
Lightvalve 50:3c630b5eba9f 1018 // }
Lightvalve 50:3c630b5eba9f 1019 // temp_time = TMR_FREQ_5k;
Lightvalve 50:3c630b5eba9f 1020 // }
Lightvalve 50:3c630b5eba9f 1021 // TMR3_COUNT_FLOWRATE++;
Lightvalve 50:3c630b5eba9f 1022 // if (TMR3_COUNT_FLOWRATE > temp_time) {
Lightvalve 50:3c630b5eba9f 1023 // if (flag_flowrate % 2 == 0) { // (+)
Lightvalve 50:3c630b5eba9f 1024 // VALVE_VOLTAGE = 1000.0f * (float) (flag_flowrate / 2 + 1);
Lightvalve 50:3c630b5eba9f 1025 // V_out = VALVE_VOLTAGE;
Lightvalve 50:3c630b5eba9f 1026 // if (pos.sen > (pos_minus_end + check_vel_pos_init) && pos.sen < (pos_minus_end + check_vel_pos_fin)) {
Lightvalve 50:3c630b5eba9f 1027 // fl_temp_cnt++;
Lightvalve 50:3c630b5eba9f 1028 // } else if (pos.sen >= (pos_minus_end + check_vel_pos_fin) && CUR_VELOCITY == 0) {
Lightvalve 50:3c630b5eba9f 1029 // VALVE_GAIN_LPM_PER_V[flag_flowrate] = 0.95873f * 0.5757f * (float) TMR_FREQ_5k / 10000.0 * (float) check_vel_pos_interv / (float) fl_temp_cnt / VALVE_VOLTAGE; // 0.9587=6*pi/65536*10000 0.5757=0.02525*0.02*0.0095*2*60*1000
Lightvalve 50:3c630b5eba9f 1030 // // VALVE_GAIN_LPM_PER_V[flag_flowrate] = (float) TMR_FREQ_10k * (float) check_vel_pos_interv / (float) fl_temp_cnt / VALVE_VOLTAGE; // PULSE/sec
Lightvalve 50:3c630b5eba9f 1031 // fl_temp_cnt2++;
Lightvalve 50:3c630b5eba9f 1032 // }
Lightvalve 50:3c630b5eba9f 1033 // } else if (flag_flowrate % 2 == 1) { // (-)
Lightvalve 50:3c630b5eba9f 1034 // VALVE_VOLTAGE = -1. * (float) (flag_flowrate / 2 + 1);
Lightvalve 50:3c630b5eba9f 1035 // V_out = VALVE_VOLTAGE;
Lightvalve 50:3c630b5eba9f 1036 // if (pos.sen < (pos_plus_end - check_vel_pos_init) && pos.sen > (pos_plus_end - check_vel_pos_fin)) {
Lightvalve 50:3c630b5eba9f 1037 // fl_temp_cnt++;
Lightvalve 50:3c630b5eba9f 1038 // } else if (pos.sen <= (pos_plus_end - check_vel_pos_fin) && CUR_VELOCITY == 0) {
Lightvalve 50:3c630b5eba9f 1039 // VALVE_GAIN_LPM_PER_V[flag_flowrate] = 0.95873f * 0.5757f * (float) TMR_FREQ_5k / 10000.0f * (float) check_vel_pos_interv / (float) fl_temp_cnt / (-VALVE_VOLTAGE);
Lightvalve 50:3c630b5eba9f 1040 // // VALVE_GAIN_LPM_PER_V[flag_flowrate] = (float) TMR_FREQ_10k * (float) check_vel_pos_interv / (float) fl_temp_cnt / (-VALVE_VOLTAGE); // PULSE/sec
Lightvalve 50:3c630b5eba9f 1041 // fl_temp_cnt2++;
Lightvalve 50:3c630b5eba9f 1042 // }
Lightvalve 50:3c630b5eba9f 1043 // }
Lightvalve 50:3c630b5eba9f 1044 // if (fl_temp_cnt2 == 100) {
Lightvalve 50:3c630b5eba9f 1045 //
Lightvalve 50:3c630b5eba9f 1046 // ROM_RESET_DATA();
Lightvalve 50:3c630b5eba9f 1047 //
Lightvalve 50:3c630b5eba9f 1048 // //spi_eeprom_write(RID_VALVE_GAIN_PLUS_1 + flag_flowrate, (int16_t) (VALVE_GAIN_LPM_PER_V[flag_flowrate] * 100.0f));
Lightvalve 50:3c630b5eba9f 1049 // cur_vel_sum = 0;
Lightvalve 50:3c630b5eba9f 1050 // fl_temp_cnt = 0;
Lightvalve 50:3c630b5eba9f 1051 // fl_temp_cnt2 = 0;
Lightvalve 50:3c630b5eba9f 1052 // flag_flowrate++;
Lightvalve 50:3c630b5eba9f 1053 // }
Lightvalve 50:3c630b5eba9f 1054 // if (flag_flowrate == 10) {
Lightvalve 50:3c630b5eba9f 1055 // V_out = 0;
Lightvalve 50:3c630b5eba9f 1056 // flag_flowrate = 0;
Lightvalve 50:3c630b5eba9f 1057 // TMR3_COUNT_FLOWRATE = 0;
Lightvalve 50:3c630b5eba9f 1058 // valve_gain_repeat_cnt++;
Lightvalve 50:3c630b5eba9f 1059 // if (valve_gain_repeat_cnt >= 1) {
Lightvalve 50:3c630b5eba9f 1060 // CONTROL_MODE = MODE_NO_ACT;
Lightvalve 50:3c630b5eba9f 1061 // valve_gain_repeat_cnt = 0;
Lightvalve 50:3c630b5eba9f 1062 // }
Lightvalve 50:3c630b5eba9f 1063 //
Lightvalve 50:3c630b5eba9f 1064 // }
Lightvalve 50:3c630b5eba9f 1065 // break;
Lightvalve 50:3c630b5eba9f 1066 // }
Lightvalve 50:3c630b5eba9f 1067 //
Lightvalve 50:3c630b5eba9f 1068 // }
Lightvalve 14:8e7590227d22 1069 case MODE_PRESSURE_SENSOR_NULLING: {
Lightvalve 13:747daba9cf59 1070 // DAC Voltage reference set
Lightvalve 14:8e7590227d22 1071 if (TMR3_COUNT_PRES_NULL < TMR_FREQ_5k * 2) {
Lightvalve 14:8e7590227d22 1072 CUR_PRES_A_sum += pres_A.sen;
Lightvalve 14:8e7590227d22 1073 CUR_PRES_B_sum += pres_B.sen;
Lightvalve 14:8e7590227d22 1074
Lightvalve 14:8e7590227d22 1075 if (TMR3_COUNT_PRES_NULL % 10 == 0) {
Lightvalve 30:8d561f16383b 1076 CUR_PRES_A_mean = CUR_PRES_A_sum / 10.0f;
Lightvalve 30:8d561f16383b 1077 CUR_PRES_B_mean = CUR_PRES_B_sum / 10.0f;
Lightvalve 13:747daba9cf59 1078 CUR_PRES_A_sum = 0;
Lightvalve 13:747daba9cf59 1079 CUR_PRES_B_sum = 0;
Lightvalve 14:8e7590227d22 1080
Lightvalve 38:118df027d851 1081 float VREF_NullingGain = 0.0003f;
Lightvalve 58:2eade98630e2 1082 PRES_A_VREF = PRES_A_VREF + VREF_NullingGain * CUR_PRES_A_mean;
Lightvalve 58:2eade98630e2 1083 PRES_B_VREF = PRES_B_VREF + VREF_NullingGain * CUR_PRES_B_mean;
Lightvalve 14:8e7590227d22 1084
Lightvalve 30:8d561f16383b 1085 if (PRES_A_VREF > 3.3f) PRES_A_VREF = 3.3f;
Lightvalve 30:8d561f16383b 1086 if (PRES_A_VREF < 0.0f) PRES_A_VREF = 0.0f;
Lightvalve 30:8d561f16383b 1087 if (PRES_B_VREF > 3.3f) PRES_B_VREF = 3.3f;
Lightvalve 30:8d561f16383b 1088 if (PRES_B_VREF < 0.0f) PRES_B_VREF = 0.0f;
Lightvalve 19:23b7c1ad8683 1089
Lightvalve 30:8d561f16383b 1090 dac_1 = PRES_A_VREF / 3.3f;
Lightvalve 30:8d561f16383b 1091 dac_2 = PRES_B_VREF / 3.3f;
Lightvalve 13:747daba9cf59 1092 }
Lightvalve 13:747daba9cf59 1093 } else {
Lightvalve 57:f4819de54e7a 1094 CONTROL_UTILITY_MODE = MODE_NO_ACT;
Lightvalve 14:8e7590227d22 1095 TMR3_COUNT_PRES_NULL = 0;
Lightvalve 13:747daba9cf59 1096 CUR_PRES_A_sum = 0;
Lightvalve 13:747daba9cf59 1097 CUR_PRES_B_sum = 0;
Lightvalve 13:747daba9cf59 1098 CUR_PRES_A_mean = 0;
Lightvalve 13:747daba9cf59 1099 CUR_PRES_B_mean = 0;
Lightvalve 14:8e7590227d22 1100
Lightvalve 16:903b5a4433b4 1101 ROM_RESET_DATA();
Lightvalve 19:23b7c1ad8683 1102
Lightvalve 30:8d561f16383b 1103 dac_1 = PRES_A_VREF / 3.3f;
Lightvalve 30:8d561f16383b 1104 dac_2 = PRES_B_VREF / 3.3f;
Lightvalve 17:1865016ca2e7 1105 //pc.printf("nulling end");
Lightvalve 13:747daba9cf59 1106 }
Lightvalve 14:8e7590227d22 1107 TMR3_COUNT_PRES_NULL++;
Lightvalve 13:747daba9cf59 1108 break;
Lightvalve 13:747daba9cf59 1109 }
Lightvalve 14:8e7590227d22 1110
Lightvalve 50:3c630b5eba9f 1111 // case MODE_PRESSURE_SENSOR_CALIB: {
Lightvalve 50:3c630b5eba9f 1112 // if (TMR3_COUNT_PRES_CALIB < 2 * TMR_FREQ_5k) {
Lightvalve 50:3c630b5eba9f 1113 // V_out = -VALVE_VOLTAGE_LIMIT * 1000.0f;
Lightvalve 50:3c630b5eba9f 1114 // if (TMR3_COUNT_PRES_CALIB >= TMR_FREQ_5k) {
Lightvalve 50:3c630b5eba9f 1115 // CUR_PRES_A_sum += CUR_PRES_A;
Lightvalve 50:3c630b5eba9f 1116 // }
Lightvalve 50:3c630b5eba9f 1117 // } else if (TMR3_COUNT_PRES_CALIB < 4 * TMR_FREQ_5k) {
Lightvalve 50:3c630b5eba9f 1118 // V_out = VALVE_VOLTAGE_LIMIT * 1000.0f;
Lightvalve 50:3c630b5eba9f 1119 // if (TMR3_COUNT_PRES_CALIB >= 3 * TMR_FREQ_5k) {
Lightvalve 50:3c630b5eba9f 1120 // CUR_PRES_B_sum += CUR_PRES_B;
Lightvalve 50:3c630b5eba9f 1121 // }
Lightvalve 50:3c630b5eba9f 1122 // } else {
Lightvalve 50:3c630b5eba9f 1123 // CONTROL_MODE = MODE_NO_ACT;
Lightvalve 50:3c630b5eba9f 1124 // TMR3_COUNT_PRES_CALIB = 0;
Lightvalve 50:3c630b5eba9f 1125 // V_out = 0;
Lightvalve 50:3c630b5eba9f 1126 // PRES_SENSOR_A_PULSE_PER_BAR = CUR_PRES_A_sum / ((float) TMR_FREQ_5k - 1.0f) - PRES_A_NULL;
Lightvalve 50:3c630b5eba9f 1127 // PRES_SENSOR_A_PULSE_PER_BAR = PRES_SENSOR_A_PULSE_PER_BAR / ((float) PRES_SUPPLY - 1.0f);
Lightvalve 50:3c630b5eba9f 1128 // PRES_SENSOR_B_PULSE_PER_BAR = CUR_PRES_B_sum / ((float) TMR_FREQ_5k - 1.0f) - PRES_B_NULL;
Lightvalve 50:3c630b5eba9f 1129 // PRES_SENSOR_B_PULSE_PER_BAR = PRES_SENSOR_B_PULSE_PER_BAR / ((float) PRES_SUPPLY - 1.0f);
Lightvalve 50:3c630b5eba9f 1130 // CUR_PRES_A_sum = 0;
Lightvalve 50:3c630b5eba9f 1131 // CUR_PRES_B_sum = 0;
Lightvalve 50:3c630b5eba9f 1132 // CUR_PRES_A_mean = 0;
Lightvalve 50:3c630b5eba9f 1133 // CUR_PRES_B_mean = 0;
Lightvalve 50:3c630b5eba9f 1134 //
Lightvalve 50:3c630b5eba9f 1135 // ROM_RESET_DATA();
Lightvalve 50:3c630b5eba9f 1136 //
Lightvalve 50:3c630b5eba9f 1137 // //spi_eeprom_write(RID_PRES_SENSOR_A_PULSE_PER_BAR, (int16_t) (PRES_SENSOR_A_PULSE_PER_BAR * 100.0f));
Lightvalve 50:3c630b5eba9f 1138 // //spi_eeprom_write(RID_PRES_SENSOR_B_PULSE_PER_BAR, (int16_t) (PRES_SENSOR_B_PULSE_PER_BAR * 100.0f));
Lightvalve 50:3c630b5eba9f 1139 // }
Lightvalve 50:3c630b5eba9f 1140 // TMR3_COUNT_PRES_CALIB++;
Lightvalve 50:3c630b5eba9f 1141 // break;
Lightvalve 50:3c630b5eba9f 1142 // }
Lightvalve 19:23b7c1ad8683 1143
Lightvalve 50:3c630b5eba9f 1144 // case MODE_ROTARY_FRICTION_TUNING: {
Lightvalve 50:3c630b5eba9f 1145 // if (TMR3_COUNT_ROTARY_FRIC_TUNE % (5 * TMR_FREQ_5k) == 0) freq_fric_tune = 4.0f + 3.0f * sin(2 * 3.14159f * 0.5f * TMR3_COUNT_ROTARY_FRIC_TUNE * 0.0001f * 0.05f);
Lightvalve 50:3c630b5eba9f 1146 // V_out = PWM_out * sin(2 * 3.14159f * freq_fric_tune * TMR3_COUNT_ROTARY_FRIC_TUNE * 0.0001f);
Lightvalve 50:3c630b5eba9f 1147 // if (V_out > 0) V_out = VALVE_VOLTAGE_LIMIT * 1000.0f;
Lightvalve 50:3c630b5eba9f 1148 // else V_out = -VALVE_VOLTAGE_LIMIT * 1000.0f;
Lightvalve 50:3c630b5eba9f 1149 // TMR3_COUNT_ROTARY_FRIC_TUNE++;
Lightvalve 50:3c630b5eba9f 1150 // if (TMR3_COUNT_ROTARY_FRIC_TUNE > TUNING_TIME * TMR_FREQ_5k) {
Lightvalve 50:3c630b5eba9f 1151 // TMR3_COUNT_ROTARY_FRIC_TUNE = 0;
Lightvalve 50:3c630b5eba9f 1152 // V_out = 0.0f;
Lightvalve 50:3c630b5eba9f 1153 // CONTROL_MODE = MODE_NO_ACT;
Lightvalve 50:3c630b5eba9f 1154 // }
Lightvalve 50:3c630b5eba9f 1155 // break;
Lightvalve 50:3c630b5eba9f 1156 // }
Lightvalve 14:8e7590227d22 1157
Lightvalve 14:8e7590227d22 1158 case MODE_DDV_POS_VS_PWM_ID: {
Lightvalve 59:f308b1656d9c 1159 CONTROL_MODE = MODE_VALVE_OPEN_LOOP;
Lightvalve 13:747daba9cf59 1160 VALVE_ID_timer = VALVE_ID_timer + 1;
Lightvalve 14:8e7590227d22 1161
Lightvalve 14:8e7590227d22 1162 if(VALVE_ID_timer < TMR_FREQ_5k*1) {
Lightvalve 60:64181f1d3e60 1163 Vout.ref = 3000.0f * sin(2.0f*3.14f*VALVE_ID_timer/TMR_FREQ_5k * 100.0f);
Lightvalve 14:8e7590227d22 1164 } else if(VALVE_ID_timer < TMR_FREQ_5k*2) {
Lightvalve 59:f308b1656d9c 1165 Vout.ref = 1000.0f*(ID_index_array[ID_index]);
Lightvalve 14:8e7590227d22 1166 } else if(VALVE_ID_timer == TMR_FREQ_5k*2) {
Lightvalve 13:747daba9cf59 1167 VALVE_POS_TMP = 0;
Lightvalve 13:747daba9cf59 1168 data_num = 0;
Lightvalve 14:8e7590227d22 1169 } else if(VALVE_ID_timer < TMR_FREQ_5k*3) {
Lightvalve 13:747daba9cf59 1170 data_num = data_num + 1;
Lightvalve 13:747daba9cf59 1171 VALVE_POS_TMP = VALVE_POS_TMP + value;
Lightvalve 14:8e7590227d22 1172 } else if(VALVE_ID_timer == TMR_FREQ_5k*3) {
Lightvalve 59:f308b1656d9c 1173 Vout.ref = 0.0f;
Lightvalve 59:f308b1656d9c 1174 } else {
Lightvalve 13:747daba9cf59 1175 VALVE_POS_AVG[ID_index] = VALVE_POS_TMP / data_num;
Lightvalve 13:747daba9cf59 1176 VALVE_ID_timer = 0;
Lightvalve 13:747daba9cf59 1177 ID_index= ID_index +1;
Lightvalve 13:747daba9cf59 1178 }
Lightvalve 14:8e7590227d22 1179
Lightvalve 17:1865016ca2e7 1180 if(ID_index>=25) {
Lightvalve 13:747daba9cf59 1181 int i;
Lightvalve 13:747daba9cf59 1182 VALVE_POS_AVG_OLD = VALVE_POS_AVG[0];
Lightvalve 17:1865016ca2e7 1183 for(i=0; i<25; i++) {
Lightvalve 13:747daba9cf59 1184 VALVE_POS_VS_PWM[i] = (int16_t) (VALVE_POS_AVG[i]);
Lightvalve 14:8e7590227d22 1185 if(VALVE_POS_AVG[i] > VALVE_POS_AVG_OLD) {
Lightvalve 13:747daba9cf59 1186 VALVE_MAX_POS = VALVE_POS_AVG[i];
Lightvalve 13:747daba9cf59 1187 VALVE_POS_AVG_OLD = VALVE_MAX_POS;
Lightvalve 14:8e7590227d22 1188 } else if(VALVE_POS_AVG[i] < VALVE_POS_AVG_OLD) {
Lightvalve 13:747daba9cf59 1189 VALVE_MIN_POS = VALVE_POS_AVG[i];
Lightvalve 13:747daba9cf59 1190 VALVE_POS_AVG_OLD = VALVE_MIN_POS;
Lightvalve 13:747daba9cf59 1191 }
Lightvalve 13:747daba9cf59 1192 }
Lightvalve 59:f308b1656d9c 1193 ROM_RESET_DATA();
Lightvalve 13:747daba9cf59 1194 ID_index = 0;
Lightvalve 57:f4819de54e7a 1195 CONTROL_UTILITY_MODE = MODE_NO_ACT;
Lightvalve 13:747daba9cf59 1196 }
Lightvalve 14:8e7590227d22 1197
Lightvalve 14:8e7590227d22 1198
Lightvalve 13:747daba9cf59 1199 break;
Lightvalve 13:747daba9cf59 1200 }
Lightvalve 14:8e7590227d22 1201
Lightvalve 14:8e7590227d22 1202 case MODE_DDV_DEADZONE_AND_CENTER: {
Lightvalve 59:f308b1656d9c 1203 CONTROL_MODE = MODE_VALVE_OPEN_LOOP;
Lightvalve 13:747daba9cf59 1204 VALVE_DZ_timer = VALVE_DZ_timer + 1;
Lightvalve 14:8e7590227d22 1205 if(first_check == 0) {
Lightvalve 30:8d561f16383b 1206 if(VALVE_DZ_timer < (int) (1.0f * (float) TMR_FREQ_5k)) {
Lightvalve 59:f308b1656d9c 1207 Vout.ref = VALVE_VOLTAGE_LIMIT * 1000.0f;
Lightvalve 30:8d561f16383b 1208 } else if(VALVE_DZ_timer == (int) (1.0f * (float) TMR_FREQ_5k)) {
Lightvalve 59:f308b1656d9c 1209 Vout.ref = VALVE_VOLTAGE_LIMIT * 1000.0f;
Lightvalve 14:8e7590227d22 1210 pos_plus_end = pos.sen;
Lightvalve 30:8d561f16383b 1211 } else if(VALVE_DZ_timer < (int) (2.0f * (float) TMR_FREQ_5k)) {
Lightvalve 59:f308b1656d9c 1212 Vout.ref = -VALVE_VOLTAGE_LIMIT * 1000.0f;
Lightvalve 30:8d561f16383b 1213 } else if(VALVE_DZ_timer == (int) (2.0f * (float) TMR_FREQ_5k)) {
Lightvalve 59:f308b1656d9c 1214 Vout.ref = -VALVE_VOLTAGE_LIMIT * 1000.0f;
Lightvalve 14:8e7590227d22 1215 pos_minus_end = pos.sen;
Lightvalve 30:8d561f16383b 1216 } else if(VALVE_DZ_timer < (int) (3.0f * (float) TMR_FREQ_5k)) {
Lightvalve 59:f308b1656d9c 1217 Vout.ref = (float) P_GAIN_JOINT_POSITION * (0.5f * (float) pos_plus_end + 0.5f * (float) pos_minus_end - (float) pos.sen)/(float) ENC_PULSE_PER_POSITION;
Lightvalve 30:8d561f16383b 1218 } else if(VALVE_DZ_timer < (int) (4.0f * (float) TMR_FREQ_5k)) {
Lightvalve 59:f308b1656d9c 1219 Vout.ref = (float) P_GAIN_JOINT_POSITION * (0.5f * (float) pos_plus_end + 0.5f * (float) pos_minus_end - (float) pos.sen)/(float) ENC_PULSE_PER_POSITION;
Lightvalve 13:747daba9cf59 1220 data_num = data_num + 1;
Lightvalve 13:747daba9cf59 1221 VALVE_POS_TMP = VALVE_POS_TMP + value;
Lightvalve 30:8d561f16383b 1222 } else if(VALVE_DZ_timer == (int) (4.0f * (float) TMR_FREQ_5k)) {
Lightvalve 59:f308b1656d9c 1223 Vout.ref = (float) P_GAIN_JOINT_POSITION * (0.5f * (float) pos_plus_end + 0.5f * (float) pos_minus_end - (float) pos.sen)/(float) ENC_PULSE_PER_POSITION;
Lightvalve 13:747daba9cf59 1224 DDV_POS_AVG = VALVE_POS_TMP / data_num;
Lightvalve 14:8e7590227d22 1225 START_POS = pos.sen;
Lightvalve 13:747daba9cf59 1226 VALVE_POS_TMP = 0;
Lightvalve 13:747daba9cf59 1227 data_num = 0;
Lightvalve 14:8e7590227d22 1228
Lightvalve 30:8d561f16383b 1229 } else if(VALVE_DZ_timer < (int) (5.0f * (float) TMR_FREQ_5k)) {
Lightvalve 14:8e7590227d22 1230 valve_pos.ref = DDV_POS_AVG;
Lightvalve 14:8e7590227d22 1231 VALVE_POS_CONTROL(valve_pos.ref);
Lightvalve 14:8e7590227d22 1232
Lightvalve 30:8d561f16383b 1233 } else if(VALVE_DZ_timer < (int) (6.0f * (float) TMR_FREQ_5k)) {
Lightvalve 14:8e7590227d22 1234 valve_pos.ref = DDV_POS_AVG;
Lightvalve 14:8e7590227d22 1235 VALVE_POS_CONTROL(valve_pos.ref);
Lightvalve 60:64181f1d3e60 1236
Lightvalve 30:8d561f16383b 1237 } else if(VALVE_DZ_timer == (int) (6.0f * (float) TMR_FREQ_5k)) {
Lightvalve 14:8e7590227d22 1238 valve_pos.ref = DDV_POS_AVG;
Lightvalve 14:8e7590227d22 1239 VALVE_POS_CONTROL(valve_pos.ref);
Lightvalve 14:8e7590227d22 1240 FINAL_POS = pos.sen;
Lightvalve 14:8e7590227d22 1241
Lightvalve 60:64181f1d3e60 1242 if((FINAL_POS - START_POS)>200) {
Lightvalve 13:747daba9cf59 1243 DZ_case = 1;
Lightvalve 60:64181f1d3e60 1244 } else if((FINAL_POS - START_POS)<-200) {
Lightvalve 13:747daba9cf59 1245 DZ_case = -1;
Lightvalve 14:8e7590227d22 1246 } else {
Lightvalve 13:747daba9cf59 1247 DZ_case = 0;
Lightvalve 13:747daba9cf59 1248 }
Lightvalve 61:bc8c8270f0ab 1249
Lightvalve 60:64181f1d3e60 1250 CAN_TX_PRES((int16_t) (DZ_case), (int16_t) (6));
Lightvalve 50:3c630b5eba9f 1251
Lightvalve 13:747daba9cf59 1252 first_check = 1;
Lightvalve 13:747daba9cf59 1253 DZ_DIRECTION = 1;
Lightvalve 13:747daba9cf59 1254 VALVE_DZ_timer = 0;
Lightvalve 13:747daba9cf59 1255 Ref_Valve_Pos_Old = DDV_POS_AVG;
Lightvalve 13:747daba9cf59 1256 DZ_NUM = 1;
Lightvalve 13:747daba9cf59 1257 DZ_index = 1;
Lightvalve 14:8e7590227d22 1258
Lightvalve 13:747daba9cf59 1259 }
Lightvalve 19:23b7c1ad8683 1260 } else {
Lightvalve 14:8e7590227d22 1261 if((DZ_case == -1 && DZ_NUM == 1) | (DZ_case == 1 && DZ_NUM == 1)) {
Lightvalve 30:8d561f16383b 1262 if(VALVE_DZ_timer < (int) (1.0 * (float) TMR_FREQ_5k)) {
Lightvalve 60:64181f1d3e60 1263 Vout.ref = (float) P_GAIN_JOINT_POSITION * (0.5f * (float) pos_plus_end + 0.5f * (float) pos_minus_end - (float) pos.sen)/(float) ENC_PULSE_PER_POSITION;
Lightvalve 60:64181f1d3e60 1264 //pos.ref = 0.5f * (float) pos_plus_end + 0.5f * (float) pos_minus_end;
Lightvalve 60:64181f1d3e60 1265 //CONTROL_MODE = MODE_JOINT_CONTROL;
Lightvalve 30:8d561f16383b 1266 } else if(VALVE_DZ_timer == (int) (1.0f * (float) TMR_FREQ_5k)) {
Lightvalve 14:8e7590227d22 1267 START_POS = pos.sen;
Lightvalve 30:8d561f16383b 1268 } else if(VALVE_DZ_timer < (int) (2.0f * (float) TMR_FREQ_5k)) {
Lightvalve 14:8e7590227d22 1269 valve_pos.ref = Ref_Valve_Pos_Old - DZ_case * DZ_DIRECTION * 64 / DZ_index;
Lightvalve 14:8e7590227d22 1270 if(valve_pos.ref <= VALVE_MIN_POS) {
Lightvalve 14:8e7590227d22 1271 valve_pos.ref = VALVE_MIN_POS;
Lightvalve 14:8e7590227d22 1272 } else if(valve_pos.ref >= VALVE_MAX_POS) {
Lightvalve 14:8e7590227d22 1273 valve_pos.ref = VALVE_MAX_POS;
Lightvalve 13:747daba9cf59 1274 }
Lightvalve 14:8e7590227d22 1275 VALVE_POS_CONTROL(valve_pos.ref);
Lightvalve 60:64181f1d3e60 1276
Lightvalve 30:8d561f16383b 1277 } else if(VALVE_DZ_timer == (int) (2.0f * (float) TMR_FREQ_5k)) {
Lightvalve 14:8e7590227d22 1278 Ref_Valve_Pos_Old = valve_pos.ref;
Lightvalve 14:8e7590227d22 1279 FINAL_POS = pos.sen;
Lightvalve 14:8e7590227d22 1280
Lightvalve 14:8e7590227d22 1281 if((FINAL_POS - START_POS)>100) {
Lightvalve 14:8e7590227d22 1282 DZ_DIRECTION = 1 * DZ_case;
Lightvalve 14:8e7590227d22 1283 } else if((FINAL_POS - START_POS)<-100) {
Lightvalve 14:8e7590227d22 1284 DZ_DIRECTION = -1 * DZ_case;
Lightvalve 14:8e7590227d22 1285 } else {
Lightvalve 13:747daba9cf59 1286 DZ_DIRECTION = 1 * DZ_case;
Lightvalve 13:747daba9cf59 1287 }
Lightvalve 14:8e7590227d22 1288
Lightvalve 13:747daba9cf59 1289 VALVE_DZ_timer = 0;
Lightvalve 13:747daba9cf59 1290 DZ_index= DZ_index *2;
Lightvalve 14:8e7590227d22 1291 if(DZ_index >= 128) {
Lightvalve 14:8e7590227d22 1292 FIRST_DZ = valve_pos.ref;
Lightvalve 13:747daba9cf59 1293 DZ_NUM = 2;
Lightvalve 13:747daba9cf59 1294 Ref_Valve_Pos_Old = FIRST_DZ;
Lightvalve 13:747daba9cf59 1295 DZ_index = 1;
Lightvalve 13:747daba9cf59 1296 DZ_DIRECTION = 1;
Lightvalve 13:747daba9cf59 1297 }
Lightvalve 13:747daba9cf59 1298 }
Lightvalve 14:8e7590227d22 1299 } else if((DZ_case == -1 && DZ_NUM == 2) | (DZ_case == 1 && DZ_NUM == 2)) {
Lightvalve 30:8d561f16383b 1300 if(VALVE_DZ_timer < (int) (1.0f * (float) TMR_FREQ_5k)) {
Lightvalve 60:64181f1d3e60 1301 Vout.ref = (float) P_GAIN_JOINT_POSITION * (0.5f * (float) pos_plus_end + 0.5f * (float) pos_minus_end - (float) pos.sen)/(float) ENC_PULSE_PER_POSITION;
Lightvalve 60:64181f1d3e60 1302 //pos.ref = 0.5f * (float) pos_plus_end + 0.5f * (float) pos_minus_end;
Lightvalve 60:64181f1d3e60 1303 //CONTROL_MODE = MODE_JOINT_CONTROL;
Lightvalve 30:8d561f16383b 1304 } else if(VALVE_DZ_timer == (int) (1.0f * (float) TMR_FREQ_5k)) {
Lightvalve 14:8e7590227d22 1305 START_POS = pos.sen;
Lightvalve 30:8d561f16383b 1306 } else if(VALVE_DZ_timer < (int) (2.0f * (float) TMR_FREQ_5k)) {
Lightvalve 60:64181f1d3e60 1307 valve_pos.ref = Ref_Valve_Pos_Old - DZ_case * DZ_DIRECTION * 64 / DZ_index;
Lightvalve 14:8e7590227d22 1308 if(valve_pos.ref <= VALVE_MIN_POS) {
Lightvalve 14:8e7590227d22 1309 valve_pos.ref = VALVE_MIN_POS;
Lightvalve 14:8e7590227d22 1310 } else if(valve_pos.ref >= VALVE_MAX_POS) {
Lightvalve 14:8e7590227d22 1311 valve_pos.ref = VALVE_MAX_POS;
Lightvalve 13:747daba9cf59 1312 }
Lightvalve 14:8e7590227d22 1313 VALVE_POS_CONTROL(valve_pos.ref);
Lightvalve 61:bc8c8270f0ab 1314
Lightvalve 30:8d561f16383b 1315 } else if(VALVE_DZ_timer == (int) (2.0f * (float) TMR_FREQ_5k)) {
Lightvalve 59:f308b1656d9c 1316 Vout.ref = 0.0f;
Lightvalve 59:f308b1656d9c 1317 } else if(VALVE_DZ_timer > (int) (2.0f * (float) TMR_FREQ_5k)) {
Lightvalve 14:8e7590227d22 1318 Ref_Valve_Pos_Old = valve_pos.ref;
Lightvalve 14:8e7590227d22 1319 FINAL_POS = pos.sen;
Lightvalve 14:8e7590227d22 1320
Lightvalve 14:8e7590227d22 1321 if((FINAL_POS - START_POS)>100) {
Lightvalve 60:64181f1d3e60 1322 DZ_DIRECTION = 1 * DZ_case;
Lightvalve 14:8e7590227d22 1323 } else if((FINAL_POS - START_POS)<-100) {
Lightvalve 60:64181f1d3e60 1324 DZ_DIRECTION = -1 * DZ_case;
Lightvalve 14:8e7590227d22 1325 } else {
Lightvalve 60:64181f1d3e60 1326 DZ_DIRECTION = -1 * DZ_case;
Lightvalve 13:747daba9cf59 1327 }
Lightvalve 14:8e7590227d22 1328
Lightvalve 13:747daba9cf59 1329 VALVE_DZ_timer = 0;
Lightvalve 60:64181f1d3e60 1330 DZ_index= DZ_index * 2;
Lightvalve 14:8e7590227d22 1331 if(DZ_index >= 128) {
Lightvalve 14:8e7590227d22 1332 SECOND_DZ = valve_pos.ref;
Lightvalve 57:f4819de54e7a 1333 VALVE_CENTER = (int) (0.5f * (float) (FIRST_DZ) + 0.5f * (float) (SECOND_DZ));
Lightvalve 13:747daba9cf59 1334 first_check = 0;
Lightvalve 33:91b17819ec30 1335 VALVE_DEADZONE_MINUS = (float) FIRST_DZ;
Lightvalve 33:91b17819ec30 1336 VALVE_DEADZONE_PLUS = (float) SECOND_DZ;
Lightvalve 19:23b7c1ad8683 1337
Lightvalve 16:903b5a4433b4 1338 ROM_RESET_DATA();
Lightvalve 34:bb2ca2fc2a8e 1339
Lightvalve 60:64181f1d3e60 1340 CONTROL_UTILITY_MODE = MODE_NO_ACT;
Lightvalve 13:747daba9cf59 1341 DZ_index = 1;
Lightvalve 13:747daba9cf59 1342 }
Lightvalve 13:747daba9cf59 1343 }
Lightvalve 14:8e7590227d22 1344 } else if(DZ_case == 0 && DZ_NUM ==1) {
Lightvalve 30:8d561f16383b 1345 if(VALVE_DZ_timer < (int) (1.0f * (float) TMR_FREQ_5k)) {
Lightvalve 60:64181f1d3e60 1346 Vout.ref = (float) P_GAIN_JOINT_POSITION * (0.5f * (float) pos_plus_end + 0.5f * (float) pos_minus_end - (float) pos.sen)/(float) ENC_PULSE_PER_POSITION;
Lightvalve 60:64181f1d3e60 1347 //pos.ref = 0.5f * (float) pos_plus_end + 0.5f * (float) pos_minus_end;
Lightvalve 60:64181f1d3e60 1348 //CONTROL_MODE = MODE_JOINT_CONTROL;
Lightvalve 30:8d561f16383b 1349 } else if(VALVE_DZ_timer == (int) (1.0f * (float) TMR_FREQ_5k)) {
Lightvalve 14:8e7590227d22 1350 START_POS = pos.sen;
Lightvalve 30:8d561f16383b 1351 } else if(VALVE_DZ_timer < (int) (2.0f * (float) TMR_FREQ_5k)) {
Lightvalve 14:8e7590227d22 1352 valve_pos.ref = Ref_Valve_Pos_Old - DZ_DIRECTION * 64 / DZ_index;
Lightvalve 14:8e7590227d22 1353 if(valve_pos.ref <= VALVE_MIN_POS) {
Lightvalve 14:8e7590227d22 1354 valve_pos.ref = VALVE_MIN_POS;
Lightvalve 14:8e7590227d22 1355 } else if(valve_pos.ref >= VALVE_MAX_POS) {
Lightvalve 14:8e7590227d22 1356 valve_pos.ref = VALVE_MAX_POS;
Lightvalve 13:747daba9cf59 1357 }
Lightvalve 14:8e7590227d22 1358 VALVE_POS_CONTROL(valve_pos.ref);
Lightvalve 61:bc8c8270f0ab 1359
Lightvalve 30:8d561f16383b 1360 } else if(VALVE_DZ_timer == (int) (2.0f * (float) TMR_FREQ_5k)) {
Lightvalve 14:8e7590227d22 1361 Ref_Valve_Pos_Old = valve_pos.ref;
Lightvalve 14:8e7590227d22 1362 FINAL_POS = pos.sen;
Lightvalve 14:8e7590227d22 1363
Lightvalve 14:8e7590227d22 1364 if((FINAL_POS - START_POS)>100) {
Lightvalve 14:8e7590227d22 1365 DZ_DIRECTION = 1;
Lightvalve 14:8e7590227d22 1366 } else if((FINAL_POS - START_POS)<-100) {
Lightvalve 14:8e7590227d22 1367 DZ_DIRECTION = -1;
Lightvalve 14:8e7590227d22 1368 } else {
Lightvalve 13:747daba9cf59 1369 DZ_DIRECTION = 1;
Lightvalve 13:747daba9cf59 1370 }
Lightvalve 13:747daba9cf59 1371 VALVE_DZ_timer = 0;
Lightvalve 13:747daba9cf59 1372 DZ_index= DZ_index *2;
Lightvalve 14:8e7590227d22 1373 if(DZ_index >= 128) {
Lightvalve 14:8e7590227d22 1374 FIRST_DZ = valve_pos.ref;
Lightvalve 13:747daba9cf59 1375 DZ_NUM = 2;
Lightvalve 13:747daba9cf59 1376 Ref_Valve_Pos_Old = FIRST_DZ;
Lightvalve 13:747daba9cf59 1377 DZ_index = 1;
Lightvalve 13:747daba9cf59 1378 DZ_DIRECTION = 1;
Lightvalve 13:747daba9cf59 1379 }
Lightvalve 13:747daba9cf59 1380 }
Lightvalve 14:8e7590227d22 1381 } else {
Lightvalve 30:8d561f16383b 1382 if(VALVE_DZ_timer < (int) (1.0f * (float) TMR_FREQ_5k)) {
Lightvalve 60:64181f1d3e60 1383 Vout.ref = (float) P_GAIN_JOINT_POSITION * (0.5f * (float) pos_plus_end + 0.5f * (float) pos_minus_end - (float) pos.sen)/(float) ENC_PULSE_PER_POSITION;
Lightvalve 60:64181f1d3e60 1384 //pos.ref = 0.5f * (float) pos_plus_end + 0.5f * (float) pos_minus_end;
Lightvalve 60:64181f1d3e60 1385 //CONTROL_MODE = MODE_JOINT_CONTROL;
Lightvalve 30:8d561f16383b 1386 } else if(VALVE_DZ_timer == (int) (1.0f * (float) TMR_FREQ_5k)) {
Lightvalve 14:8e7590227d22 1387 START_POS = pos.sen;
Lightvalve 30:8d561f16383b 1388 } else if(VALVE_DZ_timer < (int) (2.0f * (float) TMR_FREQ_5k)) {
Lightvalve 14:8e7590227d22 1389 valve_pos.ref = Ref_Valve_Pos_Old + DZ_DIRECTION * 64 / DZ_index;
Lightvalve 14:8e7590227d22 1390 if(valve_pos.ref <= VALVE_MIN_POS) {
Lightvalve 14:8e7590227d22 1391 valve_pos.ref = VALVE_MIN_POS;
Lightvalve 14:8e7590227d22 1392 } else if(valve_pos.ref > VALVE_MAX_POS) {
Lightvalve 14:8e7590227d22 1393 valve_pos.ref = VALVE_MAX_POS - 1;
Lightvalve 13:747daba9cf59 1394 }
Lightvalve 14:8e7590227d22 1395 VALVE_POS_CONTROL(valve_pos.ref);
Lightvalve 60:64181f1d3e60 1396
Lightvalve 30:8d561f16383b 1397 } else if(VALVE_DZ_timer == (int) (2.0f * (float) TMR_FREQ_5k)) {
Lightvalve 59:f308b1656d9c 1398 Vout.ref = 0.0f;
Lightvalve 59:f308b1656d9c 1399 } else if(VALVE_DZ_timer > (int) (2.0f * (float) TMR_FREQ_5k)) {
Lightvalve 14:8e7590227d22 1400 Ref_Valve_Pos_Old = valve_pos.ref;
Lightvalve 14:8e7590227d22 1401 FINAL_POS = pos.sen;
Lightvalve 61:bc8c8270f0ab 1402
Lightvalve 60:64181f1d3e60 1403 if((FINAL_POS - START_POS)>100) {
Lightvalve 13:747daba9cf59 1404 DZ_DIRECTION = 1;
Lightvalve 60:64181f1d3e60 1405 } else if((FINAL_POS - START_POS)<-100) {
Lightvalve 60:64181f1d3e60 1406 DZ_DIRECTION = -1;
Lightvalve 60:64181f1d3e60 1407 } else {
Lightvalve 13:747daba9cf59 1408 DZ_DIRECTION = 1;
Lightvalve 60:64181f1d3e60 1409 }
Lightvalve 14:8e7590227d22 1410
Lightvalve 13:747daba9cf59 1411 VALVE_DZ_timer = 0;
Lightvalve 13:747daba9cf59 1412 DZ_index= DZ_index *2;
Lightvalve 14:8e7590227d22 1413 if(DZ_index >= 128) {
Lightvalve 14:8e7590227d22 1414 SECOND_DZ = valve_pos.ref;
Lightvalve 57:f4819de54e7a 1415 VALVE_CENTER = (int) (0.5f * (float) (FIRST_DZ) + 0.5f * (float) (SECOND_DZ));
Lightvalve 13:747daba9cf59 1416 first_check = 0;
Lightvalve 33:91b17819ec30 1417 VALVE_DEADZONE_MINUS = (float) FIRST_DZ;
Lightvalve 33:91b17819ec30 1418 VALVE_DEADZONE_PLUS = (float) SECOND_DZ;
Lightvalve 61:bc8c8270f0ab 1419
Lightvalve 59:f308b1656d9c 1420 ROM_RESET_DATA();
Lightvalve 34:bb2ca2fc2a8e 1421
Lightvalve 57:f4819de54e7a 1422 CONTROL_UTILITY_MODE = MODE_NO_ACT;
Lightvalve 13:747daba9cf59 1423 DZ_index = 1;
Lightvalve 13:747daba9cf59 1424 }
Lightvalve 13:747daba9cf59 1425 }
Lightvalve 13:747daba9cf59 1426 }
Lightvalve 14:8e7590227d22 1427 }
Lightvalve 13:747daba9cf59 1428 break;
Lightvalve 13:747daba9cf59 1429 }
Lightvalve 14:8e7590227d22 1430
Lightvalve 14:8e7590227d22 1431 case MODE_DDV_POS_VS_FLOWRATE: {
Lightvalve 59:f308b1656d9c 1432 CONTROL_MODE = MODE_VALVE_OPEN_LOOP;
Lightvalve 13:747daba9cf59 1433 VALVE_FR_timer = VALVE_FR_timer + 1;
Lightvalve 14:8e7590227d22 1434 if(first_check == 0) {
Lightvalve 30:8d561f16383b 1435 if(VALVE_FR_timer < (int) (1.0f * (float) TMR_FREQ_5k)) {
Lightvalve 59:f308b1656d9c 1436 Vout.ref = VALVE_VOLTAGE_LIMIT * 1000.0f;
Lightvalve 23:59218d4a256d 1437 //CAN_TX_PRES((int16_t) (VALVE_FR_timer), (int16_t) (6));
Lightvalve 30:8d561f16383b 1438 } else if(VALVE_FR_timer == (int) (1.0f * (float) TMR_FREQ_5k)) {
Lightvalve 59:f308b1656d9c 1439 Vout.ref = VALVE_VOLTAGE_LIMIT * 1000.0f;
Lightvalve 14:8e7590227d22 1440 pos_plus_end = pos.sen;
Lightvalve 14:8e7590227d22 1441 // CAN_TX_PRES((int16_t) (V_out), (int16_t) (7));
Lightvalve 30:8d561f16383b 1442 } else if(VALVE_FR_timer < (int) (2.0f * (float) TMR_FREQ_5k)) {
Lightvalve 59:f308b1656d9c 1443 Vout.ref = -VALVE_VOLTAGE_LIMIT * 1000.0f;
Lightvalve 30:8d561f16383b 1444 } else if(VALVE_FR_timer == (int) (2.0f * (float) TMR_FREQ_5k)) {
Lightvalve 14:8e7590227d22 1445 // CAN_TX_PRES((int16_t) (V_out), (int16_t) (8));
Lightvalve 59:f308b1656d9c 1446 Vout.ref = -VALVE_VOLTAGE_LIMIT * 1000.0f;
Lightvalve 14:8e7590227d22 1447 pos_minus_end = pos.sen;
Lightvalve 13:747daba9cf59 1448 first_check = 1;
Lightvalve 13:747daba9cf59 1449 VALVE_FR_timer = 0;
Lightvalve 57:f4819de54e7a 1450 valve_pos.ref = (float) VALVE_CENTER;
Lightvalve 13:747daba9cf59 1451 ID_index = 0;
Lightvalve 13:747daba9cf59 1452 max_check = 0;
Lightvalve 13:747daba9cf59 1453 min_check = 0;
Lightvalve 13:747daba9cf59 1454 }
Lightvalve 14:8e7590227d22 1455 } else {
Lightvalve 30:8d561f16383b 1456 if(VALVE_FR_timer < (int) (1.0f * (float) TMR_FREQ_5k)) {
Lightvalve 59:f308b1656d9c 1457 //V_out = (float) P_GAIN_JOINT_POSITION * (0.5f * (float) pos_plus_end + 0.5f * (float) pos_minus_end - (float) pos.sen)/(float) ENC_PULSE_PER_POSITION;
Lightvalve 59:f308b1656d9c 1458 pos.ref = 0.5f * (float) pos_plus_end + 0.5f * (float) pos_minus_end;
Lightvalve 59:f308b1656d9c 1459 CONTROL_MODE = MODE_JOINT_CONTROL;
Lightvalve 30:8d561f16383b 1460 } else if(VALVE_FR_timer == (int) (1.0f * (float) TMR_FREQ_5k)) {
Lightvalve 13:747daba9cf59 1461 data_num = 0;
Lightvalve 57:f4819de54e7a 1462 valve_pos.ref = 10.0f*((float) ID_index_array[ID_index]) + (float) VALVE_CENTER;
Lightvalve 14:8e7590227d22 1463
Lightvalve 14:8e7590227d22 1464 VALVE_POS_CONTROL(valve_pos.ref);
Lightvalve 14:8e7590227d22 1465 START_POS = pos.sen;
Lightvalve 30:8d561f16383b 1466 } else if(VALVE_FR_timer < (int) (5.0f * (float) TMR_FREQ_5k)) {
Lightvalve 57:f4819de54e7a 1467 valve_pos.ref = 10.0f*((float) ID_index_array[ID_index]) + (float) VALVE_CENTER;
Lightvalve 14:8e7590227d22 1468 VALVE_POS_CONTROL(valve_pos.ref);
Lightvalve 13:747daba9cf59 1469 data_num = data_num + 1;
Lightvalve 30:8d561f16383b 1470 if(abs(0.5f * (float) pos_plus_end + 0.5f * (float) pos_minus_end - (float) pos.sen) > 20000.0f) {
Lightvalve 14:8e7590227d22 1471 FINAL_POS = pos.sen;
Lightvalve 14:8e7590227d22 1472 one_period_end = 1;
Lightvalve 13:747daba9cf59 1473 }
Lightvalve 30:8d561f16383b 1474 } else if(VALVE_FR_timer == (int) (5.0f * (float) TMR_FREQ_5k)) {
Lightvalve 14:8e7590227d22 1475 FINAL_POS = pos.sen;
Lightvalve 13:747daba9cf59 1476 one_period_end = 1;
Lightvalve 59:f308b1656d9c 1477 V_out = 0.0f;
Lightvalve 13:747daba9cf59 1478 }
Lightvalve 14:8e7590227d22 1479
Lightvalve 14:8e7590227d22 1480 if(one_period_end == 1) {
Lightvalve 14:8e7590227d22 1481 if(valve_pos.ref > VALVE_MAX_POS) {
Lightvalve 13:747daba9cf59 1482 max_check = 1;
Lightvalve 14:8e7590227d22 1483 } else if(valve_pos.ref < VALVE_MIN_POS) {
Lightvalve 13:747daba9cf59 1484 min_check = 1;
Lightvalve 13:747daba9cf59 1485 }
Lightvalve 13:747daba9cf59 1486 JOINT_VEL[ID_index] = (FINAL_POS - START_POS) / data_num * TMR_FREQ_5k; // pulse/sec
Lightvalve 19:23b7c1ad8683 1487
Lightvalve 13:747daba9cf59 1488 VALVE_FR_timer = 0;
Lightvalve 13:747daba9cf59 1489 one_period_end = 0;
Lightvalve 13:747daba9cf59 1490 ID_index= ID_index +1;
Lightvalve 30:8d561f16383b 1491 V_out = 0.0f;
Lightvalve 13:747daba9cf59 1492 }
Lightvalve 14:8e7590227d22 1493
Lightvalve 14:8e7590227d22 1494 if(max_check == 1 && min_check == 1) {
Lightvalve 19:23b7c1ad8683 1495
Lightvalve 13:747daba9cf59 1496 VALVE_POS_NUM = ID_index;
Lightvalve 59:f308b1656d9c 1497 ROM_RESET_DATA();
Lightvalve 13:747daba9cf59 1498 ID_index = 0;
Lightvalve 13:747daba9cf59 1499 first_check = 0;
Lightvalve 13:747daba9cf59 1500 VALVE_FR_timer = 0;
Lightvalve 57:f4819de54e7a 1501 CONTROL_UTILITY_MODE = MODE_NO_ACT;
Lightvalve 49:e7bcfc244d40 1502 // CAN_TX_PRES((int16_t) (VALVE_FR_timer), (int16_t) (6));
Lightvalve 13:747daba9cf59 1503 }
Lightvalve 13:747daba9cf59 1504 }
Lightvalve 13:747daba9cf59 1505 break;
Lightvalve 13:747daba9cf59 1506 }
Lightvalve 58:2eade98630e2 1507
Lightvalve 57:f4819de54e7a 1508 case MODE_SYSTEM_ID: {
Lightvalve 57:f4819de54e7a 1509 freq_sysid_Iref = (double) cnt_sysid * DT_TMR3 * 3.;
Lightvalve 57:f4819de54e7a 1510 valve_pos.ref = 2500.0f * sin(2.0f * 3.14159f * freq_sysid_Iref * (double) cnt_sysid * DT_TMR3);
Lightvalve 57:f4819de54e7a 1511 CONTROL_MODE = MODE_VALVE_OPEN_LOOP;
Lightvalve 57:f4819de54e7a 1512 cnt_sysid++;
Lightvalve 57:f4819de54e7a 1513 if (freq_sysid_Iref >= 300) {
Lightvalve 57:f4819de54e7a 1514 cnt_sysid = 0;
Lightvalve 57:f4819de54e7a 1515 CONTROL_UTILITY_MODE = MODE_NO_ACT;
Lightvalve 57:f4819de54e7a 1516 }
Lightvalve 57:f4819de54e7a 1517 break;
Lightvalve 57:f4819de54e7a 1518 }
Lightvalve 58:2eade98630e2 1519
Lightvalve 58:2eade98630e2 1520
Lightvalve 57:f4819de54e7a 1521
Lightvalve 57:f4819de54e7a 1522 default:
Lightvalve 57:f4819de54e7a 1523 break;
Lightvalve 57:f4819de54e7a 1524 }
Lightvalve 57:f4819de54e7a 1525
Lightvalve 57:f4819de54e7a 1526 // CONTROL MODE ------------------------------------------------------------
Lightvalve 57:f4819de54e7a 1527
Lightvalve 57:f4819de54e7a 1528 switch (CONTROL_MODE) {
Lightvalve 57:f4819de54e7a 1529 case MODE_NO_ACT: {
Lightvalve 57:f4819de54e7a 1530 V_out = 0.0f;
Lightvalve 57:f4819de54e7a 1531 break;
Lightvalve 57:f4819de54e7a 1532 }
Lightvalve 57:f4819de54e7a 1533
Lightvalve 57:f4819de54e7a 1534 case MODE_VALVE_POSITION_CONTROL: {
Lightvalve 57:f4819de54e7a 1535 if (((OPERATING_MODE&0b110)>>1) == 0) { //Moog Valve
Lightvalve 57:f4819de54e7a 1536 I_REF = valve_pos.ref;
Lightvalve 57:f4819de54e7a 1537 } else if (((OPERATING_MODE&0b110)>>1) == 1) { //KNR Valve
Lightvalve 57:f4819de54e7a 1538 V_out = valve_pos.ref;
Lightvalve 57:f4819de54e7a 1539 } else { //SW Valve
Lightvalve 57:f4819de54e7a 1540 VALVE_POS_CONTROL(valve_pos.ref);
Lightvalve 59:f308b1656d9c 1541 V_out = Vout.ref;
Lightvalve 57:f4819de54e7a 1542 }
Lightvalve 58:2eade98630e2 1543
Lightvalve 57:f4819de54e7a 1544 break;
Lightvalve 57:f4819de54e7a 1545 }
Lightvalve 57:f4819de54e7a 1546
Lightvalve 57:f4819de54e7a 1547 case MODE_JOINT_CONTROL: {
Lightvalve 57:f4819de54e7a 1548 double torq_ref = 0.0f;
Lightvalve 57:f4819de54e7a 1549 pos.err = (pos.ref - pos.sen)/(float)(ENC_PULSE_PER_POSITION); //[mm]
Lightvalve 57:f4819de54e7a 1550 vel.err = (vel.ref - vel.sen)/(float)(ENC_PULSE_PER_POSITION); //[mm/s]
Lightvalve 57:f4819de54e7a 1551 pos.err_sum += pos.err/(float) TMR_FREQ_5k; //[mm]
Lightvalve 57:f4819de54e7a 1552 torq_ref = torq.ref + (K_SPRING * pos.err * 0.01f + D_DAMPER * vel.err * 0.0001f) / ENC_PULSE_PER_POSITION; //[N]
Lightvalve 57:f4819de54e7a 1553
Lightvalve 57:f4819de54e7a 1554 // torque feedback
Lightvalve 58:2eade98630e2 1555 torq.err = (torq_ref)/(float)(TORQUE_SENSOR_PULSE_PER_TORQUE) - torq.sen; //[N]
Lightvalve 57:f4819de54e7a 1556 torq.err_sum += torq.err/(float) TMR_FREQ_5k; //[N]
Lightvalve 57:f4819de54e7a 1557
Lightvalve 57:f4819de54e7a 1558 if (((OPERATING_MODE&0b110)>>1) == 0 || ((OPERATING_MODE&0b110)>>1) == 1) {
Lightvalve 58:2eade98630e2 1559
Lightvalve 57:f4819de54e7a 1560 double I_REF_POS = 0.0f;
Lightvalve 57:f4819de54e7a 1561 double I_REF_FORCE_FB = 0.0f; // I_REF by Force Feedback
Lightvalve 57:f4819de54e7a 1562 double I_REF_VC = 0.0f; // I_REF for velocity compensation
Lightvalve 57:f4819de54e7a 1563
Lightvalve 57:f4819de54e7a 1564 double temp_vel_pos = 0.0f;
Lightvalve 57:f4819de54e7a 1565 double temp_vel_torq = 0.0f;
Lightvalve 57:f4819de54e7a 1566 double wn_Pos = 2.0f * PI * 5.0f; // f_cut : 5Hz Position Control
Lightvalve 58:2eade98630e2 1567
Lightvalve 57:f4819de54e7a 1568 if ((OPERATING_MODE && 0x01) == 0) { // Rotary Mode
Lightvalve 57:f4819de54e7a 1569 temp_vel_pos = (0.01f * (double) P_GAIN_JOINT_POSITION * wn_Pos * pos.err + 0.01f * (double) I_GAIN_JOINT_POSITION * wn_Pos * pos.err_sum + 0.01f * (double) VELOCITY_COMP_GAIN * vel.ref / ENC_PULSE_PER_POSITION) * PI / 180.0f; // rad/s
Lightvalve 57:f4819de54e7a 1570 // L when P-gain = 100, f_cut = 10Hz L feedforward velocity
Lightvalve 57:f4819de54e7a 1571 } else if ((OPERATING_MODE && 0x01) == 1) {
Lightvalve 57:f4819de54e7a 1572 temp_vel_pos = (0.01f * (double) P_GAIN_JOINT_POSITION * wn_Pos * pos.err + 0.01f * (double) I_GAIN_JOINT_POSITION * wn_Pos * pos.err_sum + 0.01f * (double) VELOCITY_COMP_GAIN * vel.ref / ENC_PULSE_PER_POSITION); // mm/s
Lightvalve 57:f4819de54e7a 1573 // L when P-gain = 100, f_cut = 10Hz L feedforward velocity
Lightvalve 57:f4819de54e7a 1574 }
Lightvalve 57:f4819de54e7a 1575 if (temp_vel_pos > 0.0f) I_REF_POS = temp_vel_pos * ((double) PISTON_AREA_A * 0.00006f / (K_v * sqrt(2.0f * alpha3 / (alpha3 + 1.0f))));
Lightvalve 57:f4819de54e7a 1576 else I_REF_POS = temp_vel_pos * ((double) PISTON_AREA_B * 0.00006f / (K_v * sqrt(2.0f / (alpha3 + 1.0f))));
Lightvalve 57:f4819de54e7a 1577
Lightvalve 57:f4819de54e7a 1578 // velocity compensation for torque control
Lightvalve 57:f4819de54e7a 1579 if ((OPERATING_MODE && 0x01) == 0) { // Rotary Mode
Lightvalve 57:f4819de54e7a 1580 I_REF_FORCE_FB = 0.001f * ((double) P_GAIN_JOINT_TORQUE * torq.err + (double) I_GAIN_JOINT_TORQUE * torq.err_sum);
Lightvalve 57:f4819de54e7a 1581 // temp_vel_torq = (0.01 * (double) VELOCITY_COMP_GAIN * (double) CUR_VELOCITY / (double) ENC_PULSE_PER_POSITION) * PI / 180.0; // rad/s
Lightvalve 57:f4819de54e7a 1582 temp_vel_torq = (0.01f * (double) VELOCITY_COMP_GAIN * vel.ref / (double) ENC_PULSE_PER_POSITION) * PI / 180.0f; // rad/s
Lightvalve 57:f4819de54e7a 1583 // L feedforward velocity
Lightvalve 57:f4819de54e7a 1584 } else if ((OPERATING_MODE && 0x01) == 1) {
Lightvalve 57:f4819de54e7a 1585 I_REF_FORCE_FB = 0.001f * 0.01f*((double) P_GAIN_JOINT_TORQUE * torq.err + (double) I_GAIN_JOINT_TORQUE * torq.err_sum); // Linear Actuators are more sensitive.
Lightvalve 57:f4819de54e7a 1586 // temp_vel_torq = (0.01 * (double) VELOCITY_COMP_GAIN * (double) CUR_VELOCITY / (double) ENC_PULSE_PER_POSITION); // mm/s
Lightvalve 57:f4819de54e7a 1587 temp_vel_torq = (0.01f * (double) VELOCITY_COMP_GAIN * vel.ref / (double) ENC_PULSE_PER_POSITION); // mm/s
Lightvalve 57:f4819de54e7a 1588 // L feedforward velocity
Lightvalve 57:f4819de54e7a 1589 }
Lightvalve 57:f4819de54e7a 1590 if (temp_vel_torq > 0.0f) I_REF_VC = temp_vel_torq * ((double) PISTON_AREA_A * 0.00006f / (K_v * sqrt(2.0f * alpha3 / (alpha3 + 1.0f))));
Lightvalve 57:f4819de54e7a 1591 else I_REF_VC = temp_vel_torq * ((double) PISTON_AREA_B * 0.00006f / (K_v * sqrt(2.0f / (alpha3 + 1.0f))));
Lightvalve 57:f4819de54e7a 1592 // L velocity(rad/s or mm/s) >> I_ref(mA)
Lightvalve 57:f4819de54e7a 1593 // Ref_Joint_FT_dot = (Ref_Joint_FT_Nm - Ref_Joint_FT_Nm_old) / TMR_DT_5k;
Lightvalve 57:f4819de54e7a 1594 // Ref_Joint_FT_Nm_old = Ref_Joint_FT_Nm;
Lightvalve 57:f4819de54e7a 1595
Lightvalve 57:f4819de54e7a 1596 I_REF = (1.0f - alpha_trans) * I_REF_POS + alpha_trans * (I_REF_VC + I_REF_FORCE_FB);
Lightvalve 57:f4819de54e7a 1597
Lightvalve 57:f4819de54e7a 1598 } else {
Lightvalve 57:f4819de54e7a 1599 float VALVE_POS_RAW_FORCE_FB = 0.0f;
Lightvalve 57:f4819de54e7a 1600
Lightvalve 57:f4819de54e7a 1601 VALVE_POS_RAW_FORCE_FB = alpha_trans*(((float) P_GAIN_JOINT_TORQUE * torq.err + (float) I_GAIN_JOINT_TORQUE * torq.err_sum) * 0.01f
Lightvalve 57:f4819de54e7a 1602 + DDV_JOINT_POS_FF(vel.sen))+ (1.0f-alpha_trans) * (P_GAIN_JOINT_POSITION * 0.01f * pos.err + DDV_JOINT_POS_FF(vel.ref));
Lightvalve 57:f4819de54e7a 1603
Lightvalve 57:f4819de54e7a 1604 if (VALVE_POS_RAW_FORCE_FB >= 0) {
Lightvalve 57:f4819de54e7a 1605 valve_pos.ref = VALVE_POS_RAW_FORCE_FB + VALVE_DEADZONE_PLUS;
Lightvalve 57:f4819de54e7a 1606 } else {
Lightvalve 57:f4819de54e7a 1607 valve_pos.ref = VALVE_POS_RAW_FORCE_FB + VALVE_DEADZONE_MINUS;
Lightvalve 57:f4819de54e7a 1608 }
Lightvalve 57:f4819de54e7a 1609
Lightvalve 57:f4819de54e7a 1610 if(I_GAIN_JOINT_TORQUE != 0) {
Lightvalve 57:f4819de54e7a 1611 double Ka = 1.0f / (double) I_GAIN_JOINT_TORQUE * 100.0f;
Lightvalve 57:f4819de54e7a 1612 if(valve_pos.ref>VALVE_MAX_POS) {
Lightvalve 57:f4819de54e7a 1613 double valve_pos_rem = valve_pos.ref - VALVE_MAX_POS;
Lightvalve 57:f4819de54e7a 1614 valve_pos_rem = valve_pos_rem * Ka;
Lightvalve 57:f4819de54e7a 1615 valve_pos.ref = VALVE_MAX_POS;
Lightvalve 57:f4819de54e7a 1616 torq.err_sum = torq.err_sum - valve_pos_rem/(float) TMR_FREQ_5k;
Lightvalve 57:f4819de54e7a 1617 } else if(valve_pos.ref < VALVE_MIN_POS) {
Lightvalve 57:f4819de54e7a 1618 double valve_pos_rem = valve_pos.ref - VALVE_MIN_POS;
Lightvalve 57:f4819de54e7a 1619 valve_pos_rem = valve_pos_rem * Ka;
Lightvalve 57:f4819de54e7a 1620 valve_pos.ref = VALVE_MIN_POS;
Lightvalve 57:f4819de54e7a 1621 torq.err_sum = torq.err_sum - valve_pos_rem/(float) TMR_FREQ_5k;
Lightvalve 57:f4819de54e7a 1622 }
Lightvalve 57:f4819de54e7a 1623 }
Lightvalve 61:bc8c8270f0ab 1624
Lightvalve 57:f4819de54e7a 1625 VALVE_POS_CONTROL(valve_pos.ref);
Lightvalve 61:bc8c8270f0ab 1626
Lightvalve 60:64181f1d3e60 1627 Vout.ref = (float) P_GAIN_JOINT_POSITION * 0.01f * ((float) pos.err);
Lightvalve 60:64181f1d3e60 1628 V_out = (float) Vout.ref;
Lightvalve 57:f4819de54e7a 1629
Lightvalve 57:f4819de54e7a 1630 }
Lightvalve 58:2eade98630e2 1631
Lightvalve 57:f4819de54e7a 1632 break;
Lightvalve 57:f4819de54e7a 1633 }
Lightvalve 58:2eade98630e2 1634
Lightvalve 57:f4819de54e7a 1635 case MODE_VALVE_OPEN_LOOP: {
Lightvalve 57:f4819de54e7a 1636 V_out = (float) Vout.ref;
Lightvalve 57:f4819de54e7a 1637 break;
Lightvalve 57:f4819de54e7a 1638 }
Lightvalve 14:8e7590227d22 1639
Lightvalve 12:6f2531038ea4 1640 default:
Lightvalve 12:6f2531038ea4 1641 break;
Lightvalve 12:6f2531038ea4 1642 }
Lightvalve 14:8e7590227d22 1643
Lightvalve 57:f4819de54e7a 1644
Lightvalve 57:f4819de54e7a 1645 if (((OPERATING_MODE&0b110)>>1) == 0 || ((OPERATING_MODE&0b110)>>1) == 1) { //Moog Valve or KNR Valve
Lightvalve 58:2eade98630e2 1646
Lightvalve 57:f4819de54e7a 1647 ////////////////////////////////////////////////////////////////////////////
Lightvalve 57:f4819de54e7a 1648 //////////////////////////// CURRENT CONTROL //////////////////////////////
Lightvalve 57:f4819de54e7a 1649 ////////////////////////////////////////////////////////////////////////////
Lightvalve 57:f4819de54e7a 1650 if (CURRENT_CONTROL_MODE) {
Lightvalve 57:f4819de54e7a 1651 double alpha_update_Iref = 1.0f / (1.0f + TMR_FREQ_5k / (2.0f * 3.14f * 300.0f)); // f_cutoff : 500Hz
Lightvalve 57:f4819de54e7a 1652 I_REF_fil = (1.0f - alpha_update_Iref) * I_REF_fil + alpha_update_Iref*I_REF;
Lightvalve 57:f4819de54e7a 1653
Lightvalve 57:f4819de54e7a 1654 I_ERR = I_REF_fil - cur.sen;
Lightvalve 57:f4819de54e7a 1655 I_ERR_INT = I_ERR_INT + (I_ERR) * DT_TMR3;
Lightvalve 57:f4819de54e7a 1656
Lightvalve 57:f4819de54e7a 1657
Lightvalve 57:f4819de54e7a 1658 // Moog Valve Current Control Gain
Lightvalve 57:f4819de54e7a 1659 double R_model = 539.0f; // ohm
Lightvalve 57:f4819de54e7a 1660 double L_model = 1.2f;
Lightvalve 57:f4819de54e7a 1661 double w0 = 2.0f * 3.14f * 150.0f;
Lightvalve 57:f4819de54e7a 1662 double KP_I = 0.1f * L_model*w0;
Lightvalve 57:f4819de54e7a 1663 double KI_I = 0.1f * R_model*w0;
Lightvalve 57:f4819de54e7a 1664
Lightvalve 57:f4819de54e7a 1665 // KNR Valve Current Control Gain
Lightvalve 57:f4819de54e7a 1666 if (((OPERATING_MODE & 0b110)>>1) == 1) { // KNR Valve
Lightvalve 57:f4819de54e7a 1667 R_model = 163.0f; // ohm
Lightvalve 57:f4819de54e7a 1668 L_model = 1.0f;
Lightvalve 57:f4819de54e7a 1669 w0 = 2.0f * 3.14f * 80.0f;
Lightvalve 57:f4819de54e7a 1670 KP_I = 1.0f * L_model*w0;
Lightvalve 57:f4819de54e7a 1671 KI_I = 0.08f * R_model*w0;
Lightvalve 57:f4819de54e7a 1672 }
Lightvalve 57:f4819de54e7a 1673
Lightvalve 57:f4819de54e7a 1674 double FF_gain = 1.0f;
Lightvalve 57:f4819de54e7a 1675
Lightvalve 57:f4819de54e7a 1676 VALVE_PWM_RAW = KP_I * I_ERR + KI_I * I_ERR_INT;
Lightvalve 57:f4819de54e7a 1677 // VALVE_PWM_RAW = VALVE_PWM_RAW + FF_gain * (R_model*I_REF); // Unit : mV
Lightvalve 57:f4819de54e7a 1678 I_REF_fil_diff = I_REF_fil - I_REF_fil_old;
Lightvalve 57:f4819de54e7a 1679 I_REF_fil_old = I_REF_fil;
Lightvalve 57:f4819de54e7a 1680 VALVE_PWM_RAW = VALVE_PWM_RAW + FF_gain * (R_model * I_REF_fil + L_model * I_REF_fil_diff * TMR_FREQ_5k); // Unit : mV
Lightvalve 57:f4819de54e7a 1681 double V_MAX = 12000.; // Maximum Voltage : 12V = 12000mV
Lightvalve 57:f4819de54e7a 1682
Lightvalve 57:f4819de54e7a 1683 double Ka = 3.0f / KP_I;
Lightvalve 57:f4819de54e7a 1684 if (VALVE_PWM_RAW > V_MAX) {
Lightvalve 57:f4819de54e7a 1685 V_rem = VALVE_PWM_RAW - V_MAX;
Lightvalve 57:f4819de54e7a 1686 V_rem = Ka*V_rem;
Lightvalve 57:f4819de54e7a 1687 VALVE_PWM_RAW = V_MAX;
Lightvalve 57:f4819de54e7a 1688 I_ERR_INT = I_ERR_INT - V_rem * DT_TMR3;
Lightvalve 57:f4819de54e7a 1689 } else if (VALVE_PWM_RAW < -V_MAX) {
Lightvalve 57:f4819de54e7a 1690 V_rem = VALVE_PWM_RAW - (-V_MAX);
Lightvalve 57:f4819de54e7a 1691 V_rem = Ka*V_rem;
Lightvalve 57:f4819de54e7a 1692 VALVE_PWM_RAW = -V_MAX;
Lightvalve 57:f4819de54e7a 1693 I_ERR_INT = I_ERR_INT - V_rem * DT_TMR3;
Lightvalve 57:f4819de54e7a 1694 }
Lightvalve 57:f4819de54e7a 1695 Cur_Valve_Open_pulse = cur.sen / mA_PER_pulse;
Lightvalve 57:f4819de54e7a 1696 } else {
Lightvalve 57:f4819de54e7a 1697 VALVE_PWM_RAW = I_REF * mV_PER_mA;
Lightvalve 57:f4819de54e7a 1698 Cur_Valve_Open_pulse = I_REF / mA_PER_pulse;
Lightvalve 57:f4819de54e7a 1699 }
Lightvalve 57:f4819de54e7a 1700
Lightvalve 57:f4819de54e7a 1701 ////////////////////////////////////////////////////////////////////////////
Lightvalve 57:f4819de54e7a 1702 ///////////////// Dead Zone Cancellation & Linearization //////////////////
Lightvalve 57:f4819de54e7a 1703 ////////////////////////////////////////////////////////////////////////////
Lightvalve 57:f4819de54e7a 1704 // Dead Zone Cancellation (Mechanical Valve dead-zone)
Lightvalve 57:f4819de54e7a 1705 if (FLAG_VALVE_DEADZONE) {
Lightvalve 57:f4819de54e7a 1706 if (VALVE_PWM_RAW > 0) VALVE_PWM_RAW = VALVE_PWM_RAW + VALVE_DEADZONE_PLUS * mV_PER_pulse; // unit: mV
Lightvalve 57:f4819de54e7a 1707 else if (VALVE_PWM_RAW < 0) VALVE_PWM_RAW = VALVE_PWM_RAW + VALVE_DEADZONE_MINUS * mV_PER_pulse; // unit: mV
Lightvalve 57:f4819de54e7a 1708
Lightvalve 57:f4819de54e7a 1709 VALVE_PWM_VALVE_DZ = VALVE_PWM_RAW + (double)VALVE_CENTER * mV_PER_pulse; // unit: mV
Lightvalve 57:f4819de54e7a 1710
Lightvalve 57:f4819de54e7a 1711 } else {
Lightvalve 57:f4819de54e7a 1712 VALVE_PWM_VALVE_DZ = VALVE_PWM_RAW;
Lightvalve 57:f4819de54e7a 1713 }
Lightvalve 57:f4819de54e7a 1714
Lightvalve 57:f4819de54e7a 1715 // Output Voltage Linearization
Lightvalve 57:f4819de54e7a 1716 double CUR_PWM_nonlin = VALVE_PWM_VALVE_DZ; // Unit : mV
Lightvalve 57:f4819de54e7a 1717 double CUR_PWM_lin = PWM_duty_byLT(CUR_PWM_nonlin);
Lightvalve 57:f4819de54e7a 1718
Lightvalve 57:f4819de54e7a 1719 // Dead Zone Cancellation (Electrical dead-zone)
Lightvalve 57:f4819de54e7a 1720 if (CUR_PWM_lin > 0) V_out = (int) CUR_PWM_lin + 140;
Lightvalve 57:f4819de54e7a 1721 else if (CUR_PWM_lin < 0) V_out = (int) CUR_PWM_lin - 140;
Lightvalve 57:f4819de54e7a 1722 else V_out = CUR_PWM_lin;
Lightvalve 57:f4819de54e7a 1723 }
Lightvalve 58:2eade98630e2 1724
Lightvalve 58:2eade98630e2 1725
Lightvalve 14:8e7590227d22 1726
jobuuu 7:e9086c72bb22 1727 /*******************************************************
jobuuu 7:e9086c72bb22 1728 *** PWM
jobuuu 7:e9086c72bb22 1729 ********************************************************/
Lightvalve 49:e7bcfc244d40 1730 if (V_out >= VALVE_VOLTAGE_LIMIT*1000.0f) {
Lightvalve 49:e7bcfc244d40 1731 V_out = VALVE_VOLTAGE_LIMIT*1000.0f;
Lightvalve 49:e7bcfc244d40 1732 } else if(V_out<=-VALVE_VOLTAGE_LIMIT*1000.0f) {
Lightvalve 49:e7bcfc244d40 1733 V_out = -VALVE_VOLTAGE_LIMIT*1000.0f;
Lightvalve 27:a2254a485f23 1734 }
Lightvalve 49:e7bcfc244d40 1735 PWM_out= V_out/(SUPPLY_VOLTAGE*1000.0f); // Full duty : 12000.0mV
Lightvalve 13:747daba9cf59 1736
Lightvalve 19:23b7c1ad8683 1737 // Saturation of output voltage to 12.0V
Lightvalve 30:8d561f16383b 1738 if(PWM_out > 1.0f) PWM_out=1.0f;
Lightvalve 30:8d561f16383b 1739 else if (PWM_out < -1.0f) PWM_out=-1.0f;
Lightvalve 13:747daba9cf59 1740
Lightvalve 30:8d561f16383b 1741 if (PWM_out>0.0f) {
Lightvalve 30:8d561f16383b 1742 dtc_v=0.0f;
jobuuu 1:e04e563be5ce 1743 dtc_w=PWM_out;
jobuuu 1:e04e563be5ce 1744 } else {
jobuuu 2:a1c0a37df760 1745 dtc_v=-PWM_out;
Lightvalve 30:8d561f16383b 1746 dtc_w=0.0f;
jobuuu 1:e04e563be5ce 1747 }
Lightvalve 13:747daba9cf59 1748
jobuuu 1:e04e563be5ce 1749 //pwm
Lightvalve 30:8d561f16383b 1750 TIM4->CCR2 = (PWM_ARR)*(1.0f-dtc_v);
Lightvalve 30:8d561f16383b 1751 TIM4->CCR1 = (PWM_ARR)*(1.0f-dtc_w);
Lightvalve 61:bc8c8270f0ab 1752
Lightvalve 61:bc8c8270f0ab 1753
Lightvalve 57:f4819de54e7a 1754 if (TMR2_COUNT_CAN_TX % (int) ((int) TMR_FREQ_5k/CAN_FREQ) == 0) {
Lightvalve 20:806196fda269 1755
Lightvalve 54:647072f5307a 1756 // Position, Velocity, and Torque (ID:1200)
Lightvalve 56:6f50d9d3bfee 1757 if (flag_data_request[0] == HIGH) {
Lightvalve 57:f4819de54e7a 1758 if ((OPERATING_MODE & 0b01) == 0) { // Rotary Actuator
Lightvalve 54:647072f5307a 1759 if (SENSING_MODE == 0) {
Lightvalve 58:2eade98630e2 1760 CAN_TX_POSITION_FT((int16_t) (pos.sen), (int16_t) (vel.sen/10.0f), (int16_t) (pres_A.sen*10.0f));
Lightvalve 54:647072f5307a 1761 } else if (SENSING_MODE == 1) {
Lightvalve 58:2eade98630e2 1762 CAN_TX_POSITION_PRESSURE((int16_t) (pos.sen), (int16_t) (vel.sen/10.0f), (int16_t) ((pres_A.sen)*5.0f), (int16_t) ((pres_B.sen)*5.0f));
Lightvalve 54:647072f5307a 1763 }
Lightvalve 57:f4819de54e7a 1764 } else if ((OPERATING_MODE & 0b01) == 1) { // Linear Actuator
Lightvalve 54:647072f5307a 1765 if (SENSING_MODE == 0) {
Lightvalve 60:64181f1d3e60 1766 CAN_TX_POSITION_FT((int16_t) (pos.sen/4.0f), (int16_t) (vel.sen/100.0f), (int16_t) (pres_A.sen));
Lightvalve 54:647072f5307a 1767 } else if (SENSING_MODE == 1) {
Lightvalve 58:2eade98630e2 1768 CAN_TX_POSITION_PRESSURE((int16_t) (pos.sen/4.0f), (int16_t) (vel.sen/100.0f), (int16_t) ((pres_A.sen)*5.0f), (int16_t) ((pres_B.sen)*5.0f));
Lightvalve 54:647072f5307a 1769 }
Lightvalve 52:8ea76864368a 1770 }
Lightvalve 52:8ea76864368a 1771 }
Lightvalve 56:6f50d9d3bfee 1772 if (flag_data_request[1] == HIGH) {
Lightvalve 54:647072f5307a 1773 //valve position
Lightvalve 54:647072f5307a 1774 double t_value = 0;
Lightvalve 57:f4819de54e7a 1775 // if(value>=(float) VALVE_CENTER) {
Lightvalve 57:f4819de54e7a 1776 // t_value = 10000.0f*((double)value - (double)VALVE_CENTER)/((double)VALVE_MAX_POS - (double)VALVE_CENTER);
Lightvalve 57:f4819de54e7a 1777 // } else {
Lightvalve 57:f4819de54e7a 1778 // t_value = -10000.0f*((double)value - (double)VALVE_CENTER)/((double)VALVE_MIN_POS - (double)VALVE_CENTER);
Lightvalve 57:f4819de54e7a 1779 // }
Lightvalve 58:2eade98630e2 1780 if(OPERATING_MODE==5) {
Lightvalve 57:f4819de54e7a 1781 t_value = (double) value;
Lightvalve 58:2eade98630e2 1782 } else if(CURRENT_CONTROL_MODE==1) {
Lightvalve 57:f4819de54e7a 1783 t_value = cur.sen;
Lightvalve 58:2eade98630e2 1784 } else {
Lightvalve 57:f4819de54e7a 1785 t_value = V_out;
Lightvalve 54:647072f5307a 1786 }
Lightvalve 60:64181f1d3e60 1787 CAN_TX_TORQUE((int16_t) (t_value), (int16_t) (V_out)); //1300
Lightvalve 54:647072f5307a 1788 }
Lightvalve 58:2eade98630e2 1789
Lightvalve 58:2eade98630e2 1790
Lightvalve 56:6f50d9d3bfee 1791 if (flag_data_request[2] == HIGH) {
Lightvalve 56:6f50d9d3bfee 1792 //pressure A and B
Lightvalve 57:f4819de54e7a 1793 CAN_TX_PRES((int16_t) (pres_A.sen), (int16_t) (pres_B.sen)); // CUR_PRES_X : 0(0bar)~4096(210bar) //1400
Lightvalve 55:b25725257569 1794 }
Lightvalve 58:2eade98630e2 1795
Lightvalve 57:f4819de54e7a 1796 //If it doesn't rest, below can can not work.
Lightvalve 57:f4819de54e7a 1797 for (can_rest = 0; can_rest < 10000; can_rest++) {
Lightvalve 57:f4819de54e7a 1798 ;
Lightvalve 57:f4819de54e7a 1799 }
Lightvalve 58:2eade98630e2 1800
Lightvalve 56:6f50d9d3bfee 1801 if (flag_data_request[3] == HIGH) {
Lightvalve 54:647072f5307a 1802 //PWM
Lightvalve 57:f4819de54e7a 1803 CAN_TX_PWM((int16_t) cur.sen); //1500
Lightvalve 54:647072f5307a 1804 }
Lightvalve 57:f4819de54e7a 1805 //for (i = 0; i < 10000; i++) {
Lightvalve 57:f4819de54e7a 1806 // ;
Lightvalve 57:f4819de54e7a 1807 // }
Lightvalve 56:6f50d9d3bfee 1808 if (flag_data_request[4] == HIGH) {
Lightvalve 54:647072f5307a 1809 //valve position
Lightvalve 57:f4819de54e7a 1810 CAN_TX_VALVE_POSITION((int16_t) (CAN_FREQ), (int16_t) (D_DAMPER), (int16_t) OPERATING_MODE); //1600
Lightvalve 54:647072f5307a 1811 }
Lightvalve 20:806196fda269 1812
Lightvalve 54:647072f5307a 1813 // Others : Reference position, Reference FT, PWM, Current (ID:1300)
Lightvalve 52:8ea76864368a 1814 // if (flag_data_request[1] == HIGH) {
Lightvalve 52:8ea76864368a 1815 // CAN_TX_SOMETHING((int) (FORCE_VREF), (int16_t) (1), (int16_t) (2), (int16_t) (3));
Lightvalve 52:8ea76864368a 1816 // }
Lightvalve 54:647072f5307a 1817 //if (flag_delay_test == 1){
Lightvalve 58:2eade98630e2 1818 //CAN_TX_PRES((int16_t) (0),(int16_t) torq_ref);
Lightvalve 54:647072f5307a 1819 //}
Lightvalve 52:8ea76864368a 1820
Lightvalve 54:647072f5307a 1821 TMR2_COUNT_CAN_TX = 0;
Lightvalve 54:647072f5307a 1822 }
Lightvalve 54:647072f5307a 1823 TMR2_COUNT_CAN_TX++;
Lightvalve 52:8ea76864368a 1824
Lightvalve 20:806196fda269 1825 }
Lightvalve 52:8ea76864368a 1826 TIM3->SR = 0x0; // reset the status register
Lightvalve 52:8ea76864368a 1827
Lightvalve 58:2eade98630e2 1828 }