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.
Dependencies: mbed Motor_Feedforward
Diff: main.cpp
- Revision:
- 7:e4fc29c6f014
- Parent:
- 6:95dc3761f64a
- Child:
- 9:3e15c7d42813
--- a/main.cpp Wed Feb 19 04:52:01 2020 +0000 +++ b/main.cpp Sat Sep 19 01:51:56 2020 +0000 @@ -3,20 +3,11 @@ #include "math_ops.h" #include "MotorModule.h" -typedef union _data { - float f; - char s[4]; -} myData; Serial pc(PA_2, PA_3); // Serial port to the computer CAN can(PB_8, PB_9, 1000000); // CAN Rx pin name, CAN Tx pin name -myData dat1; -myData dat2; -myData dat3; -myData dat4; - Ticker loop_ctrl; // Control loop interrupt handler Ticker loop_msg; @@ -38,7 +29,7 @@ float t = 0.0; float A= 0.5; float f = 1.0; -double mycur = 0.2; +double mycur = 0.35; bool flagCtrl = true; void printnew(){ @@ -57,6 +48,7 @@ } if (1<=t<20){ motors[0].control.i_ff = mycur; + motors[0].control.p_des = 0; motors[0].control.kd = 0; motors[0].control.kp = 0; }