Asked — Edited
Resolved Resolved by DJ Sures!

4 In One Orientation Sensor

I have purchased a 4 in One Orientation Sensor. My desire is to use the compass function.

Once loaded and running, I view the compass heading values in the Variable watch window.. The value fail to read correctly. I find when I set the device in 90 degree directions ( 0 - 90 - 180 - 270 - back to zero ) I get value that do not even come close to the set position., nor do they repeat. I have changed my location, and even tried it in a wooden shed without any potential magnetic interferences, and still it did not work.

Has anyone use this sensor and has been able to get it to display correctly?

My reason for buying this was for the compass only and I am disappointed to see it not work.

Ron R


ARC Pro

Upgrade to ARC Pro

Become a Synthiam ARC Pro subscriber to unleash the power of easy and powerful robot programming

#41  

Quote:

I might think of an EZ-Script command to throw in that will perform a range check between two degrees - should be useful for your needs. Let me think on that...

yes, that would be helpful I think. I was going to use a if $bearing <= $heading (or >= depending on which way I am turning), but being able to have a target range would probably be better. Will have to figure out what happens when I cross the 0/360 boundary to keep from turning to far. Figuring out the target $heading (ie $bearing) is easy, but knowing I have hit it trickier. For instance, if I am at 270 and my new target is 5, I need to keep going until I am greater than 360, and then continue until I am up to 5, so probably move in two steps instead of one. I'll figure it out.

Alan

#42  

Ok @DJ, I followed your advice and look only at the heading variable. However, the heading value don't change when I rotate the sensor, but only when I roll it...

#43  

Hi Alan,

I was wondering about converting 360 degrees to 1 to 179 positive and 181 to 359 as 1 to 179 negative numbers. 0 and 180 unsigned. This would allow the numbers to become directional. I haven't fully thought it thru, but what do you think? It should simplify the math?

Ron R

I forgot to mention invert the numbers, i.e. count + 177, +178, +179,180, -001, -002,-003, etc. 180 for example = South 0=North

#44  

Hi Dj.

I know it took a lot of work to get it right. Thanks very much ! I am sure many of us will put it to good use.

Ron R

#45  

I have been following this thread and decided to try the compass for myself. Perhaps I've missed something, but from what I've tried, the compass only seems to work when it is in a vertical position. Even then, it has to be turned in a circle, edgewise, for the readings to work out for 360 degrees. Is this correct?

I have calibrated it flat by putting it in the slot between JDs legs and again vertically by putting it in the chest slot. When flat it does nothing as I turn JD. In the chest, it only works when I tilt JD side to side.

PRO
Synthiam
#46  

WBS, you need to calibrate the sensor. View the ARC manual page for a video demonstrating.

#47  

I did calibrate it, twice. All according to the tutorial and the video in it. As I said above:

Quote:

I have calibrated it flat by putting it in the slot between JDs legs and again vertically by putting it in the chest slot
Did the figure-8 thing and all. That seemed to go well. Ran the calibration once when I placed the sensor in the flat position, and ran it again when I placed it in the chest. When the chest position didn't work either, I put it back in the flat position and ran the calibration yet again. It works in both positions but only when I turned JD such that the board is upright (vertical) and rotated the robot such that the sensor board was turning in a circle with the edge of the board leading the way. Only then did the pointer in the control rotate appropriately, 360 degrees. If I rotated JD around the vertical (Z) axis while he is standing, the pointer did not move.

#48  

Hi @WBS00001,

I just tried it again with the new release. I started the init script., Hit the calibrate button and move it as was requested. Once the time zeroed, I placed the sensor flat on my desk. Rotating it on the horizontal plane I got the readings. I placed the sensor in three stacked ez blocks and found I could angle the sensor about 45 degrees from horizontal and still have it read. If you get to close to the ezb it seems unable to work correctly.

Ron R

User-inserted image

User-inserted image