Pages: [1]   Go Down
Author Topic: Micro elevator with stepper  (Read 358 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Sr. Member
****
Karma: 1
Posts: 341
UNO
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

HI, im today with a few questions about this project, i got all the mechanics parts, but, the programming its still in blank....


my idea its to use some hall effect sensors, en the "floors" to recognize when a floor its pass, but... this create a big complx in the program, for example, if the elevator its on the 3rd floor, and i want to go to the five(the last), how can arduino recognize in which floor its the elevator???
Logged

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have a counter that increments or decrements based on both the hall sensor(s) and which direction the motor is running at the time the hall sensor(s) trigger.
Logged

0
Offline Offline
Sr. Member
****
Karma: 1
Posts: 341
UNO
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i can use something like

if stepper +180(180 steps per revolution its equal to 1 floor)

counter_floor++

else
counter_floor

this is in c++....

Logged

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You could, but I presume the elevator also goes down.  So there should be similar code for moving the stepper in the opposite direction.

On the other hand I was thinking of still using hall sensor(s) (you could use one sensor on the elevator or one per floor, depending the available IO pins) to detect the elevator actually passing by a floor.  However, you'd have a couple of flag variables; e.g. one set to "true" when the motor turns clockwise and the other set to "true" when it moves counter clockwise.  Then you have an conditional blocks similar to below...
Code:
if (sensorTrigged == true)
   {
   if (clockwise == true && counterclockwise == false) floorNumber = floorNumber++;  //check both flags to rule out some potential errors
   if (clockwise == false && counterclockwise == true) floorNumber = floorNumber--;
   }
Logged

0
Offline Offline
Sr. Member
****
Karma: 1
Posts: 341
UNO
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i believe that should do the job..... im goin to use only one sensor on the elevator, on the floor i will use neodymiun magnets.... i believe that im going to use interrumpts for the sensor....

but the next step, would br to manage several calls, example floor 1, 3 going down..... but maybe this gets too much complex for my level
Logged

Pages: [1]   Go Up
Jump to: