From: Jeff Johnson on
"Steve" <sredmyer(a)yahoo.com> wrote in message
news:ac12bdf7-bae5-454b-a74a-502dbe9e2978(a)f13g2000vbm.googlegroups.com...

> > > Good explanation. It would be nice if the motor could send a signal
> > > (close a
> > > circuit, whatever) that would tell the program when the rotor had
> > > completed
> > > it's travel to the next quadrant, thereby allowing a "hand-shaking"
> > > method
> > > of
> > > synchronizing the device and software. I presume such motors exist.
> >
> > > P.S. "To" is spelled with two o's when used in this context: "too
> > > long",
> > > "too short", "too slow", etc. ;)
> >
> > P.P.S. "Its" is written without an apostrophe when used as the
> > possessive
> > form of "it." "It's" is ALWAYS the contraction for "it is."

> GEEZ guys give me a break already...I left grammar school a long time
> ago <g>

Naw, that one was for Charlie's reply. One of the rules of the Internet is
that if you're going to correct someone's spelling/grammar, you better be
sure you don't make any spelling/grammar errors in the process!


From: senn on

"Charlie" <Charlie(a)discussions.microsoft.com> skrev i meddelelsen
news:582DEE68-38EA-4AE5-88D2-8A9D3C71FB4C(a)microsoft.com...
> Good explanation. It would be nice if the motor could send a signal
> (close a
> circuit, whatever) that would tell the program when the rotor had
> completed
> it's travel to the next quadrant, thereby allowing a "hand-shaking" method
> of
> synchronizing the device and software. I presume such motors exist.
>
> P.S. "To" is spelled with two o's when used in this context: "too long",
> "too short", "too slow", etc. ;)
>
> "Steve" wrote:
>
>> On Jun 3, 12:30 am, Viper900 <Viper...(a)discussions.microsoft.com>
>> wrote:
>> > Hi
>> > I writting a program to run a stepper motor using vb6, it uses the
>> > paraell
>> > port to communicate with the motor driver. It works, but the motor
>> > tends not
>> > to run smooth, it chugs around. i thing its got something to do with
>> > the
>> > delay.
>> > I am using this delay
>> >
>> > Pubic sub Delay(sngSeconds as single)
>> > Dim sngDoEventsTime as single
>> > Dim sngStart as single
>> >
>> > sngDoEventsTime=Timer
>> > sngStart= Timer
>> >
>> > Do while Timer - sngStart < sngSeconds
>> > if Timer - sngDoEventsTime > o.5 then
>> > DoEvents
>> > sngDoEventsTime = Timer
>> > end if
>> > loop
>> > For this Sub I set the delay to: 0.5
>> >
>> > I have also used this delay
>> >
>> > Public Sub Delay(ByVal Seconds as single)
>> > Dim t as single
>> > t = timer
>> > do while Timer - t < Seconds
>> > loop
>> >
>> > For this Sub I set the delay to: 0.1
>> >
>> > Anyone got any ideads for me
>> > Thank you
>>
>> If the motor is running but seems to be stuttering, then you need to
>> decrease (or possibly increase) your pause time between energizing
>> each phase. As I explained in a previous thread your started on this
>> issue (http://groups.google.com/group/
>> microsoft.public.vb.general.discussion/browse_thread/thread/
>> 8482493e8b123a61/40cc1eebe4c29f23?hl=en(cc1eebe4c29f23), the way this
>> works is as follows:
>>
>> The stepper motor has 4 phases. We energize each of these in turn to
>> pull the rotor around. It is important to understand what is going on
>> here as this will help you to realize what you need to do when things
>> aren't working quite as you would like...so let me try to explain this
>> more visually.
>>
>> Lets use a clock as an analogy for our stepper motor.
>> This clock only has a single hand (we'll use the second hand but that
>> doesn't matter). This single hand will represent the rotor (the part
>> which actually rotates) of our motor. The four phase of the motor are
>> represented by the four quadrants of the clock centered around 12, 3,
>> 6 and 9 positions on the clock. Thus phase 1 is from 11 to 1, phase 2
>> is from 2 to 4, phase 3 is from 5 to 7 and phase 4 is from 8 to 10.
>> Each of these four phases is a magnet that we can energize with our
>> code. Therefore to make the hand rotate we must turn the magnets on
>> and off in sequence around the clock. So, for instance if phase 1 is
>> currently energized holding the hand at straight up 12 o'clock and we
>> want to rotate it 1 complete revolution in the clockwise direction we
>> would do this:
>> 1) De-energize (turn the magnet off) phase 1 (to allow the hand to
>> move) and energize (turn on the magnet) phase 2 to pull the hand from
>> 12 to 3
>> 3) Wait a moment for the hand to actually complete its move (this is
>> the delay in your code)
>> 4) De-energize phase 2 and energize phase 3 to pull the hand from 3
>> to 6
>> 5) Wait for the hand to complete the move
>> 6) De-energize phase 3 and energize phase 4 to pull the hand from 6
>> to 9
>> 7) Wait for the hand to complete the move
>> 8) De-energize phase 4 and energize phase 1 to pull the hand from 9
>> to 12
>>
>> What is probably fairly clear from the above illustration is that if
>> we wait to long between steps the hand will get where it is going and
>> just sit there until we energize the next phase. This would make for
>> jumpy stuttering rotation. What is not as clear is what will happen
>> if our delay is not long enough. In this case the hand will start to
>> move but not get far enough before we de-energize the magnet pulling
>> it and then energize one that is to far away to pull it. This means
>> that once the hand has used up its momentum it will stop until our
>> cycling code energizes another phase (could be either ahead of the
>> hand or behind) which is close enough to move the hand. This
>> situation (a delay which is to short) can make for a really jumpy
>> rotation that even goes backwards occasionally.
>>
>> So to summarize, to make a stepper motor run smoothly you must get the
>> timing right. Doing this is a simple trial and error process. As I
>> explained in your previous thread simply lengthen your delay until the
>> stepper is obviously running to slow (when you can actually see it
>> stop at each phase). Then start decreasing the length of your delay.
>> Continue decreasing the delay until the motor first smoothes out.
>> This is the slowest you can run the motor smoothly. Now continue
>> decreasing the delay until the motor starts to get jumpy again (this
>> is the point at which your delay is to short). Now you have defined
>> the longest and shortest delays you can use and still run smoothly.
>> All that is required now it choose a value within that range that
>> provides you the speed your process needs.
>>
>> Hope this helps,
>> Steve
>> .
Stepper motors in a professional drive circuits normally also
uses accelleration (on start) and decelleration (on stop) on
the pulse-rate. Besides this, a stepper motor used in a
professional drive also have mounted an optical impulse
arrangement on its shaft (optical encoder). This sends
digital pulses back to a counter to track the position -
the movement/or rotation. This feedback is directional
(keeps tracks of the rotation direction too).
This optical-encoder gives out the same amount of
pulses per revolution as the stepper motor itself -sometimes 200
per revolution. Another charateristica is that most stepper motors
can be driven in half-step or full-step mode.
In the sixties, we knewed a famous manufacturer in California
"Delta Electronics". I doubt/wonder if this company still is
manufacturer of stepper motors. These motors are not mounted
on CNC-machines anymore (except small print-bore and
other small machinery, maybe). Was replaced long ago by dc-servo
motors. These can deliver much higher torque and thereby the
small acceleration/decelleration times needed on CNC-machines
of today. Delta Electronics manufactured a series of drive-cards.
Some of which were very cheap. These cheap ones had an
onboard loadable count-down counter to be loaded with the
count of pulses to go. A simple ajustable RC-timer circuit took
care of the acceleration/decelleration by altering the pulse rate
at start and stop (The advanced cards had a micro-prosessor.)
All one had to do, were loading the counter with the count of
pulses to go. And a start signal.
/se



