Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: stripboard on March 19, 2010, 10:25:01 AM

Title: Gyroscope Electronics
Post by: stripboard on March 19, 2010, 10:25:01 AM
Hello,

I'm new to robots, so I'm looking for a bit of help here;

I'm currently designing a semi-autonomous vehicle; i.e. you give it a set of instructions and it goes off and does them.

One of the instructions I want to give it is to turn through a certain angle; i.e. LEFT 90 (degrees). I can't take a rotational measurement from the wheels, so I want to use a gyroscope (piezo-electric or similar). The thing is, I don't know how they work.

From what I've read so far, am I right in saying they work as angular accelerometers? Do they output a given number of volts per degree per second? If I integrated the output over a given period of time, would that voltage tell me the angle through which the gyroscope has rotated?

What I *really* want is a gyroscope circuit that outputs a pulse every time it turns through one degree - that way, by counting the pulses, the vehicle will know how far it's rotated. Before I go trying to invent it, has it already been done?

Any help or advice would be much appreciated.

Thanks :)
Title: Re: Gyroscope Electronics
Post by: dellagd on March 19, 2010, 11:07:37 AM
If you only care about how far it has turned, why not use a electronic compass?
Title: Re: Gyroscope Electronics
Post by: waltr on March 19, 2010, 02:31:50 PM
Quote
From what I've read so far, am I right in saying they work as angular accelerometers? Do they output a given number of volts per degree per second? If I integrated the output over a given period of time, would that voltage tell me the angle through which the gyroscope has rotated?
In theory yes, in practice its a bit more complicated to get a precise angle.
Title: Re: Gyroscope Electronics
Post by: stripboard on March 19, 2010, 04:05:03 PM
Hello,

  thanks for the replies...

  Why is it difficult to get a precise angle?  The one gyro I've found a spec for gives 1.69mV/degree/second - I would have thought you could integrate a fairly accurate angle-turned measurement from that, somehow?

  An electronic compass is an intriguing idea - do you know much about them?


  Thanks again :)
Title: Re: Gyroscope Electronics
Post by: stripboard on March 19, 2010, 04:20:27 PM
I've just looked for electronic compass components and Rapid Online (UK) sell a compass module based on the KMZ512 field sensor that outputs a heading via PWM or an I2C bus, which is jolly handy seeing as I'm planning to use a PICaxe as my processor.

Thanks!

:)
Title: Re: Gyroscope Electronics
Post by: dellagd on March 19, 2010, 04:46:31 PM
so you ended up using the compass in the end?
Title: Re: Gyroscope Electronics
Post by: stripboard on March 20, 2010, 03:45:20 AM
I'm still at the planning stage - I need to figure out how I can take the output from a compass and convert it into a degree of turn...I also need to check that the motors in the vehicle won't affect the field sensors...but it looks like it might be simpler than the gyroscope method.

Any other ideas will be much appreciated :)
Title: Re: Gyroscope Electronics
Post by: dellagd on March 20, 2010, 10:06:54 AM
Well, compasses do work on the basis of 360 degrees in a cicle

Title: Re: Gyroscope Electronics
Post by: Soeren on March 20, 2010, 11:47:51 AM
Hi,

Well, compasses do work on the basis of 360 degrees in a cicle
If not measured in eg. new degrees (400° a full circle) or radians (2p or ~6.28 in a full circle)
Title: Re: Gyroscope Electronics
Post by: chelmi on March 20, 2010, 12:45:52 PM
Hi,

Well, compasses do work on the basis of 360 degrees in a cicle
If not measured in eg. new degrees (400° a full circle) or radians (2p or ~6.28 in a full circle)

I believe new degree is called grad or gon in English speaking countries, or grade in French.
Title: Re: Gyroscope Electronics
Post by: little-c on March 20, 2010, 01:32:24 PM
in english its grade, grad is the abriviation on calculators. :P geeky side coming out.
Title: Re: Gyroscope Electronics
Post by: chelmi on March 20, 2010, 06:08:13 PM
in english its grade, grad is the abriviation on calculators. :P geeky side coming out.

Apparently both are valid: http://en.wikipedia.org/wiki/Grad_%28angle%29 (http://en.wikipedia.org/wiki/Grad_%28angle%29) :p
Title: Re: Gyroscope Electronics
Post by: stripboard on March 21, 2010, 03:07:23 AM
You're quite right about the whole 360 degrees in a circle thing there - well done :)

What I meant was the compass modules I've looked at so far give out a PWM signal based on their rotation away from N (for example, a mark:space ratio that alters by 16uS per degree of rotation past North plus a 1mS offset) - so I'd have to calculate the difference between the start position and the end position of the rotation, which would be complicated by going through North, as the PWM signal would effectively reset.

Surely somebody must have done this before - do I really have to invent it myself?

Thanks :)
Title: Re: Gyroscope Electronics
Post by: TrickyNekro on March 21, 2010, 06:23:49 AM
Hi,

Well, compasses do work on the basis of 360 degrees in a cicle
If not measured in eg. new degrees (400° a full circle) or radians (2p or ~6.28 in a full circle)

I believe new degree is called grad or gon in English speaking countries, or grade in French.

It's about countries using S.I. or not... still I'm not sure...
Grad is also a mathematical Operator...
anyways... it's about understanding what you mean... anything else is symbols...
Title: Re: Gyroscope Electronics
Post by: Soeren on March 21, 2010, 12:08:36 PM
Hi,

anyways... it's about understanding what you mean... anything else is symbols...
Comprehension goes through symbols in one way or another, whether related to "a priori" or "a posteriori" knowledge.
If the symbols goes wrong, there's a good chance the comprehension follows.
Title: Re: Gyroscope Electronics
Post by: Soeren on March 21, 2010, 12:39:25 PM
Hi,

What I meant was the compass modules I've looked at so far give out a PWM signal based on their rotation away from N (for example, a mark:space ratio that alters by 16uS per degree of rotation past North plus a 1mS offset) - so I'd have to calculate the difference between the start position and the end position of the rotation, which would be complicated by going through North, as the PWM signal would effectively reset.
That shouldn't be too hard.
Lets say you're going straight East and want to turn 112.5° left (i.e. to NNW).
Straight East, 90° is (1ms + 90*16µs) =  2.44ms
Full circle + (present position + or - wanted degrees)   (Turning left you subtract and turning right you add).

So, 360° + (90°-112.5°) = 337.5°
To keep it within 0 to 360, even if you added (turning right) you MOD (= get the remainder from an integer division) the number by 360
MOD(360° + (90°-112.5°)), 360 = 337.5°

337.5° is (1ms + 337.5*16µs) = 6.4ms
So, you want to turn until the PW is increased by (6.4-2.44) = 3.96ms

You would want to integrate several samples of the measurements, to make sure you have the correct direction.


Turning right the same amount would take you to:
MOD(360° + (90°+112.5°)), 360 = 202.5°


Surely somebody must have done this before - do I really have to invent it myself?
Doesn't the datasheet have some examples?
Anyway, it's the experiments that makes it fun ;D
Title: Re: Gyroscope Electronics
Post by: TrickyNekro on March 21, 2010, 01:02:19 PM
Hi,

anyways... it's about understanding what you mean... anything else is symbols...
Comprehension goes through symbols in one way or another, whether related to "a priori" or "a posteriori" knowledge.
If the symbols goes wrong, there's a good chance the comprehension follows.


I agree on some degree... symbols can vary from book to book... but units must be the same....
And usually... units have certain symbols, most of them being only with one letter in SI
and more letters are used in special occasions.

But we must also understand that this is a multicultural site - forum thus some may use SI and some not...
So it's best to define what you are talking about and use the most accepted symbols...

Amen...  :D
Title: Re: Gyroscope Electronics
Post by: stripboard on March 23, 2010, 11:05:35 AM
Thanks Soeren :)

  the datasheet may well give some examples, but I haven't bought the unit yet.

  The maths you've gone through is very helpful, though.

  All the best :)