Heading control with PID

Hi,

Working with UNO.

Very new to Arduino but looking for some advice.

I'm wanting to control the heading of an round disc which is supported in the middle. Disc is on the horizontal and the heading controlled by a tiny fan on the outer edge of the disc which will rotate in either direction to adjust the heading.

I have bought a very basic started kit with includes a compass and accelerometer. Bought a very small fan too which is suited to UNO.

Looking for examples of how to achieve this and eventually my plan is communicate via 232 or Bluetooth where you input the desired heading and it gently goes to it.

Any help with components, code.....that would be much appreciated. Where do I start?

Cheers very much

DG

I suggest you start with a simple program that can run the fan for (say) 5 seconds in each direction.

Then extend the program so that can run the fan at different speeds.

Then another program to get data from the compass and accelerometer and display them on the Arduino Serial Monitor.

Have a look at Planning and Implementing a Program

And for receiving data on your Arduino have a look at the examples in Serial Input Basics - simple reliable ways to receive data.

...R

Great stuff,

Thanks for your help there.

D.

The compass can be used to determine the heading, but it unfortunately won't work "out of the box" and must be calibrated. Here is a great overview on how to do that.