How do I control these types of motors (Digital Lens)

Hi Guys (figure of speech ;)),

I found some motors from lenses, some with only the gear others still in connection with the lens itself.

Anyway I think I know the voltages to supply them 2 are 2,4v others 3,7.
They have 4 connection on the motor itself (view photo).

Can somebody tell me 1 what type of motors they are, I'm thinking dc gear motors (but why are there 4 contacts).
And how do I control them. Simple left, right or forward - backwards better. I don't want exact positioning of the motors.

They may be small stepper motors - if that would make sense for the application.

And please can you make your photo smaller so I don't have to scroll arround to see it all.

...R

These motors are likely small bipolar steppers, typically something like 100mA or around that,
so a small dual-H-bridge is normally needed to drive them. Several sorts are available
on eBay for peanuts.

Measure the resistance between the pins, you should find that there are two separate
windings of very roughly 50 ohms each - if not its some other sort of motor (3-phase
centre-tapped is possible)

MarkT:
These motors are likely small bipolar steppers, typically something like 100mA or around that,
so a small dual-H-bridge is normally needed to drive them. Several sorts are available
on eBay for peanuts.

Measure the resistance between the pins, you should find that there are two separate
windings of very roughly 50 ohms each - if not its some other sort of motor (3-phase
centre-tapped is possible)

Okay, I'll read out the pins!
I'll return when I know more. also going to look in to bipolar steppers.

@raschemmel if had the reference data I would be asking what type of motors they are.

@Robin2 sorry!

You can find the same type of motor in a 3 1/2" floppy drive sticking out the back, FWIW.

Ok. You can see how many wires the motors have it is greater than two so they are not dc brushed motors.
They have to make precise small movements so they are not dc brushless motors.
That doesn't leave too many alternatives. They must be stepper motors but are they bi-polar or unipolar ?
They have too many windings to be unipolar so they must be bi-polar.
They have to make small precision movements so they have to be microsteppers.
http://www.smallelectricmotor.info/stepper-motor-camera-2/

