### Author Topic: Gyroscope Electronics  (Read 1593 times)

0 Members and 1 Guest are viewing this topic.

#### stripboard

• Beginner
• Posts: 6
##### Gyroscope Electronics
« 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

#### dellagd

• Contest Winner
• Supreme Robot
• Posts: 730
• Come to the dark side... We have cookies!
##### Re: Gyroscope Electronics
« Reply #1 on: March 19, 2010, 11:07:37 AM »
If you only care about how far it has turned, why not use a electronic compass?
Innovation is a product of Failure, which leads to Success.

If I helped, +1 helpful pls

I Won!
3rd place! I'm taking \$100

#### waltr

• Supreme Robot
• Posts: 1,905
##### Re: Gyroscope Electronics
« Reply #2 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.

#### stripboard

• Beginner
• Posts: 6
##### Re: Gyroscope Electronics
« Reply #3 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

#### stripboard

• Beginner
• Posts: 6
##### Re: Gyroscope Electronics
« Reply #4 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!

#### dellagd

• Contest Winner
• Supreme Robot
• Posts: 730
• Come to the dark side... We have cookies!
##### Re: Gyroscope Electronics
« Reply #5 on: March 19, 2010, 04:46:31 PM »
so you ended up using the compass in the end?
Innovation is a product of Failure, which leads to Success.

If I helped, +1 helpful pls

I Won!
3rd place! I'm taking \$100

#### stripboard

• Beginner
• Posts: 6
##### Re: Gyroscope Electronics
« Reply #6 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

#### dellagd

• Contest Winner
• Supreme Robot
• Posts: 730
• Come to the dark side... We have cookies!
##### Re: Gyroscope Electronics
« Reply #7 on: March 20, 2010, 10:06:54 AM »
Well, compasses do work on the basis of 360 degrees in a cicle

Innovation is a product of Failure, which leads to Success.

If I helped, +1 helpful pls

I Won!
3rd place! I'm taking \$100

#### Soeren

• Supreme Robot
• Posts: 4,672
##### Re: Gyroscope Electronics
« Reply #8 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)
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Engineering is based on numbers - not adjectives

#### chelmi

• Supreme Robot
• Posts: 496
##### Re: Gyroscope Electronics
« Reply #9 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.

#### little-c

• Robot Overlord
• Posts: 186
##### Re: Gyroscope Electronics
« Reply #10 on: March 20, 2010, 01:32:24 PM »
in english its grade, grad is the abriviation on calculators. geeky side coming out.

#### chelmi

• Supreme Robot
• Posts: 496
##### Re: Gyroscope Electronics
« Reply #11 on: March 20, 2010, 06:08:13 PM »
in english its grade, grad is the abriviation on calculators. geeky side coming out.

Apparently both are valid: http://en.wikipedia.org/wiki/Grad_%28angle%29 :p

#### stripboard

• Beginner
• Posts: 6
##### Re: Gyroscope Electronics
« Reply #12 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

#### TrickyNekro

• Contest Winner
• Supreme Robot
• Posts: 1,207
• 1.6L Peugeot 307 tuner
##### Re: Gyroscope Electronics
« Reply #13 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...
For whom the interrupts toll...

P.S. I've been inactive for almost a year... Don't give promises but I'll try to complete my tutorials. I'll let you know when..

Cheers!

#### Soeren

• Supreme Robot
• Posts: 4,672
##### Re: Gyroscope Electronics
« Reply #14 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.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Engineering is based on numbers - not adjectives

#### Soeren

• Supreme Robot
• Posts: 4,672
##### Re: Gyroscope Electronics
« Reply #15 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
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Engineering is based on numbers - not adjectives

#### TrickyNekro

• Contest Winner
• Supreme Robot
• Posts: 1,207
• 1.6L Peugeot 307 tuner
##### Re: Gyroscope Electronics
« Reply #16 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...
For whom the interrupts toll...

P.S. I've been inactive for almost a year... Don't give promises but I'll try to complete my tutorials. I'll let you know when..

Cheers!

#### stripboard

• Beginner
• Posts: 6
##### Re: Gyroscope Electronics
« Reply #17 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