Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 41:abbd4e2af68b
- Parent:
- 40:3f2c0619c8c4
- Child:
- 42:1cf66990ccab
--- 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) {