Path: news.mathworks.com!newsfeed-00.mathworks.com!kanaga.switch.ch!switch.ch!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.straub-nv.de!feeder.eternal-september.org!eternal-september.org!not-for-mail
From: dpb <none@non.net>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Serial Accelerometer
Date: Tue, 20 Oct 2009 09:20:35 -0500
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <hbkh97$rpc$1@news.eternal-september.org>
References: <hbkgl6$bn4$1@fred.mathworks.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.eternal-september.org U2FsdGVkX18wdyrF4qnWoR78OOWEdmUEZ6RTLexNRr3FRf/QrNkGEqr3fPtRRyljnuWchukyWAR5+sVXIrn+RYL42sbBUoKAr1reAbFSr9xm2V3meFBt2XzkZjSGjhde8r0Egp39T2a0pEFzzhDEKg==
X-Complaints-To: abuse@eternal-september.org
NNTP-Posting-Date: Tue, 20 Oct 2009 14:25:44 +0000 (UTC)
In-Reply-To: <hbkgl6$bn4$1@fred.mathworks.com>
X-Auth-Sender: U2FsdGVkX1/ZGLrDwBKl26X+/z82uoZMhfoUp/Kp/eM=
Cancel-Lock: sha1:Du4eup21TrK6hNfzmm7XO4qYHb4=
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
Xref: news.mathworks.com comp.soft-sys.matlab:578709


Anubhav Khanna wrote:
> Hi,
> 
> I'm having a tough time with this serial port. I've surfed the forums
> for a while now and can't get anything working.
> 
> I'm trying to have a serial accelerometer work with MATLAB. Wrote
> some m-file code that would do this and it almost worked. The
> accelerometer data was being plotted decently; taking the area
> underneath the curve gave velocity and integrating it further gave
> the distance...which is our final goal..getting the distance moved.
> We got this to work with real-time data. As the accelerometer was
> moving, data was being plotted. The velocity was being done by the
> 'trapz' function. Not good enough data though, the velocity wasn't
> being plotted properly.
> 
> So now we're trying to use Simulink to solve this problem and
> hopefully get it to work in real time a bit better. Question is,
> where do I begin? How can I get Simulink to read data from the serial
> port (accelerometer) and plot the data in real time?
> 
> Any help would be appreciated :)

What, specifically wasn't "good enough data" and why do you think 
switching to Simulink would be the solution?

If the acceleration data are being collected and displayed correctly, 
then a problem w/ velocity would seem to be more related to the sampling 
rate and the trapezoidal assumption in integration and that won't change 
with computing platform.

Of course, integration and double-integration of an accelerometer is 
reknown for difficulties as any DC bias in the input is amplified for 
starters.

--