Shop OBEX P1 Docs P2 Docs Learn Events
H48 Demo Program Coordinates?? — Parallax Forums

H48 Demo Program Coordinates??

John AbshierJohn Abshier Posts: 1,116
edited 2006-10-10 02:57 in Propeller 1
It appears that +Z is down, +Y is toward the edge with 4 resistors and the perpendicular black thing and +X is toward the side with the data pin.· This is a right hand coordinate system.· If I rotate about the x axis (little black thing down), ThetaC increases as expected. With the sensor approximately flat, ThetaC is close to zero (actually 359).· However, ThetaB is 90 with the sensor horizontal.· I also changes in the wrong direction, i.e., a positive rotation about the Y axis decreases the angle.· I made the following chang to the code:

············· mov······ cx,···················· z_ 'x_····························· 'Get theta of ZX
············· mov······ cy,···················· x_ 'z_

This gave ThetaB=359 with the sensor near horizontal and positive increase in angle for increasing value of x or positive rotation about the Y axis.

Am I going in the right direction? Pun intended.

Comments

  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2006-10-10 02:57
    John,

    I think you are correct.· When I put together the demo, I was more concerned with getting an angle relationship between the three different axis.
    It's possible I got this relationship backward.





    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
Sign In or Register to comment.