The question is : If you are asking how to control them , how do you plan to connect to them given they are already connected to the controller in the camera ? That is a custom flat cable made for that controller. You need to clarify the question of how you plan to connect to them given they are still connected to the controller and one would assume that if you know nothing about the motors then you know nothing about the controller. So what are you going to do ? (desolder the motors from the flat cable and install your own cable ?

raschemmel:
Ok. You can see how many wires the motors have it is greater than two so they are not dc brushed motors.
They have to make precise small movements so they are not dc brushless motors.
That doesn't leave too many alternatives. They must be stepper motors but are they bi-polar or unipolar ?
They have too many windings to be unipolar so they must be bi-polar.
They have to make small precision movements so they have to be microsteppers.
http://www.smallelectricmotor.info/stepper-motor-camera-2/

The question is : If you are asking how to control them , how do you plan to connect to them given they are already connected to the controller in the camera ? That is a custom flat cable made for that controller. You need to clarify the question of how you plan to connect to them given they are still connected to the controller and one would assume that if you know nothing about the motors then you know nothing about the controller. So what are you going to do ? (desolder the motors from the flat cable and install your own cable ?

Yes the last part is what I want to do or if possible leave the connector on it en just solder the wires to the four contacts en connect those to the arduino. And indeed I don't know anything about the controller or it's protocols. So I want to skip/override the controller and 'STI'? connectors and just control the motor directly to with an arduino.

In general you can't

just control the motor directly to with an arduino.

because an Arduino cannot supply enough current. For example the digital I/O pins can only supply about 20 milliAmps.

That means that you need something between the Arduino and the motor. The Arduino controls the something and the something controls the current in the motor.

An obvious "something" to use with a stepper motor is a stepper motor driver board - for example a Pololu A4988. Even if it seems a bit too expensive for your project study how it works.

Small stepper motors can also be controlled with a H-bridge chip such as the L298 and there should be plenty of info on the forum about doing that.

...R

Well I worked with the H-Bridge before with a uni-polar stepper.

But the Pololu seems very interesting en wel documented. So I think I'll buy one and test that out!

I'll update when the project works. Thanks!

I see a possible issue with not disconnecting the flat cable. If you leave it connected it is possible the connections to the controller may effect the motor behavior. You could leave it on to begin with and only disconnect it if you have problems. I know the conroller does not have power but without a schematic of the controller board it is hard to say whether or not it would be a problem. The reason I bring it up is that you have not provided any status information for that particular camera. Can you say for a fact that the controller and components are not damaged (shorted) ?

raschemmel:
I see a possible issue with not disconnecting the flat cable. If you leave it connected it is possible the connections to the controller may effect the motor behavior. You could leave it on to begin with and only disconnect it if you have problems. I know the conroller does not have power but without a schematic of the controller board it is hard to say whether or not it would be a problem. The reason I bring it up is that you have not provided any status information for that particular camera. Can you say for a fact that the controller and components are not damaged (shorted) ?

Well I did think of that to so I disconnected them from the motor, easier way. I have a deadline so, any possible problem has to be eliminated upfront. What I did wonder is shouldn't I buy this one, Pololu - DRV8834 Low-Voltage Stepper Motor Driver Carrier, It works on lower voltages what I suppose is better for my project.

The camera's are old cheap sony digital camera's so I can't say any specifics of them.

It looks like a good choice to me.

What matters with stepper motors is the current rather than the voltage. I read in another Thread recently where someone had an A4988 stepper driver adjusted to only provide 50mA.

I think the purpose of the DRV8834 is to facilitate applications where only low voltage is available.

Either should work perfectly well in your situation.

...R

In anticipation for the drivers to arrive, does anybody know how to connect the DRV8834 Low-Voltage Stepper Motor Driver Carrier to an arduino? And or have a sketch to test it with?

Cheers!

beyondal:
does anybody know how to connect the DRV8834 Low-Voltage Stepper Motor Driver Carrier to an arduino?

Just like it says on the Pololu web page you linked to earlier.

...R

I've got my parts, connected them properly.

But I can't start to control my motor, because I have no clue where to start. It should be something like low low = one step.

Does anybody know a sketch that controls the Pololu - DRV8834 Low-Voltage Stepper Motor Driver Carrier DRV8834 Low-Voltage Stepper Motor Driver Carrier and make use of the follow 'state machine' code?

The example below is the one I have for a Solenoid configuration.

boolean Solenoid1, Solenoid2 = LOW;  // holds 2 solenoids in the memory

const int Solenoid1Pin = 0; //Keeps pin 0 operating??  
const int Solenoid2Pin = 2; //Keep  pin 2 operating??


int solenoid1Time1ON = 2500; //variable for the time on of solenoid 1
int solenoid1Time1OFF = 5000;//variable for the time on of solenoid 2

int solenoid2Time1ON = 7500; //variable for the time OFF of solenoid 1
int solenoid2Time1OFF = 12500;//variable for the time OFF of solenoid 2


long int goTime_Solenoid1, goTime_Solenoid2; // the millis number storage??
long int now = millis(); // ? 

void setup(){
  
   
  
  pinMode(Solenoid1Pin, OUTPUT);
  pinMode(Solenoid2Pin, OUTPUT);
  
  goTime_Solenoid1 = millis(); // at the moment the millis reach a point go to the void
  goTime_Solenoid2 = millis(); // at the moment the millis reach a point go to the void
  
}


void loop(){
  if(millis() >= goTime_Solenoid1) pushSolenoid1(); //check the millis
  if(millis() >= goTime_Solenoid2) pushSolenoid2(); //check the millis
} 

//////////////////////////////
void pushSolenoid1(){
  if ( Solenoid1 == HIGH ) {   //if the state is high
      digitalWrite( 0, LOW ); // set low
      Solenoid1 = LOW;
      goTime_Solenoid1 = millis() + solenoid1Time1OFF; // time till next on
   }
   else  { 
   digitalWrite( 0, HIGH ); // set high
   Solenoid1 = HIGH;
   goTime_Solenoid1 = millis() + solenoid1Time1ON; //time till next off
  }
}
void pushSolenoid2(){
  if ( Solenoid2 == HIGH ) {   //if the state is high
      digitalWrite( 2, LOW ); // set low
      Solenoid2= LOW;
      goTime_Solenoid2 = millis() + solenoid2Time1OFF; // time till next on
   }
   else  { 
   digitalWrite( 2, HIGH ); // set high
   Solenoid2 = HIGH;
   goTime_Solenoid2 = millis() + solenoid2Time1ON; //time till next off
  }
}
/////////////////////

I'm sure I have to make the motor run in the ////////////////// part of the sketch, the others are just the timer and the pin outs.

Anybody an example or a step in the good direction.

Cheers!

I don't understand what solenoids have to do with stepper motors.

If you have a "proper" stepper motor driver then try using the AccelStepper library to control the motors. Concentrate on simple stuff before you bother about coding for different states.

States are not difficult but they are much easier to use if you already have working functions for (say) moveForward() and moveBackward(), or whatever you need for your project.

...R

I want to do the easy stuff! Maybe my question was wrong, I would just like to know how I can control my stepper with the Driver of pololu in the former message I've sent. Does this work with this library AccelStepper library ?

greets!

beyondal:
Does this work with this library AccelStepper library ?

Yes.

Have you studied the AccelStepper website?

...R