Short Review:
I have been working on this model for a while now, I was having some trouble with the sensor data but all of that is good now,
Here is how the system works every command is fed through the UART interface as well as data read from sensors or input data.
I managed to control angle only (motor position) although I am not very happy with it is somewhat unstable...
The trouble I am facing is controlling the ball position, the simpler control system I could come up was a cascade PID, the problem is I cant get both plants right for simulation Voltage-Angle and Angle-Position, I wanted to get them with identification toolbox in matlab (I have a transfer function for the angle-position plant it is :.
Since the motor was originally scrap from a printer I cant really get its parameters on a datasheet I know it is a Jhonson Motor, 36mm diameter 56mm length, 3mm shaft there are this numbers printed on it I can't seem to find any relation to a motor model. 65791, c5324-60024, 392361
I am not sure if the following procedure should have been the way to go for identification.
I made a Matlab Script that would read a word of data sent by the psoc through UART, in this format "a#p#t#x#f" so I get current angle, motor power (voltage%), current position, and time.
working with the time vector I managed to extract an average sampling time of 0.005s,
I had to create a PRBS signal to command the motor so I did it internally with two alternate power settings that are outputed on a random time (The plot doesnt make it a square wave but all the points are on +18 or -18.)
After this I went into Ident toolbox
after removing Means, trends and filtering and separating the data for evaluation and validation, I got a 97% fit with a box Jenkins (1 1 3 3 0) which should make a reliable model for simulation but If I used the PID parameters on the PSOC It would diverge every time I cant seem to find a solution.
I appreciate your help,
some questions..
the embedded system (PSOC) is very fast (the actual sampling time is 0.004s approximately, should I slow it down for the control system to work?? it Doesn't seem right.
All the theory says the PRBS signal should be 1,-1 signal How do I know if the PRBS signal's amplitude and width is good enough for identification??
I would like to try other control methods (non-linear) (State space) but I cant seem to get the models from identification.
I am not sure if the files are of any use without the model.. If you want to see them let me know.