Show Posts
Pages: [1]
1  Using Arduino / Project Guidance / Re: Replacing the headers on a Mega. Can it be done? on: October 18, 2014, 09:05:47 pm
Thanks for the ideas everyone!

I'm off to do more experiments... 
2  Using Arduino / Project Guidance / Replacing the headers on a Mega. Can it be done? on: October 18, 2014, 11:23:48 am
I am working on a project that will use a Mega and I am experimenting with various methods of wiring it into my project box.

At present I am soldering all my wires into a prototyping shield ( ) and piggy backing that on the Mega which is mounted in the box.  This works very well electrically but presents a couple minor issues mechanically and aesthetically due to the volume of wires.

It occurred to me that I could solve the mechanical and aesthetic issues if the headers of the two boards were reversed, so that the Mega piggybacked onto the prototyping shield.  I could then mount the prototyping shield into my project box and neaten up the wiring in a fixed position and then plug the Mega into it.

So this brings me to a few questions:

1. Has anybody ever done anything like this?

2. I am more than competent at soldering but I haven't attempted any mods on an Arduino card.  What are peoples thoughts on the survivability of the mega board when I de-solder all the headers and replace them with stacking headers?

3. The reason for using the prototyping shield is twofold: A. It is impractical and more subject to error to use individual pin jumpers given the volume of wiring and the fact that the board will need to be removed occasionally; B. The project box will be subject to some vibration while in use or transport and I suspect that this will lead to conventional pin jumpers dislodging from the headers.  Given those issues how else have people dealt with this when using a Mega?

Thanks in advance for any feedback, thoughts, or ideas!
Tom G.
3  Using Arduino / Motors, Mechanics, and Power / Re: Stepper Position Sensing and Control on: February 01, 2013, 09:31:13 am
Thanks for all the input.  Several weeks back I ordered a 0.9 stepper motor, a Seeed motor shield, and an optical sensor.  I have the basic code started and I'm fabricating a heading wheel to mount on it that will also trip the optical sensor at a calibration point.

The wiring of the motor is basic enough and I have that taken care of.  Likewise the wiring of the optical sensor.  The basic code to run the motor is easy enough as is the code to do the calibration.  I have almost everything either working on my test bench with one exception.

That exception being the continuous rotation past North in either direction.  Not a show stopper, but I just haven't come up with a satisfactory way to deal with it yet.  The flight sim software feeds me a compass bearing in the form of 1 to 360 degrees.  I am reading the changes and doing the simple math to move the stepper from prior read to current read by the calculated number of steps.  In most cases the step is no more that 1 or 2 degrees in either direction, but on occasion either do to high rates of turn or program lag the steps can be slightly bigger.

So I am trying to come up with the best way to deal with crossing North where the prior read might be 359 and the current read is 001, or in the other direction, the prior read might be 002 and the current read 360.  I need the first to calculate +2 and the second to calculate -2.


As for gauge or part sources, I have purchased several parts from bone yards, but not gauges.  My sim is somewhat generic and will emulate about 6 different aircraft.  As such the variation in operating ranges needed on the gauges makes hardware based gauges somewhat problematic unless I can come up with easily interchangeable face plates.  As such I am only looking at mechanical gauge builds for a very limited portion of the sim, the Wet Compass being one of them.

Tom G.
4  Using Arduino / Motors, Mechanics, and Power / Re: Stepper Position Sensing and Control on: December 06, 2012, 09:02:27 am
Check this link: The video there shows a $5 stepper with a reduction gear that takes thousands of steps for a full rotation. Might be worth a look for a $75 saving.

WOW!!!  Inexpensive, smooth, precise!!  Perfect!

I think I'll drop a hint to the wife so that Santa has some stocking stuffer ideas...

5  Using Arduino / Motors, Mechanics, and Power / Re: Stepper Position Sensing and Control on: December 05, 2012, 04:01:22 pm
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 .

I just looked at the winch servos and because they are still limited in the number of rotations they will not work for this application.  On a long multi leg flight in bad weather with heavy traffic it is possible to be stuck in holding patterns (oval track loops) at length so any limit on the number of turns would not be realistic.

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?

I did find one servo for about $80 us that had 0.337 degree steps so about 3 steps to a degree.  A bit pricey but not out of reach.

I need to double check the interface app but I believe I am getting heading info as integers from 1 to 360.  Having given this more thought, absent absolute position feedback, I am leaning towards an initialization routine using an optical sensor to bring the compass disc to zero and then read the initial aircraft heading and step the motor x steps to align with the actual heading value.  From there I can keep track of the last heading value read and compare it to each subsequent value to step the motor as needed. I may also add a sync button so I can trigger the initialization at any time should errors start to accumulate and throw off the heading.  I don't think crossing zero will be an issue as I can work out the math/logic programmatically.
6  Using Arduino / Motors, Mechanics, and Power / Re: Stepper Position Sensing and Control on: December 05, 2012, 08:16:08 am
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.

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.


Funny you should mention sticker shock.  What got me started down this road was just that, sticker shock when I looked at purchasing a prefabricated simulated aircraft compass and found they cost between $500 and $700 US.  That said, the lower the cost the better, but I suspect there are many options that would put me well below that mark.

I wonder if you might know of any such steppers absolute encoders that you could point me to as an example?  That would allow me to access the cost/benefit as compared to likely less costly options.

7  Using Arduino / Motors, Mechanics, and Power / Re: Stepper Position Sensing and Control on: December 05, 2012, 08:01:45 am
Did you consider a 360 degree servo ?

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?
8  Using Arduino / Motors, Mechanics, and Power / Re: Stepper Position Sensing and Control on: December 04, 2012, 01:38:35 pm
I understand how hall sensors work, but don't have any hands on experience with.  I have however worked with opitcal sensors.  I'll have to look at both and see which one I can get the most precision from.

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.

Any suggestions on motors?  Most are either 1.8 or 0.9 degree steps so I wasn't sure about accuracy on a compass display.  Can they be held between steps to get at least close 1 degree accuracy or should I be looking at a some of the more expensive 0.36 steppers?
9  Using Arduino / Motors, Mechanics, and Power / Re: Stepper Position Sensing and Control on: December 04, 2012, 10:53:49 am
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.
10  Using Arduino / Motors, Mechanics, and Power / Stepper Position Sensing and Control on: December 04, 2012, 09:13:01 am
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!
Pages: [1]