Author Topic: Cartesian to Polar Math  (Read 1887 times)

0 Members and 1 Guest are viewing this topic.

Offline lgbenoTopic starter

  • Frequent Contributor
  • **
  • Posts: 349
  • Country: 00
Cartesian to Polar Math
« on: January 10, 2015, 08:58:41 pm »
Ok I think this is possible and if I sat and thought about it long enough I would probably come up with a solution but I'm sure that the collective genious that is EEVBLOG forum users can come up with the method faster.

So I have a spinning magnet in proximity to a MAG3110 magnetometer.  As you would assume, it measures magnetic filed in Cartesian values x,y,z.  I would like to take these Cartesian values and calculate the vector of the axis of the spinning magnet, current angle of the field about that vector and possible the magnitude of the field.

Thoughts?
 

Offline skipjackrc4

  • Regular Contributor
  • *
  • Posts: 239
  • Country: us
Re: Cartesian to Polar Math
« Reply #1 on: January 10, 2015, 10:44:40 pm »
I'm thinking you probably want spherical coordinates instead of polar, since you're operating in 3D space.

This particular coordinate conversion is quite simple.  Just follow the equations on the wiki page:

http://en.wikipedia.org/wiki/Spherical_coordinate_system
 

Offline LukeW

  • Frequent Contributor
  • **
  • Posts: 686
Re: Cartesian to Polar Math
« Reply #2 on: January 11, 2015, 02:35:42 am »
If you're trying to sense angular position or rotation with a non-contact device, there are magnetic sensors specifically designed to do this job.
 

Offline lgbenoTopic starter

  • Frequent Contributor
  • **
  • Posts: 349
  • Country: 00
Re: Cartesian to Polar Math
« Reply #3 on: January 11, 2015, 02:40:42 am »
Thanks for the responses, I agree with the comment on spherical coordinates, that gets me partially there except I'm thinking of changing the origin location an orientation of the axis to be centered about the axis of rotation.

About the mag rotation chips, I'm aware these exist except they are not sensitive enough for the distance I need to be away from the magnet.

The more I think about it, exactly what I want might not be possible unless I place the origin of my sensor somewhere on that axis of rotation
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf