Why my phidget 1056 got peak value regularly like this??

Comments & issues
raymondk
Phidgetsian
Posts: 8
Joined: Thu Oct 06, 2011 9:15 pm
Contact:

Why my phidget 1056 got peak value regularly like this??

Postby raymondk » Thu Jan 12, 2012 5:34 am

When i set my phidget data rate to lower than 64 ms

Peak appears shown in the figure? why's that?

It's only the magnetic field comes with that problem
Attachments
wrong.png
wrong.png (55.48 KiB) Viewed 1306 times

raymondk
Phidgetsian
Posts: 8
Joined: Thu Oct 06, 2011 9:15 pm
Contact:

Re: Why my phidget 1056 got peak value regularly like this??

Postby raymondk » Thu Jan 12, 2012 6:16 am

the problems appear only in matlab, it's alright for other compilers

User avatar
burley
Human-Cyborg Relations
Posts: 439
Joined: Tue Sep 27, 2011 2:37 pm
Location: Calgary
Contact:

Re: Why my phidget 1056 got peak value regularly like this??

Postby burley » Thu Jan 12, 2012 9:03 am

From page 14 of the 1056's product manual:

"Magnetic field data will become unavailable for ~28ms every 2 seconds as the compass performs internal calibrations. During this time, polling the magnetic field will return EPHIDGET_UNKNOWNVAL, or throw an UNKNOWNVAL exception. The magnetic field data in the SpatialData event will equal PUNK_DBL."
Brian Burley
403-282-7335 ext. 6003
support@phidgets.com

raymondk
Phidgetsian
Posts: 8
Joined: Thu Oct 06, 2011 9:15 pm
Contact:

Re: Why my phidget 1056 got peak value regularly like this??

Postby raymondk » Thu Jan 12, 2012 10:43 am

burley wrote:From page 14 of the 1056's product manual:

"Magnetic field data will become unavailable for ~28ms every 2 seconds as the compass performs internal calibrations. During this time, polling the magnetic field will return EPHIDGET_UNKNOWNVAL, or throw an UNKNOWNVAL exception. The magnetic field data in the SpatialData event will equal PUNK_DBL."

but why I didn't find this happen in other compiler like netbean

can i actually avoid it in matlab by other means?

User avatar
Patrick
Lead Developer
Posts: 2907
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: Why my phidget 1056 got peak value regularly like this??

Postby Patrick » Thu Jan 12, 2012 11:15 am

You need to check the return value from the CPhidgetSpatial_getMagneticField call - if it is EPHIDGET_UNKNOWNVAL, don't use the data.

-Patrick

raymondk
Phidgetsian
Posts: 8
Joined: Thu Oct 06, 2011 9:15 pm
Contact:

Re: Why my phidget 1056 got peak value regularly like this??

Postby raymondk » Fri Jan 13, 2012 9:25 pm

Thanks very much for you guys' answer

But one last question, did any one know how to made matlab act like java listen, that is, the program runs whenever data comes it, instead of the matlab, which I have to set a pause every time to wait for the new data, i think this kinda inaccurate.

Anyone one got experience on that?

User avatar
burley
Human-Cyborg Relations
Posts: 439
Joined: Tue Sep 27, 2011 2:37 pm
Location: Calgary
Contact:

Re: Why my phidget 1056 got peak value regularly like this??

Postby burley » Mon Jan 16, 2012 8:10 am

Matlab is not capable of doing events. It is one of the shortcomings of the language.
Brian Burley
403-282-7335 ext. 6003
support@phidgets.com


Return to “General”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest