Multiple turn motor position control

Hi,

At the outset, I am posting in this forum because members here seem to have the best grasp on stepper motor control drivers. I need to drive a vacuum variable capacitor with a motor. From it's lowest to highest capacitance, the capacitor goes through several turns. Trying to rotate the rotor of the capacitor beyond those limits can damage it. So my first requirement is to limit the number of turns on either side given the motor is calibrated to start at the middle. For the same constraint, another question is if the driver circuit "knows" how many turns and degrees, can the information be retained when the circuit is powered off?

Thanks.

There is a difference between a motor "driver" and a "controller". The driver is usually un-intelligent, converting logic signals to high voltage/current necessary for the motor. The controller is where the brains are. In the Arduino world the controller is usually the Arduino itself, which has non-volatile storage in the form of EEPROM. Drivers generally do not keep track of absolute position.

So it is possible that an Arduino + stepper motor driver (like ours or others) can meet your need. You will have to write a sketch for the Arduino that keeps track of the position and occasionally updates the EEPROM so that when the power is lost, the position is retained. You should not update on every step as that could burn out the EEPROM (it's only rated for ~1million erasures and you can easily reach that if you write it on every step). But writing once every 10 seconds or so should be fine.

Alternatively, you can keep track of absolute position using an absolute encoder but that is starting to run into some big money. Avago has some that output SPI-type data, but they are >$20.

--
The Ruggeduino: compatible with Arduino UNO, 24V operation, all I/O's fused and protected

Thanks. I think you answered my fundamental query that such control/logic is possible. Sorry, for getting the technical terms wrong. I will research the Arduino option further.

A quick look at the encoder option seems to suggest that since the encoder records only 0 to 360 position information, the absolute position of the capacitor would still need to be recorded on some sort of EEPROM. Right?

Found an interesting way to keep track of number of turns/position.

From what I understand, a pot shaft is coupled to the motor. Voltage drop across pot is fed back to arduino through a ADC that translates to a value between 1 to 1023 and that gives the motor position. Am I understanding is correctly? Sorry, not really an electronics person, though can write C/perl :slight_smile:

Does this look like a practical solution? Only hitch is my capacitor shaft turns 73 times between it's lowest and highest capacitance :slight_smile:

RuggedCircuits:
You should not update on every step as that could burn out the EEPROM (it's only rated for ~1million erasures and you can easily reach that if you write it on every step). But writing once every 10 seconds or so should be fine.

While in practice you shouldn't constantly update the EEPROM as it -does- have limited write cycles, people have done destructive tests of this nature, and it turns out that it really isn't as terrible as most would think. Not that, if you did do this, that you could really trust it in the long term to work - but it isn't "poof-dead" after 1 million writes...

:slight_smile:

sandhuatard:
Found an interesting way to keep track of number of turns/position.
http://www.migamotors.com/Media/MigaOne-Arduino-v2c.pdf

From what I understand, a pot shaft is coupled to the motor. Voltage drop across pot is fed back to arduino through a ADC that translates to a value between 1 to 1023 and that gives the motor position. Am I understanding is correctly? Sorry, not really an electronics person, though can write C/perl :slight_smile:

Does this look like a practical solution? Only hitch is my capacitor shaft turns 73 times between it's lowest and highest capacitance :slight_smile:

Have you thought about using the changing value of the capacitor as the means to measure its position?

There are various methods, but a common one involves measuring the time it takes to charge via a resistor (RC time constant, IIRC):

http://www.nxp.com/documents/application_note/AN449.pdf

:slight_smile:

Regarding my last post - check out this thread: Arduino Forum

It may be helpful...

cr0sh, I appreciate your responses. The idea of measuring capacitance to determine capacitor position is simple and straight-forward but in my application, it may not apply or be difficult. I think explaining the application will help. The vacuum variable capacitor is in parallel with a 4' diameter copper pipe loop that behaves as a HF transmitting antenna. The antenna is to be placed outdoors and it is desirable that it be portable and not require a computer to control.

The capacitor, say at 100W RF power, can develop ~4kV of voltage and ~30A of current. The loop antenna is very sensitive to ohmic losses such that even as much as ten milliohms of loss can cause 5-6% drop in antenna efficiency. Introducing a capacitance measuring circuit across the capacitor would mean using some sort of relays to disconnect the capacitor from the loop and connect to measuring circuit. At these currents and voltages, relays will add losses and increase costs. Also, if the measuring circuitry is exposed to such high voltages, say when discharging the capacitor, it can destroy the measuring circuitry.

So I think a mechanism that mechanically couples with the capacitor, IMHO, is better suited to track rotations. This is what I understand from researching various options so far. Since I am not an electronics person, I could be way off the mark here so would appreciate corrections :slight_smile:

Only hitch is my capacitor shaft turns 73 times between it's lowest and highest capacitance

That is your main snag with using any sort of pot or rotary shaft encoder.
What I would do is to set up another motor (or a mechanical connection to your shaft) that consists of a threaded rod with a captive nut on the end. Every time you pulse your capacitor's stepping motor you step this slave motor.
Then arrange limit switches on this to detect the both ends of the travel.
It's like having a mechanical memory.

Use gears!
Use a couple of gears between the capacitor knob and the potentiometer to reduce the number of turns. Then you can use a 10-turn potentiometer (which are fairly easy to find) and read it via analogRead().

From it's lowest to highest capacitance, the capacitor goes through several turns.

what level of resolution is needed. Servos might be an answer. There are winch servos that make several turns, and gearing up of a standard servo might be an option.

ckiick:
Use gears!
Use a couple of gears between the capacitor knob and the potentiometer to reduce the number of turns. Then you can use a 10-turn potentiometer (which are fairly easy to find) and read it via analogRead().

I have seen 10-turn pot based rotation sensors. The cap has 73 turns but let's just say 70. The capacitance range is 7.5-350pF so if the change is linear, we have ~4.9pF / turn. On lower broadcast frequencies, at around 7 Mhz, the required stepping is 1pF so we want the capacitor shaft to be turned in 1/5th or 72 degree turns. Cap to pot, that is 70 to 10 turns, let's say we use a 7:1 reduction gear. Now, pulse the motor to turn the cap 72 degrees. That should turn the pot about 10 degrees. Is that sufficient change in resistance to cause a measurable voltage change for the ADC?

@Grumpy_Mike - With the limit switch arrangement, how do I remotely read the capacitor position?

Mike-
Are you proposing using the second motor as an encoder?

I would think if you used a stepper motor there would be no need for an encoder. With such a light load there should be no problem with missed steps. It would be necessary to have a homing routine to establish the initial position at startup, though. Limit switches would be a good idea to prevent damage to the capacitor in case of an overtravel event.

You read the capatance by knowing how many steps you have given the motor. The only problem is having a reference point for your motor as once you loose the power you loose the knowledge of the absolute position. A simple mechanical stop won't work as you have multiple turns, therefore you need to translate something into a reference point that you can detect.
You could do this with gears, or a mechanical analog like I suggested before.

OK, I see the problem. What if you introduced a threaded shaft with a moving nut between the stepper motor and the capacitor to trip the home switch? The motor homes to said switch on start up giving an initial position just as a CNC machine would do.

Another alternative would be to use a double shafted motor and connect a 10 turn pot to one shaft. No gears needed.

So how is a 10 turn pot going to help when the total travel of this motor is 70 turns???

Presumably, trying to move the capacitor beyond the limits of its travel will only damage it if you apply excessive force. Can you limit the stepper motor drive current so that the force is sufficient to move the capacitor but insufficient to damage it? If so, you can reset the system to a known state by driving it in one direction long enough so that you know it has reached the end of its travel (this is what some cheap inkjet printers to to reset the carriage to a known position). After that, you can keep track of the position by writing it to EEPROM, perhaps when you sense that power is about to go down (e.g. by monitoring the voltage on a capacitor on the input side of the voltage regulator).

If so, you can reset the system to a known state by driving it in one direction long enough so that you know it has reached the end of its travel

For 70 turns of the motor! That is a long time for the system to take mechanical abuse. You would be better off trying to monitor the current and seeing when it reaches its stalled value.

by writing it to EEPROM, perhaps when you sense that power is about to go down

Sensing the power is about to go is an entire project in itself. I have done many of these when designing set top boxes and it is not easy unless the power supply is integrated into the system. I actually hold a patent (well it is my companies IP as I was working for them at the time) for a novel way of detecting a power outage on a set top box in order to write things to flash.