Hwello, im trying to connect a rotary switch to arduino duemilanove to toggle between microstepping options; ive already connected a potentiometer to control rpm. Im using a DM452T driver with a Nema 23 (3nm).
What code should i use???
Thx :3
There are actually TWO types of rotary switches. Ones that OPEN all circuits just before closing the new connection. And those the close the NEW connection before opening the old connection. Which type do you have and are you allowing for either the open connection or the double closed connection?
The most common rotary switch will OPEN the first connection before closing the second connection.
1 pole, so im assuming closed??
I guess it depends on the code i use to configure it to the arduino duemilavone, right?
Im not too sure, im quite new to this. Which one is easier i guess....
How many switch positions / selections? Is the switch connected between Vcc and input pin or between input pin and GND ?
I want 4 switch positions, and vcc to input
So, single pole switch with 4 positions. Time to draw a block diagram of all those connections to the switch and your Arduino,
Sadly, i do not know how to do that......(@_@)
Then just write it in words.
post a picture with white light
of your rotary-switch that shows all contacts
Is this a switch with contacts like this?
This switch has a common-pin and 4 position pins
draw a diagram that shows to what IO-pin of the arduino do you connect the common-pin
and
to what IO-pins do you connect the 4 position pins
This sentence let me assume that you have a totally wrong picture of how writing the code of something like this.
Though this single sentence is not enough information to say this for sure.
The code for checking a 4 position rotary-switch will look very very similar for any type of microcontroller. There are just details that are different.
Directly after registering you got a link presented to this tutorial
"How to get the best out of this forum"
You should really read it
As a general advice you really really should
OK your picture shows blocks.
In this case there must be added more details
What do you really want to do? The microstepping is configured at the DM542T with dip switches. You cannot change that from your Arduino.
Im guessing its along the lines of this, but im not sure what pins need to be connected. Additionally, i have a potentiometer connected at a0, gnd, and 5v, and to the DM452T is pin 3,6,7. So i dont know which pins to use....
I pretty much have no idk what im doing, so yea...
A DM452T stepper-motor-driver has DIP-switches located here
If you look from the side they look like this
As you can see now. These are very tiny mechanical switches
Hires picture
there is no way to connect a rotary-switch to adjust the microstepping.
You would have to open the housing loosing warranty and
you would have to have a very deep knowledge about the inner electronics where to solder extra-wires to connect such a rotary switch.
Yes I can see this.
Your next step should be to describe in very much details in normal words what your project is.
It might turn out that a stepper-motor is a wrong approach for what you want to do.
So please describe the final purpose of why the stepper-motor shall rotate.
Especially what maximum rpm rotations per minute do you need in your project.
best regards Stefan
Thank you for such kind words lol
Im making a dual axis motorised mount for my telescope. I want to be able to control the direction (h bridge), rpm (potentiometer), and microstepping options (rotary switch). 1 arduino per motor. Being a telescope mount i need some degree of precision, im using a gear train to achieve desired gear ratios
please write a number what maximum rpm do you want?
3000 rpm?
200 rpm?
10 rpm?
what is the maximum-speed as rpm that you need the stepper-motor- axle to rotate
or alternatively if you can write the number of the gear-ratio
what rpm do you want at the output-shaft of the gear-train
How many steps per revolution does your stepper-motor have?
Best thing would be to post the exact type of your stepper-motor and the datasheet of the stepper-motor
at least a link to where you bought the stepper-motor
One Arduino can easily control 2 stepper
What h-bridge? You told us, that you use a DM542T stepper driver ( suppose your 'DM452T' is a number mistake. I don't know about such a stepper driver ). The direction is controlled by this driver. ( ok, internally it uses a H-bridge - but not only to control direction ).
I told you already, that you cannot select microstepping options this way. Usually it isn't needed to change the microstepping options. Select the setting which is best for your needed resolution and don't change it.
Ok so i dont need a h bridge, thats good, but how will i change the rotation? Ill scrap the rotary switch idea. I wanted 2 arduinos so they can move independently of each other with separate co by controls