Go Down

Topic: Matlab arduino controller/DAQ (Read 610 times) previous topic - next topic

Leo_UoS

Hi all,

I am trying to build a controller and DAQ system for controlling come actuators and reading several sensors.  Currently I have written two separate programs; one that lets me read n number of sensors and print them to serial continuously and another program that selects the actuator that I need to control then sets its set point.

The problem lies in combining the two.  Ideally the system will stream the sensor values through the serial to matlab however I want to occasionally send a new setpoint (from matlab) for the actuators.  Is there a way within matlab to do this?  

When the sensor data is streaming - matlab is busy.  I also dont want to have to specify the actuator setpoints on every loop.  So I think I need a sort of interupt within matlab which I'm not sure exists.

Any ideas guys?

emacpher

In newer versions of Matlab, there is a Timer object that can call a given function at regular intervals. There is also a timer specifically associated with the Serial port object that dates back to Matlab 6.0 at least.

cheers, e.

Leo_UoS

Thanks but thats not really what I'm after.  I cannot afford to add any delays into the loop by using timers.  The arduino will be eventually used as part of a control system so adding any delays could cause my system to become unstable.

Go Up