If the orientation of the module is rotated 90 degrees (headingwise), doesn't that make pitch and roll correct? For instance, if heading is nearly 0 (north) instead of 258 (close enough to west).Y is correct but P and R are switched
Actually, the resolution for the Euler angles for heading is a sixteenth of a degree, which is .0625, but in decimal you only have a resolution of about a tenth of a degree--that is, rounded or truncated, the number space is only filled at .0 through .9 (I'm not sure that's clear, but I'm not certain of the appropriate mathematical terminology).You don't need 4 decimal places, but that is the resolution which the module supplies
Did not get a chance to tell you how much we appreciated your patience and help with this project!Cheers,
Lance, thank you also for your ongoing help! Absolutely have not had any time to work on this project this week but hopefully down the road we can. Thanks again to everybody on the Forum, GrampsIf you want only degrees for heading, just don't print w4. No need for the IF statement, you can just say
and then just use Buzby's original:
Right. Or redefineAccording to the data sheet, w6 is ROLL (-90 to + 90) and w7 is PITCH (-180 to + 180). The order in the succession of Euler rotations is important.
symbol BNO_YAW = W5 symbol BNO_PITCH = W6 symbol BNO_ROLL = W7
symbol BNO_YAW = W5 symbol BNO_ROLL = W6 symbol BNO_PITCH = W7
Thank you for that tip! Hoping to experiment some more this afternoon or evening.According to the data sheet, w6 is ROLL (-90 to + 90) and w7 is PITCH (-180 to + 180). The order in the succession of Euler rotations is important
Thanks Lance appreciate the clarification!Right. Or redefine
Data logged thus far:Great. Now we want to see those numbers change in a rational way.
Read the calib_status register, it should read 255 when fully calibrated.
4865/16=304.0625 -- if actually at 45 degrees counter-clockwise should be 315.Yaw 45* to the left =4865.
Yaw Straight ahead =0
Yaw 45* to the right=961
#picaxe 28X2 #no_table #no_data ' BNO055 Test - V3 ' ----------------- symbol BNO_YAW = w5 ' b10, b11 symbol BNO_ROLL = w6 ' b12, b13 symbol BNO_PITCH = w7 ' b14, b15 symbol CalState = b4 symbol P_sgn = b8 symbol R_sgn = b9 ' Code starts here sertxd(cr,lf,ppp_filename," Starting ...",cr,lf) pause 1000 ' Setup I2C hi2cSetup i2cmaster, $50, i2cslow, i2cbyte ' Set BNO active hi2cOut $3D, ($0C) do ' Read chip ID hi2cin $00,(b0) ' Quit if chip ID wrong if b0 <> $A0 then : sertxd( "Bad comms !",cr,lf): reset : endif ' Read calibration state hi2cin $35,(CalState) ' Read Euler angles hi2cin $1A,(b10,b11) ' Yaw, 0 to +360 hi2cin $1C,(b12,b13) ' Roll, -90 to +90 hi2cin $1E,(b14,b15) ' Pitch, -180 to +180 ' Scale Yaw to 360' BNO_YAW = BNO_YAW / 16 ' Convert pitch to +/- value if BNO_PITCH > $8000 then P_sgn = "-" BNO_PITCH = 0 - BNO_PITCH else P_sgn = "+" endif ' Scale Pitch to 180' BNO_PITCH = BNO_PITCH / 16 ' ?? might need changing ' Convert roll to +/- value if BNO_ROLL > $8000 then R_sgn = "-" BNO_ROLL = 0 - BNO_ROLL else R_sgn = "+" endif ' Scale Roll to 90' BNO_ROLL = BNO_ROLL / 16 ' ?? might need changing ' Show results sertxd("Y=",#BNO_YAW,9,9,"P=",P_sgn,#BNO_PITCH,9,9,"R=",R_sgn,#BNO_ROLL,9,9) ' Show calibration state if CalState = 255 then : sertxd( "Cal OK") : else : sertxd( "Cal poor") : endif ' New line sertxd(cr,lf) pause 200 loop [\code]
Yes but BNO must be set in suspend mode (hi2cout $3E ,(%10) (supply current 12 mA → 40 µA.)Question can we put a battery on the 3 volt pin to keep the calibration?
Thanks for the code.Yes but BNO must be set in suspend mode
Roll: 0 to left +1 to +90 (at 90*) then heads back down to +0 at 180 *)what readings do you get as you do a full 360 degree roll?
I would suggest this is not worth the effort.... Question can we put a battery on the 3 volt pin to keep the calibration? ...
I'm not sure I'm understanding this. What readings do you get for the 8 points (rolling to the right through 360 degress): 0,45,90,135,180,225,270,315?Roll: 0 to left +1 to +90 (at 90*) then heads back down to +0 at 180 *)
At 180* it flips over to -negative numbers starting at -179 and returning to 0 at 360*
Start flat: 0* =+08 points (rolling to the right through 360 degress): 0,45,90,135,180,225,270,315?
Buzby, thank you again for solving the bno00559 DOF!how are you getting on ?.