Stepper motor distance control

Hi,
Please I need someone to give me a clue on how to use stepper motor to move a load vertically between 0mm and 30mm when a condition is met for raising and dropping.

I do appreciate your kind help.

Welcome to the forum

A threaded rod, perhaps ?

Thanks so much.

Yes.

A string and a pulley?
Gain knowledge about how to run a stepper motor, power supply, driver... Example code shows a lot.

1 Like

I have knowledge of the connection. All I need now is just the stepper motor, triggered by a distance sensor to move to and fro between 0 and 30 mm. Thanks for your help

Possibly the code.

I assume that the distance sensor is going to be used to trigger the movement of the load

If I were you I would use limit switches to control the extent of the distance moved by the load

Have a go at writing the code yourself and post your best effort here if you need help

If you are using a lead screw (threaded rod) you will be able to calculate the number of steps that it takes to move 1mm and so then how may steps to move 30mm.

You will need a limit switch that you can use to "home" the stepper. That is to establish a zero position to use as a reference for further moves. Homing the stepper is usually done at start up. A properly designed stepper system will not miss steps so should then be able to precisely position just by counting steps.

The AccelStepper and the MobaTools stepper libraries take care of counting steps and also using acceleration to move the motor at higher speeds.

We need a more detailed description of the system requirements to be able to even start with code. What stepper? What stepper driver? What stepper power supply? What distance sensor? What limit switches and type of switches? What Arduino board?

A schematic if you have one would help a lot as would a diagram of the mechanical arrangement.

Whilst implementing the required home position limit switch you might just as well use a second one to detect the full movement thus eliminating the need for any mm/rev calculations or measurements and any possibility of missing steps messing up the distance moved

I can't really disagree with that, but then why use a stepper? If one uses 2 switches a DC gear motor would be more efficient and, arguably, easier to use.

As is often the case here we have been presented with a request for help with a partly formed solution to an unstated problem

We were asked for help with using a stepper motor but have no idea of the reason why it was selected or even the mass that is to be moved

I shall wait for some answers to the questions of post #10 before I continue.

Standing by ......

Generally, the system is an integrated system where two different parts; a and b are controlled by the movement of the stepper motor.

between h=(0mm and 10 mm), component a is active, component b is deactivated.
greater than 10 mm, both a and b are activated.

This is the idea of the system

Cryptic

You are not making it easy to help you since we do not know what you want help with or what you have and you do not seem inclined to answer questions or provide any real information.

How to get the best from this forum.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.