Go Down

Topic: Stepper Position Sensing and Control (Read 3 times) previous topic - next topic

Tom_G_2010

I am new to Arduino and to stepper motors, but I believe they are the solution to a part of my flight simulator project.  I need to simulate the magnetic compass that will be mounted on top of my instrument panel.  The motor needs very little torque since it will only be turning a small plastic disc, but precision as close to 1 degree as possible is important.  And, positional awareness, at least initializing it at start up, is critical.

My sim software will be able to feed the compass direction to the Arduino as a numeric value from 1 to 360 and I am finding a lot of code examples that seem  straight forward, IF, I can initialize the starting point when I boot up the sim.  That would be an ok solution.

I also started reading about steppers with position encoders built in and that got my attention since it might allow me to skip the initialization and simply drive the stepper to the correct position at any point in time.  However, I'm not finding any Arduino sketches or projects that leverage this position encoder functionality.

Any thoughts or direction on initial position set or use of a position encoder would be greatly appreciated!
Thanks!
Tom G.

permnoob

the lazy way is to just grab it and point it to north or some parked position at startup, and enjoy from there.  otherwise you need some reference location and a sensor/switch of some type

Tom_G_2010


the lazy way is to just grab it and point it to north or some parked position at startup, and enjoy from there.  otherwise you need some reference location and a sensor/switch of some type


The compass will be in an enclosure so unfortunately that's not an option.  So I am looking for ideas on an initial position sensor or a maybe more ideal a way to take advantage of the position encoders that some steppers have.
Tom G.

drone

If you just need a starting reference point, consider attaching a hall effect sensor to the housing, and a small magnet to the dial, such that the magnet is directly over the hall effect sensor at 360'.  Then, you can just move in either direction until the magnet is directly over the sensor at startup.

kf2qd

Some type of switch, either mechanical or hall effect. When the Arduino starts it rotates the dial until it senses the switch and then slowly backs up until the switch breaks and calls that 0 degrees. then you just send the arduino a position and let it move to that position. you will need to code for the 0-360 degree transition and how to handle going from 5 degrees to 355 and from 355 to 5.

Unless you buy an expensive encoder you will still have to go through an initialization routine as most encoders are incremental instead of absolute.

Go Up