Shop OBEX P1 Docs P2 Docs Learn Events
need help with running stepper motor by sensor — Parallax Forums

need help with running stepper motor by sensor

Jeff BoertjesJeff Boertjes Posts: 3
edited 2007-12-06 19:31 in BASIC Stamp
I am currently in the final stretch of a micro-processing project and am having difficulties with a volume adjustment concept. i want to run the stepper motor ( MITSUMI M42SP-5 ) off of a DIRRS+ ( parallax SKU# 35090 ). the digital infra red rangefinding system is displaying distance as a variable, decimal value between usually 100 and 240 reliably. how would i go about having the motor step per small devisions of the dist variable?

Comments

  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2007-12-06 19:31
    The motor has 48 steps to rotate through 360 degrees.....if you could allow for your distance measurement to be between 100 and 244 then every distance increment/decrement of 3 would be 1 step. By assigning a variable to keep track of the·old position the number of steps would be the difference between the new positon and the old position divided by 3. Comparing the old position with the new position would also determine which way you would need to rotate.

    Jeff T.
Sign In or Register to comment.