![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
2011
Diff: main.cpp
- Revision:
- 40:abbd4e2af68b
- Parent:
- 39:3f2c0619c8c4
- Child:
- 41:1cf66990ccab
diff -r 3f2c0619c8c4 -r abbd4e2af68b main.cpp --- a/main.cpp Thu Dec 19 11:39:31 2019 +0000 +++ b/main.cpp Mon Dec 23 04:05:31 2019 +0000 @@ -996,7 +996,6 @@ int T_move = 2*TMR_FREQ_5k; pos.ref_home_pos = (0.0f - (float)INIT_REF_POS)*0.5f*(1.0f - cos(3.14159f * (float)cnt_findhome / (float)T_move)) + (float)INIT_REF_POS; vel.ref_home_pos = 0.0f; - CAN_TX_PRES((int16_t)(pos.ref_home_pos), (int16_t) (6)); // input for position control pos.err = pos.ref_home_pos - (float)pos.sen; @@ -1677,11 +1676,8 @@ //CAN ---------------------------------------------------------------------- if (flag_data_request[0] == HIGH) { //position+velocity - CAN_TX_POSITION((int32_t) pos.sen, (int32_t) vel.sen); - //CAN_TX_POSITION((int32_t) valve_pos.ref, (int32_t) 0); - //CAN_TX_POSITION((int32_t) VALVE_PWM_RAW_FF, (int32_t) VALVE_POS_VS_PWM[10]); - //pc.printf("can good"); - // CAN_TX_POSITION((long) CUR_PRES_A_BAR, (long) CUR_PRES_B_BAR); + //CAN_TX_POSITION((int32_t) pos.sen, (int32_t) vel.sen); + CAN_TX_POSITION((int16_t) (pos.sen/4.0f), (int16_t) (vel.sen/400.0f), (int16_t) torq.sen); } if (flag_data_request[1] == HIGH) {