Announcement

Collapse
No announcement yet.

Rev IMU Drive Code Always turning to -180 degrees no matter what it is told

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Rev IMU Drive Code Always turning to -180 degrees no matter what it is told

    My code for driving with the Rev's IMU always turns my robot to -180 degrees no matter what value I give it. Does anyone have any ideas on what is going wrong? (Photos of my code are attached)

  • Philbot
    replied
    Is your hub mounted horizontally? It needs to be to use the standard Z axis.

    Leave a comment:


  • SG11865
    replied
    Thank you. I'll try a few things at my teams meeting tomorrow.

    Leave a comment:


  • schaferbw
    replied
    The weight of your robot is a clue. Once it starts turning, the robot will tend to keep turning even if the power is set to zero when the target angle is reached and the braking option is set. You could try adding blocks that bring the power up to start the robot turning and then reduce it so it's turning slower when it teaches 90 degrees. Using 50, 60 or 70 degrees as the target angle may give you better results.

    A more complex alternative would be to use gears to increase the wheel axle torque and reduce the axle speed.

    Bruce

    Leave a comment:


  • SG11865
    replied
    I have already tried both of those. It can't turn at all with a lower power, as our robot is rather heavy and no matter what angle it's given.

    Leave a comment:


  • schaferbw
    replied
    Thanks for the clarification. Try lower power levels for the code that is trying to turn 90 degrees and let me know if it makes a difference. Also try changing the target yaw value value to 45 degrees.

    Bruce

    Leave a comment:


  • SG11865
    replied
    Goes straight for the time set, than turns to an angle (Relative to starting position) of negative -180. Aka backwards.

    Leave a comment:


  • schaferbw
    replied
    That worked. I've looked at your program and haven't found an obvious problem yet. I have to go out for a meeting. In the meantime, can you explain what you mean by turning to -180 degrees? Does it go approximately straight for a couple seconds and then turn around? Or, does it turn in place without going forward at all?

    Leave a comment:


  • SG11865
    replied
    Here's the drive link: https://drive.google.com/file/d/1_m0...ew?usp=sharing

    Leave a comment:


  • SG11865
    replied
    It says the file is too big. I can upload it to google drive and provide a link?

    Leave a comment:


  • schaferbw
    replied
    Unfortunately, the screen shots you provided a too low in resolution for me to read. Could you download your op mode as a BLK file and then attach it to a reply. If the Forum says it can't attach a BLK file you can rename the file so its file extension is TXT instead of BLK and I can change it back on my end.

    Leave a comment:

Working...
X