The servos use a 1/180 gear reduction to get 1/3 of a degree rotation, so should make really nice accurate movements. I am pretty sure the servos will operate with the normal stepper motor arduino code.
It's the controller chip that has got me all confused. I have read through the datasheet pdf http://www.microcomponents.ch/downloads/switec/X12_017_05_SP_E.pdf and it suggests that i need to connect two output pins to the controller chip for each gauge i want to drive. It seems one pin controls the direction and the other i guess controls the number of turns of the shaft.
I keep re-reading the pdf but i am not sure what i should be sending down to the controller chip from the ardiuno. Any help would be very much appreciated. I am writing all this up into "make yourself a digital/analogue gauge" tutorial
ok i have given up on using the controller for the time being and wanted to drive it directly off the arduino. From what i have read else where it should behave just like a normal stepper.
I have rigged up a potentiometer to analogue pin 0 and wired the four stepper motor pins 1-4 to digital output pins 8,9,10 and 11.
I then loaded up the MotorKnob sketch that's in the reference but absolutely nothing happens on the stepper shaft.
// change this to the number of steps on your motor #define STEPS 100
// create an instance of the stepper class, specifying
// the number of steps of the motor and the pins it's
// attached to
Stepper stepper(STEPS, 8, 9, 10, 11);
// the previous reading from the analog input
int previous = 0;
void setup()
{
// set the speed of the motor to 30 RPMs
stepper.setSpeed(30);
}
void loop()
{
// get the sensor value
int val = analogRead(0);
// move a number of steps equal to the change in the
// sensor reading
stepper.step(val - previous);
// remember the previous value of the sensor
previous = val;
}
I read this on another forum:
Bipolar stepper motors can be driven by using H-bridge circuit like SN754410 from Texas Instruments.
Does this mean that they have to be driven from another circuit or can they be driven directly from a arduino? sorry if this seems a stupid question but i am a bit confused.
It depends on the voltage and current requirements of the stepper motor. I have a mini-stepper that I drive directly from the Arduino. It is a 5V, low current motor. Driving it is simply a matter of hooking up the 4 wires to 4 pins, and setting the 4 pins HIGH or LOW correctly, in the correct order to make it step.
If the stepper motor is higher voltage, or draw more than 20 mA, or you want a simpler interface, the use of a motor controller is required.
it is low current typically drawing 15mA at 5v. So i won't need a controller, right?
there is a table on page 6 of the pdf i linked to above. It looks like it might be what i need but it doesn't make sense to me. Any chance you could take a look and see if it makes sense to you?
or something like:
Step wire 1 wire 2 wire 3 wire 4
1 High low high low
2 low high high low
3 low high low high
4 high low low high
the numbers along the top say they are rotor positions.
does it mean that to move the rotor to position 1
pin 1 high
pin 2&3 low
pin 4 high
but that would mean the shaft could only be in 6 positions.
from the pdf:
The M-S series consist of a "Lavet" type stepper
motor and a gear train. The integrated two step gear
train reduces the rotation by a factor of 180 whereby a
full step driving pulse results in a one degree rotation
of the pointer shaft.
does the gearing mean that sending it all 6 pin combinations would move 1 deg.
This is the most sense i can make of the table in the pdf but i have no idea what it will do if i run it. I guess i'll find out. Please reply if you know this will fry something.
do I?
The difference between 3 and 4 is that pin one drops low. everything else is the same. I'll double check.
Assuming i get the pin outs correct, what would you expect this code to do?
a) nothing at all
b) each iteration of the loop rotates the shaft 1/3 of a degree. continuous movement of the motor shaft until it hits the stop at 315 degrees.
c) you slap you palm to your face due to my lack of knowledge about steppers
would it be represented by the delay between pulses?
Yes but it says the rate is 200 Hz which is a time delay of 5mS. This is the maximum so any slower would be fine. As you have 500mS there should be defiantly no problem with going too fast.
Do you detect any twitching in the motor or any small noise that might suggest something is happening?
I couldn't measure any current between pins 1 & 2. I guess i must have damaged it when soldering. I did do it with a hangover and soldered directly to the pins. This time chopped a dil ic holder in half which fit nicely over the pins. I soldered my wire to the ic holder and plugged it in...
woot woot movement. the needle moved round nice and slowly. So that gets me what i need to write the rest of the program to display a temp scale.