I am doing a college project title 'Control of a roll angle of a wing'. Basically its a model with a pair of wings with a shaft in the middle. The aim of the project is to stabilize the wings back to their horizontal position if a kick is given on them.
I have a servo motor on the model itself which is connected to the flaps on either side of the wings in order to move them up and down. I have also a potentiometer attached to the shaft in order to be able to take the reading of the voltage when the wings move up and down.
I am using the MATLAB program for the simulation and I will be also using the arduino as a microcontroller.
My current problem is in the simulink section of this same program. I am using the arduino target and when I connect the analog input to the scope on the simulink it always reads 0 on it. What I do is I set the analog input block on the simulink to pin 0 for example and then connect the potentiometer to pin 0.
The following link is what I am doing in Simulink:http://imageshack.us/photo/my-images/806/simulink.png/
Another problem is that the simulation time goes by too fast (indicated by a circle on the picture). The sampling time is of 0.001
Can someone please help me with this problem?