asdgas
Dependencies: mbed Eigen FastPWM
Diff: CAN/function_CAN.cpp
- Revision:
- 62:456f87e3124e
- Parent:
- 60:64181f1d3e60
- Child:
- 63:376a20d2fbfd
diff -r 8d36b4042096 -r 456f87e3124e CAN/function_CAN.cpp --- a/CAN/function_CAN.cpp Mon Apr 13 11:55:09 2020 +0000 +++ b/CAN/function_CAN.cpp Tue Apr 28 09:19:26 2020 +0000 @@ -716,8 +716,8 @@ vel.ref = (double)temp_vel * 10.0f; } else { //Linear Actuator - pos.ref = (double)temp_pos * 4.0f; - vel.ref = (double)temp_vel * 100.0f; + pos.ref = (double)temp_pos * 10.0f; + vel.ref = (double)temp_vel * 256.0f; } torq.ref = (double)temp_torq * 0.1f; @@ -1339,15 +1339,26 @@ can.write(temp_msg); } -void CAN_TX_TORQUE(int16_t t_valve_pos, int16_t t_vout) { +//void CAN_TX_TORQUE(int16_t t_valve_pos, int16_t t_vout) { +// CANMessage temp_msg; +// +// temp_msg.id = CID_TX_TORQUE; +// temp_msg.len = 4; +// temp_msg.data[0] = (uint8_t) t_valve_pos; +// temp_msg.data[1] = (uint8_t) (t_valve_pos >> 8); +// temp_msg.data[2] = (uint8_t) t_vout; +// temp_msg.data[3] = (uint8_t) (t_vout >> 8); +// +// can.write(temp_msg); +//} + +void CAN_TX_TORQUE(int16_t t_valve_pos) { CANMessage temp_msg; temp_msg.id = CID_TX_TORQUE; - temp_msg.len = 4; + temp_msg.len = 2; temp_msg.data[0] = (uint8_t) t_valve_pos; temp_msg.data[1] = (uint8_t) (t_valve_pos >> 8); - temp_msg.data[2] = (uint8_t) t_vout; - temp_msg.data[3] = (uint8_t) (t_vout >> 8); can.write(temp_msg); }