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
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.
Interesting about the stepper encoders not being absolute. Kind of a bummer actually... Does make a simple initialize function seem like the better way to go then.
Did you consider a 360 degree servo ?
QuoteInteresting about the stepper encoders not being absolute. Kind of a bummer actually... Does make a simple initialize function seem like the better way to go then.Well there are industrial absolute encoders available and many would be no problem to wire up to an arduino, but their price can be pretty much a sticker shock. The fact that with one external sensor and one quadrature encoder, you can emulate a absolute encoder function in software, pretty much tells you which way you should proceed. As far as optical Vs magnetic encoders that is pretty much internal details of the encoder that doesn't much concern one, it's just a matter of the electrical interface method and getting the steps per revolution resolutions you require for your application. You might note that most encoders are specified as having X number of 'steps' per shaft rotation, but with standard software encoder decoding methods you can turn that into detection of X or 2X or 4X steps per shaft rotation. So a 100 SPR rated encoder you can resolve 100 or 200 or 400 counts per revolution just by the software decoding method used to decode the A and B encoder signals.Lefty
I have and am ordering one to test for other applications, but have been told that absent the position feedback (which none of the 360 servos I've found have) it won't work for this application. Am I mistaken?
Try to look for winch servo (they are used in model sailboats to control the sail).They can rotate 360 degrees ore more and and they have the same position control as "normal" servos .
A servo won't do what you want. Isn't a sail winch just a continuous rotation with a winch attached?You could go half steps which would give you 400 positions, you could use a gear train and come up with more positions.The hardest part is how do you handle the moves across 0 degrees. Not a major issue, just depends on how big the steps are that you would be sending to the stepper motor.Another thought - Power up the compass and assume that is 0 degrees. then have a mechanical cam, push a button and the compass is then zeroed. You could also sense when the compas has beeen zeroed, delay a bit and then move it to the proper heading.If the Arduino that is controlling the compass is recieving just degree numbers and moving the dial to position you should be able to keep the position correct for quite a while, no load, low speeds mean the stepper should have no problem keeping position without feedback.How much total rotation do you think you would have in one "flight"? If your number for compass position were a long you could do a lot of 360's before you ever hit overflow.Will your flight sim be sending position info in degrees? or degree step?