step count or position of a stepper

hi all, i am looking for some help,ive built a loop transmiting antenna,with a wide spaced tuning capacitor to match the impeadance,im using an arduino and a motor shield to drive a stepper which turns the capacitor thr a reduction gear,ive used the stepper test sketch to move the motor,ive just removed all of the tests except the microstep routine,ii seems to take 90.000 steps end to end,at the moment all i do is set the transmit frequency and watch my antenna analyser as it sweeps then when it gets a match for that frequency,i pull the power from the arduino,crude but it works,what i would like to do is see how many steps the motor has been moved up to that point,could i press a button for instance and store that position,or see the steps elapsed via the serial monitor,all itt seems to do is state what its doing,ie not the number of steps that the motor has moved up to that point,any ideas?,cheers Paul m3vuv.

Whoa, there!

Take a deep breath, exhale and two minutes to think.

A little grammar, sentence punctuation and spacing may help to create something that the rest of us can read and understand.

Note that, if used properly, stepper motors move to the commanded position. No more, no less.

All you need is a home position of your stepper. Unless you can find an absolute encoder, what's unlikely or expensive, the stepper has to move into home position whenever the Arduino is started. Then you can count the steps from that position.

If the exact number of steps is unimportant, you can store the current position in EEPROM, and read it from there on startup. But when powered off and on, the stepper may be off by one or more steps, that's why this method is not very reliable. And it does not remove the need for a home position detector, so that the device can be re-calibrated when needed.

@paul_larner, please edit your Original Post and use paragraphs and proper spelling to make it understandable.

For the future please don't start a new Thread for what is essentially the same project. It is much easier to help if all the information is in the same place.

Perhaps you can click Report to Moderator and ask for the two Threads to be merged?

...R

Hi,

hi all,
i am looking for some help,
ive built a loop transmiting antenna,with a wide spaced tuning capacitor to match the impeadance,
im using an arduino and a motor shield to drive a stepper which turns the capacitor thr a reduction gear,
ive used the stepper test sketch to move the motor,
ive just removed all of the tests except the microstep routine,ii seems to take 90.000 steps end to end
at the moment all i do is set the transmit frequency and watch my antenna analyser as it sweeps, then when it gets a match for that frequency,i pull the power from the arduino,
crude but it works,
what i would like to do is see how many steps the motor has been moved up to that point,
could i press a button for instance and store that position,or see the steps elapsed via the serial monitor,
all itt seems to do is state what its doing,ie not the number of steps that the motor has moved up to that point,
any ideas?,
cheers Paul m3vuv.

Sorry Paul but in point format it is easier to read.
You can count the steps with a home and end limit switch as Dr Deittrich has said.
Each time you apply power the arduino would check to see if the cap/stepper is home position, if not it would reverse the stepper until the cap/stepper is home.

Tom... :slight_smile: