Shop OBEX P1 Docs P2 Docs Learn Events
Hitec HG-R01 Robot Gyro — Parallax Forums

Hitec HG-R01 Robot Gyro

GeorgeCollinsGeorgeCollins Posts: 132
edited 2009-08-30 22:50 in Robotics
Has anyone used a Hitec HG-R01 Gyro?

www.robotshop.us/hitec-hg-r01-robot-gyro-3.html

I think it is made for RC helicopters, but a single axis gyro with a pulse width out is very appealing to me. I have been using a HB-55 compass on my smaller quadruped, but apparently the size of the motors or the wiring of the larger quad is causing a lot of magnetic interference. A gyro would allow me to keep the quad on a straight line. My biggest problem in the walker race at robogames was keeping my walker on a straight line over uneven ground!

Has anyone used one of these? I googled for sample code but could not find any. If anyone has used it with a prop, or a stamp, it would be very helpful to know, particularly if you have a code example.

Thanks,

George

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Robots

Comments

  • SRLMSRLM Posts: 5,045
    edited 2009-08-22 03:23
    If it sends pulses it's probably just a measure of the pulse width, with 1.5ms to be zero rotational speed, and 1ms and 2ms the extremes.
  • GeorgeCollinsGeorgeCollins Posts: 132
    edited 2009-08-23 01:12
    Yeah- it seems like it would be really easy to use, but I can't find a datasheet even. It has a red light and a green light, and I cannot tell you what that is supposed to be for.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Robots
  • SRLMSRLM Posts: 5,045
    edited 2009-08-23 03:14
    If you're willing to go analog, here is a nice gyro. Cheaper too.

    store.diydrones.com/ProductDetails.asp?ProductCode=BR-0005-10
  • GeorgeCollinsGeorgeCollins Posts: 132
    edited 2009-08-23 14:55
    Thank you for the link- another interesting parts site. I am not sure an analog gyro is really a savings, because I would need to add an A/D converter. I use Prop Chips, so I definitely could do that. Something that plugs into a servo jack is extremly appealing because I am already using a bunch of hobby servos and ping sensors that have similar interfaces.

    I notice that their is a GWS PG-03 gyro that is very similar, and cheaper, that a guy named "Ole Man Earl" here says he has used on his bots. At least that would be one that someone tried successfully.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Robots
  • GeorgeCollinsGeorgeCollins Posts: 132
    edited 2009-08-27 05:21
    Well the GWS PG03 came today. And after fiddling with it this evening I can confirm it works. With a prop you need to have a cog doing a pulseout to emulate an RC receiver, and another cog measuring pulse width in. So this is definitely not something you could do with a Stamp. In fact I bet this would be very hard to do with most micro controllers, but took a couple hours to get running with a Propeller Chip. I love the Propeller, it just works.

    My first impression is that the gyro is very sensitive to small movements. That's probably great for balancing a two wheeled robot, but I am not sure how well it will work at maintaining a bearing on a lurching quadruped. Well I have my project to find out!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Robots
  • TimmooreTimmoore Posts: 1,031
    edited 2009-08-27 05:33
    I found gyros tend to drift and compasses tend to have problems with motors nearby. I have had some success by using both and running both through a kalman filter it seems to merge the 2 without either downside.
  • SRLMSRLM Posts: 5,045
    edited 2009-08-27 10:42
    GeorgeCollins said...
    Well the GWS PG03 came today. And after fiddling with it this evening I can confirm it works. With a prop you need to have a cog doing a pulseout to emulate an RC receiver, and another cog measuring pulse width in. So this is definitely not something you could do with a Stamp. In fact I bet this would be very hard to do with most micro controllers, but took a couple hours to get running with a Propeller Chip. I love the Propeller, it just works.

    You could do this in the background or foreground with only one cog. A cog at 80MHz can do 20 million instructions, so timing and pulsing at the same time is no problem. You could also probably use counters to automate the process.
  • GeorgeCollinsGeorgeCollins Posts: 132
    edited 2009-08-29 23:31
    You are right of course, in that you could send and measure the pulse width on the same cog. However, I am running this on walking robots that already use 9-12 servos, so having it isn't like I wouldn't have one cog doing pulse out anyway. But I take your point and it may make sense to combine this.

    As I experiment more I am getting hopeful that using the gyro may work for logging heading. My initial mistake was to treat the variance in pulse width like a first order derivitive of changes in heading instead of a second order one. In other words-- and in case I am saying this incorrectsly-- I expected a nudge to the left to cuase a variance in pulse width corresponding to the change in heading. The change in pulse width is really the angular acceleration. Since a walking robot never just spins around, every angular acceleration is matched by an agular deceleration. So finding the heading will require measuring the time and direction of acceleration. It may not end up being that accurate with all the shaking on the walker, but we will see.

    Thanks SLRM for your advice.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Robots
  • SRLMSRLM Posts: 5,045
    edited 2009-08-30 00:24
    I believe a gyro measures angular rate (not acceleration or position).
  • GeorgeCollinsGeorgeCollins Posts: 132
    edited 2009-08-30 22:36
    angular rate of what?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Robots
  • SRLMSRLM Posts: 5,045
    edited 2009-08-30 22:50
    rate == speed, the speed that the gyro is turning on the axis.
Sign In or Register to comment.