|
Hi,
Apparently I thought the forums would send me an email when there was a new reply to the post. Anyways....
By good enough data, I mean that the acceleration and deceleration don't necessarily match in area covered over the time axis. Don't know if something is wrong with the timing or what. We're using a Sparkfun Accelerometer (http://www.sparkfun.com/datasheets/Accelerometers/SerAccel-v5.pdf). I thought maybe our m-file was a bit off, so Simulink would have a better solution to this, i.e. built-in code that could read in the data. I don't know much about it.
The accelerometer is using a serial interface. So we thought using fscan and all those commands we can get the data in. (I have the detailed code with me obviously). The problem lies with the timing information I believe. Do I use tic/toc? or something else?
Pretty much this close to giving up on this project.
Thanks.
dpb <none@non.net> wrote in message <hbkh97$rpc$1@news.eternal-september.org>...
> 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.
>
> --
|