From: Mike Williams on
"Dee Earley" <dee.earley(a)icode.co.uk> wrote in message
news:OOrKSGyALHA.1892(a)TK2MSFTNGP05.phx.gbl...

> I'd scrap the Timer function and use GetTickCount
> and work in milliseconds.

GetTickCount doesn't work in milliseconds. I mean it returns a value in
milliseconds, but it "ticks" only once every 15 or 16 milliseconds on most
systems, so that's the best resolution you can get out of it. The
timeGetTime function would be better if you want a one millisecond
resolution.

Mike



From: Charlie on
Good catch. But what I wanna no is: "who the heck stuck that apostrofy in
their anyway??" ;)

"Jeff Johnson" wrote:

> "Steve" <sredmyer(a)yahoo.com> wrote in message
> news:ac12bdf7-bae5-454b-a74a-502dbe9e2978(a)f13g2000vbm.googlegroups.com...
>
> > > > Good explanation. It would be nice if the motor could send a signal
> > > > (close a
> > > > circuit, whatever) that would tell the program when the rotor had
> > > > completed
> > > > it's travel to the next quadrant, thereby allowing a "hand-shaking"
> > > > method
> > > > of
> > > > synchronizing the device and software. I presume such motors exist.
> > >
> > > > P.S. "To" is spelled with two o's when used in this context: "too
> > > > long",
> > > > "too short", "too slow", etc. ;)
> > >
> > > P.P.S. "Its" is written without an apostrophe when used as the
> > > possessive
> > > form of "it." "It's" is ALWAYS the contraction for "it is."
>
> > GEEZ guys give me a break already...I left grammar school a long time
> > ago <g>
>
> Naw, that one was for Charlie's reply. One of the rules of the Internet is
> that if you're going to correct someone's spelling/grammar, you better be
> sure you don't make any spelling/grammar errors in the process!
>
>
> .
>
From: Jeff Johnson on
"Charlie" <Charlie(a)discussions.microsoft.com> wrote in message
news:B1B4D4EA-9EBE-4260-B55C-451A9D8FD805(a)microsoft.com...

> Good catch. But what I wanna no is: "who the heck stuck that apostrofy in
> their anyway??" ;)

Go stand in a corner.


First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4
Prev: Eternal September Rocks!
Next: Where can I get VSI1.1