Windows Release 2016.01.30.00

 
#1

Changes:

- MPU9150 (All-In-One) sensor update

  Get EZ-Builder for Windows

#2

wooHoo! Compass and temperature both working. compass still a little jumpy, but hovers right around the actual direction it is pointing. I can definitely make this work.

Now I need to start working on how to script 45 and 90 degree turns. Easy except where I cross the 360/0 boundary. Calculating the heading is easy, but measuring that I have reached it I need to think about a bit.

Alan

#3

This may help @Alan... I wrote it years ago for a robot that followed a GPS to a waypoint... Maybe it might help you? Or not LOL Smile I cleaned it up for ez builder but it may be of no use with the compass. Maybe you can adapt it somehow?...

Code:


# $wp1 = desired heading
# $tr1 = current heading
# twp = number of degrees to rotate

$wp1 = 90
$tr1 = $CompassHeading

repeatUntil($wp1 = $tr1)
$tr1 = $CompassHeading #update the compass
IF($wp1 < $tr1) #calculate the shortest direction of turn to waypoint bearing
$twp=360-$tr1+$wp1
ELSE
$twp=$wp1-$tr1
ENDIF

IF($twp <= 180) # 'move right
right() # more code may be needed here
ELSE # 'move left
left() # more code may be needed here
ENDIF
sleep(100)
endrepeatuntil

#4

Thanks @Richard. This is very similar to what I was thinking of doing, but has triggered some additional ideas.

Alan

#5

Hi Richard,
This is similar to my need also. Thanks for posting it.

Hi Alan,
I am interested in seeing your ideas also, once developed.

Ron R

#6

Hello All,

I purchased an mpu9150 on line and it appears to be working per the lattest tutorial, etc. I have an adventure bot and not sure how to mount and calibrate it on the robot? I have included a photo of how I have it mounted and was wondering if this will work for proper compass readings. Also I watched video on how to calibrate an iphone compass but not sure how this relates to my adventure bot and where the sensor board is located. Maybe someone with an adventure bot or other robot with this sensor board may have some ideas or a video?
User-inserted image

Thanks much ! Rick
Smile Smile Smile

#7

That is a good location for it. I had mounted mine on the front, above the wheel servos, and the motors generate enough magnetic interference that it is not as accurate as it could be. I think I'll try moving to the back like this as well.

To calibrate, you do it just like an iPhone or Android phone. With the compass control active, pick up the robot and move in a figure-eight pattern. (this is going to be tricky when I mount on my robot dog that is going to weigh ~90 lbs. I may need a different solution by the time I get it built...).

Alan

#8

Hello Alan,

Thanks for the reply ! I've searched on you tube and have found several methods to calibrate the iphone compass.

With the compass in the location it is at how do I initially hold it when starting the calibration? Does it need to be held flat with the sensor board to the right and would north be zero degrees once it is calibrated properly? Thanks much Alan ! Rick Smile Smile Smile

#9

It doesn't matter how you hold it to start. It is the figure 8 movement that matters.

Yes, 0 degrees will be north when you are done.

Alan

#10

@Alan,
I assume the figure 8 needs to be done on the Horizontal plain?