PC joystick to (Servo or Stepper) STEP/DIRECTION


Results 1 to 24 of 24

Threaded View

  1. #4
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default

    Some prelimary questions: How fast do you want max jog to be? how many steps per rev? This info will drive how you toggle the output pins for the steps. My first thought is intrupt based toggle. But it really depends on the speed you want to achieve, and how precise you want that speed.

    If you think about the a/d answer being the modifer for a delay between toggles, I am not sure you have much math to do.

    Lets assume 10 bit A/D, with 24 bits of dead band. so you have 500 possibilties for the speed. So 0 max, and 500 is stop. This is because 0 delay would be full speed.

    Now we just need to know osc speed for the rest of the math

    If you use 2 counters as the delay, your A/D answer can change the count needed to toggle. Then establish a duration for what a count represents and load that into the timer. when the timer rolls over, update both counters. If either or both have reached their count, toggle the pin for that motor.
    Last edited by cncmachineguy; - 28th October 2010 at 16:53.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

Members who have read this thread : 0

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts