Go Down

Topic: Motor control  (Read 132 times) previous topic - next topic

jusj

Total newbie needs help with motor controlling.

I need to drive dc motor as following:

I have one limit switch.
Motor rotate clockwise 360 degrees, reach the switch and stops for x seconds.
Then rotate counterclockwise same 360 degrees, reach the switch and stops for y seconds.

Could someone give me an example how to do that?

Thanks!

Robin2

You have not told us what type of motor you have or whether you have a motor driver board. You cannot connect a motor directly to an Arduino.

If you want someone to write a program for you please ask in the Gigs and Collaborations section of the Forum and be prepared to pay.

If you want to learn to program yourself the examples that come with the Arduino IDE are a good place to start. There are also many online tutorials.  Also see the Useful Links Thread.


...R
Two or three hours spent thinking and reading documentation solves most programming problems.

jusj

Thanks for answering.

I use 12V DC motor with a self-made H-bridge.
HW is not a problem but I'm not familiar with SW.

I guess I could make it run with two switches but I have no idea how to do it with just one switch.

Robin2

Post a diagram of your machine so we can understand how the limit switch is placed and how you propose to use the same switch for 2 directions (which is what I think you are trying to do).

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Paul_KD7HB

Especially, show us how the limit switch is activated by the motor mechanism. Is it pressed by an arm attached to the motor? Is it activated by a cam attached to the motor? Is it a standard micro switch? Or is a leaf switch that is pressed by something attached to the motor?

Paul

Go Up