Output settings for 16F88


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by PICante View Post
    Actually that was even worse, the motor shaft just shatters back and forth makes no full turns
    I expected all of the above...

    Does this mean lots of harmonics and “dirt”, I do not have access to a scope where I am right now or I would have performed a ECG on it!
    Basically, yes, FREQOUT is a bit ugly.

    I think the problem in your code is here (and other places that look a lot like it):
    Code:
    DI = 1 : pause 500
    for a = 0 to 200 : ST = 1 : pause 2 : ST = 0 : next a
    Reading thru the code out loud:
    - Step On
    - Wait 2ms
    - Step Off
    - NO WAITing for 2ms
    Repeat...

    So basically what you end up with is a nice long 'go ahead and step' pulse, with practically no wait between pulses.

    That might help you out. I don't know. I'm guessing here. Couldn't find the datasheet for that '5804 chip and didn't feel like doing any hard searching for it either

  2. #2
    Join Date
    Dec 2007
    Location
    Sweden
    Posts
    73


    Did you find this post helpful? Yes | No

    Default

    I’m back, after some fiddling I realized that without any delay it doesn’t work. Instead I removed the PAUSE and replaced it with a loop. Now, this part of the code looks like this:

    for a = 0 to 2000 ‘ ten turns
    ST = 1 ‘ start pulse
    for b=0 to 59:next b
    ST = 0 ‘ end pulse
    next a ‘ loop

    This runs the motor slightly faster, however if b < than 59 the motor loses all torque and just hums. At about b = 65 or higher the torque is acceptable and I really do not understand why it can't run faster.

    UCN5804B: http://www.taomc.com/bits2bots/5804.pdf

    Thanks!

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by PICante View Post
    This runs the motor slightly faster, however if b < than 59 the motor loses all torque and just hums. At about b = 65 or higher the torque is acceptable and I really do not understand why it can't run faster.
    Because that's the nature of stepper motors.
    Low speed / High torque
    High speed / lower torque

    And you still missed my point about the code above...
    You've got a pause on one end of the step, but not the other end. The motor/electronics probably have to catch up with each other.
    Code:
    for a = 0 to 2000 ‘ ten turns
    ST = 1 ‘ start pulse
    for b=0 to 59:next b <-pause here ok
    ST = 0 ‘ end pulse
    might want a pause here, probably not the same length as above, but a pause nonetheless
    next a ‘ loop
    At 8Mhz, ST is low for maybe 4us, give or take.
    And if you look at the datasheet, there's a turn-on and turn-off delay of 10us.
    Last edited by skimask; - 22nd June 2008 at 12:32.

  4. #4
    Join Date
    Dec 2007
    Location
    Sweden
    Posts
    73


    Did you find this post helpful? Yes | No

    Red face

    Thanks skimask!

    Yes I did miss your point; of curse the "squarewave" must look better to the 5804 if the duty is more like 50/50!
    New code:

    for a = 0 to 2000 ‘ ten turns
    ST = 1 ‘ start pulse
    for b=0 to 28:next b ‘ on time
    ST = 0 ‘ end pulse
    for b=0 to 28:next b ‘ off time
    next a ‘ loop

    The motor runs at the same speed as before, perhaps with a little less noise. If I try to go below 28 it loses torque and I do not help to use different on and off times. I have tried both ways, shorter on time and shorter off time.
    S**t, I really thought this was the solution!

  5. #5
    Join Date
    Sep 2007
    Location
    USA, CA
    Posts
    271


    Did you find this post helpful? Yes | No

    Default

    You *might* get a little more speed out of it if you ramp up to speed (i.e. set an acceleration rate) rather than instantly hitting the full speed.

    But, as Skimask said, steppers are designed for low speed, and once you hit their top speed in the circuit, the motor will stall...which is a nice way to stay stop.

Similar Threads

  1. Bit Banging input to output on PIC16F876A
    By Bronurstomp in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 26th June 2008, 20:50
  2. PIC 16F684 Configuration Settings
    By Nicholas in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 11th April 2007, 16:18
  3. Serious Serial Situation Setbacks...
    By Dansdog in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 7th February 2007, 04:46
  4. Using LEDs as light sensors
    By skimask in forum Code Examples
    Replies: 3
    Last Post: - 30th December 2006, 23:19
  5. HSEROUT Newbie question/problem
    By Mark Scotford in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 11th July 2006, 15:44

Members who have read this thread : 0

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

Posting Permissions

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