+ Post New Thread
Results 1 to 13 of 13
  1. #1
    Newbie level 6
    Points: 91, Level: 1

    Join Date
    Jan 2018
    Posts
    14
    Helped
    0 / 0
    Points
    91
    Level
    1

    How to control stepper motor rotation using voltage

    Hello all,

    I have designed a voltmeter circuit to measure 0 to 5V. I want to display the output on analog display that is, using dial display. For this I plan to use stepper motor to move pointer to correct position. The setup looks as shown in image: Click image for larger version. 

Name:	x25 motor.jpg 
Views:	2 
Size:	20.7 KB 
ID:	143826. I have written a program to rotate the motor depending on the voltage measured. It doesn't show any error in compilation but when I try to execute the pointer does not move as it should. I have checked voltmeter circuit and it is fine.

    The code snippet is attached hereprogram.pdfprogram.pdfClick image for larger version. 

Name:	x25 motor.jpg 
Views:	2 
Size:	20.7 KB 
ID:	143826.

    Regards
    Srinidhi

  2. #2
    Super Moderator
    Points: 244,898, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    42,536
    Helped
    12961 / 12961
    Points
    244,898
    Level
    100

    Re: How to control stepper motor rotation using voltage

    The stepper pulse pattern doesn't seem to match the hardware configuration (motor connected by 3 wires). Show your circuit schematic and motor datasheet.



  3. #3
    Super Moderator
    Points: 71,532, Level: 65
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    11,705
    Helped
    3872 / 3872
    Points
    71,532
    Level
    65

    Re: How to control stepper motor rotation using voltage

    Indeed, the software seems to output 4 unipolar signals which would require 5 connections to the motor (4 + supply) so how do you have it wired with only 3?

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



    •   Alt8th January 2018, 14:29

      advertising

        
       

  4. #4
    Newbie level 6
    Points: 91, Level: 1

    Join Date
    Jan 2018
    Posts
    14
    Helped
    0 / 0
    Points
    91
    Level
    1

    Re: How to control stepper motor rotation using voltage

    Quote Originally Posted by FvM View Post
    The stepper pulse pattern doesn't seem to match the hardware configuration (motor connected by 3 wires). Show your circuit schematic and motor datasheet.
    Below attached is the circuit schematic. Output of voltage divider is given to an ADC pin of Atmega16. stepper motor is connected to micro-controller via L293D motor driver.Click image for larger version. 

Name:	Voltmeter 2.jpg 
Views:	15 
Size:	91.5 KB 
ID:	143842



  5. #5
    Super Moderator
    Points: 60,593, Level: 60
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    12,372
    Helped
    2865 / 2865
    Points
    60,593
    Level
    60

    Re: How to control stepper motor rotation using voltage

    Hi,

    Your circuit:

    GND symbols aren't expensive. Use them to avoid lengthy GND wiring...this makes the whole circuit more easy to read.

    Klaus
    Please don´t contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  6. #6
    Super Moderator
    Points: 244,898, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    42,536
    Helped
    12961 / 12961
    Points
    244,898
    Level
    100

    Re: How to control stepper motor rotation using voltage

    Let me put it this way: The circuit schematic (controlling 3 of 4 L293 outputs with connected bipolar stepper motor) neither fits the code (controlling 4 outputs PB1 - PB4) nor the stepper motor photo.

    What did you actually test?



    •   Alt10th January 2018, 00:04

      advertising

        
       

  7. #7
    Advanced Member level 5
    Points: 13,937, Level: 28

    Join Date
    Nov 2012
    Posts
    2,576
    Helped
    598 / 598
    Points
    13,937
    Level
    28

    Re: How to control stepper motor rotation using voltage

    Stepper motors have more than three wires: your photo shows only three wires.

    I do not know how L293 is being used as a stepper motor driver.

    Is your motor BLDC type? Then you will need motors with Hall sensors or encoders...



  8. #8
    Newbie level 6
    Points: 91, Level: 1

    Join Date
    Jan 2018
    Posts
    14
    Helped
    0 / 0
    Points
    91
    Level
    1

    Re: How to control stepper motor rotation using voltage

    It is stepper motor X-25. Datasheets of these motors are hard to find. one of the datasheet I found is attached below.X25 datasheet.pdf



  9. #9
    Newbie level 6
    Points: 91, Level: 1

    Join Date
    Jan 2018
    Posts
    14
    Helped
    0 / 0
    Points
    91
    Level
    1

    Re: How to control stepper motor rotation using voltage

    I referred to the following webpage for interfacing stepper motor, l293d and amicro-controller: http://rickruling.blogspot.in/2013/1...tor-using.html



  10. #10
    Super Moderator
    Points: 244,898, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    42,536
    Helped
    12961 / 12961
    Points
    244,898
    Level
    100

    Re: How to control stepper motor rotation using voltage

    I referred to the following webpage for interfacing stepper motor, l293d and amicro-controller: http://rickruling.blogspot.in/2013/1...tor-using.html
    Not exactly. There's one phase missing in your schematic and the code is accessing the wrong port bits, PB1 - PB4 instead of PB0 - PB3. Also the 3 wire stepper motor photo seems confusing. Is it actually a 3-phase motor (very unusual, but possible)?



    •   Alt11th January 2018, 08:31

      advertising

        
       

  11. #11
    Super Moderator
    Points: 71,532, Level: 65
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    11,705
    Helped
    3872 / 3872
    Points
    71,532
    Level
    65

    Re: How to control stepper motor rotation using voltage

    The motor puzzles me too. Note that the shaft is off center, that usually means there is a gearing mechanism inside it. It certainly doesn't look like a stepper motor and if it is a 3-phase AC motor I've never seen one so small and I can't think of a practical application for one that size.

    Drmius, can you show us more information about the motor or at least upload a picture of the other side showing any markings on the connections.

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



  12. #12
    Newbie level 6
    Points: 91, Level: 1

    Join Date
    Jan 2018
    Posts
    14
    Helped
    0 / 0
    Points
    91
    Level
    1

    Re: How to control stepper motor rotation using voltage

    Quote Originally Posted by betwixt View Post
    The motor puzzles me too. Note that the shaft is off center, that usually means there is a gearing mechanism inside it. It certainly doesn't look like a stepper motor and if it is a 3-phase AC motor I've never seen one so small and I can't think of a practical application for one that size.

    Drmius, can you show us more information about the motor or at least upload a picture of the other side showing any markings on the connections.

    Brian.
    Below attached is the datasheet on X-25 motor. Basically these are stepper motors used by GM for instrument Clusters.



  13. #13
    Super Moderator
    Points: 71,532, Level: 65
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    11,705
    Helped
    3872 / 3872
    Points
    71,532
    Level
    65

    Re: How to control stepper motor rotation using voltage

    That explains what it is but not why you only have three connections to it when it needs four.

    Beware of visiting Junken's web site, it pops up a "Windows Defender" virus alert and warns me not to shut my computer down and to call a support phone number immediately. The funny thing is - I use Linux!

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



--[[ ]]--