1 problem. 3 possible solutions. 1) Servo motor control (arduino) in external mode 2) Ultrasonic sensor to run in normal mode Can you help??? 3) transfer data between simulink models in real time. Can you help??

1 view (last 30 days)
Hi. I'm having a problem with communication between simulink and my separate devices. I need to take data from a potentiometer, an ultrasonic sensor and transmit to a servo in real time using Simulink. I can get the potentiometer to work in normal and external mode. I can get the servo to take data in real time in normal mode, and I can get the HCSR04 to communicate data in external mode. The way i see it there are three possibilities to fixing this and I know none of them....
1) Get the servo to run in external mode / Use the servo write block in external mode somehow
2) Figure out a way for the ultrasonic to run in normal mode (possibly a combo of the s-function with arduino code and the matlab function from the Arduino IO package)?
3) Run external mode on one Arduino and normal mode on a second and pull the data from one Simulink model to the other. I have tried this with the Instrument control toolbox over UDP without success in real time.
If you have an idea how I can do any of these three I would be ever so grateful to hear them....
Regards, Damian

Answers (0)

Communities

More Answers in the  Power Electronics Control

Categories

Find more on Arduino Hardware in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!