Hello dear community,
I am working on my Bachelor thesis and have encountered a problem which I could not solve with different methods.
I am building a Robot with a LEGO EV3 Brick and Motor. For modeling purposes I need to gain experimental data to build a function that translates my input u (torque) into power as the Simulink encoder for LEGO works with power values from -100 to 100.
To do so I build an experiment with a digital clock that counts from -100 to 100 and I gave this signal into the motor. I saved the data from the encoder and used polyfit to approximate the data. This worked, but there is a big margin of error.
So I want to build a repeating step signal, that holds the power level for 5 seconds and then makes a step of 1 to the next power level. This way I could calculate the average value over 5 seconds. But I have not been successful in generating a signal like this.
I would appreciate any kind of help.
The signal would look something like this:
_ _ _ _ _| step of 1
_ _ _ _ _|
_ _ _ _ _|