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.
Revision 121:89396c37b03e, committed 2020-09-15
- Comitter:
- Lightvalve
- Date:
- Tue Sep 15 00:22:01 2020 +0000
- Parent:
- 120:17398540bb1c
- Child:
- 122:dcb3ce3056a0
- Commit message:
- 200915-1
Changed in this revision
--- a/CAN/function_CAN.cpp Mon Sep 14 13:12:44 2020 +0000
+++ b/CAN/function_CAN.cpp Tue Sep 15 00:22:01 2020 +0000
@@ -752,10 +752,10 @@
}
x_past[num_array_x_past-1] = pos.sen / ENC_PULSE_PER_POSITION; //mm
-// for(int i=0;i<num_array_x_future-1;i++){
-// x_future[i] = x_future[i+1];
-// }
-// x_future[num_array_x_future-1] = pos.sen / ENC_PULSE_PER_POSITION; //mm
+ for(int i=0;i<num_array_x_future-1;i++){
+ x_future[i] = x_future[i+1];
+ }
+ x_future[num_array_x_future-1] = pos.sen / ENC_PULSE_PER_POSITION; //mm
for(int i=0; i<num_array_f_past-1;i++){
f_past[i] = f_past[i+1];
--- a/main.cpp Mon Sep 14 13:12:44 2020 +0000
+++ b/main.cpp Tue Sep 15 00:22:01 2020 +0000
@@ -1,4 +1,4 @@
-//200914-4
+//200915-1
#include "mbed.h"
#include "FastPWM.h"
#include "INIT_HW.h"
@@ -397,10 +397,11 @@
}
input_NN[ind] = (pos.sen / ENC_PULSE_PER_POSITION) / 60.0f;
ind = ind + 1;
-// for(int i=0;i<numfuture_x;i++){
-// input_NN[ind] = x_future[time_interval*i+time_interval] / 60.0f;
-// ind = ind + 1;
-// }
+
+ for(int i=0; i<numfuture_x; i++) {
+ input_NN[ind] = x_future[time_interval*i+time_interval] / 60.0f;
+ ind = ind + 1;
+ }
for(int i=0; i<numpast_f; i++) {
input_NN[ind] = f_past[time_interval*i] / 10000.0f + 0.5f;
--- a/setting.h Mon Sep 14 13:12:44 2020 +0000 +++ b/setting.h Tue Sep 15 00:22:01 2020 +0000 @@ -427,18 +427,18 @@ //extern const int num_input ; //extern const int num_input_array; -#define numpast_u 5 +#define numpast_u 0 #define numpast_x 5 -#define numfuture_x 0 +#define numfuture_x 5 #define numpast_f 5 #define numfuture_f 10 #define num_input 27 //numpast_x + 1 + numfuture_x + numpast_f + 1 + numfuture_f -#define num_array_u_past 11 // numpast_u * time_interval + 1 +#define num_array_u_past 1 // numpast_u * time_interval + 1 #define num_array_f_future 11 // numfuture_f * time_interval + 1 #define num_array_f_past 6 // numpast_f * time_interval + 1 #define num_array_x_past 6 // numpast_x * time_interval + 1 -#define num_array_x_future 1 // numfuture_x * time_interval + 1 +#define num_array_x_future 6 // numfuture_x * time_interval + 1 #define time_interval 1