To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 21177
21176  |  21178
Subject: 
Re: LEGWAY software questions
Newsgroups: 
lugnet.robotics
Date: 
Fri, 15 Aug 2003 17:46:23 GMT
Viewed: 
1188 times
  
In lugnet.robotics, Steve Hassenplug wrote:
In lugnet.robotics, Kevin L. Clague wrote:

<snip>

Clear yet?

Nope.  It would seem that over time, you move further down the array, until
MotorRunningValue goes to 0, and you start over....

This has the potential of moving you from forward, through stop, and then
reverse.  How does this help?

Let me try with a couple examples.

Given the above code, if you set MotorA=0, the motor direction will be set to 1
for the first ms (MotorRunningValue==0; 0+0=element 0 in array) and
1 for the second ms (MotorRunningValue==1; 0+1) and
1 for the eighth ms (MotorRunningValue==7; 0+7 element in array), then
MotorRunningValue will be set to 0, and it will start over.

So, the table would look like this:
MotorSetting = speed for 1ms slice of time
0 = 1,1,1,1,1,1,1,1  // full forward for 8ms, repeat
1 = 1,1,1,1,1,1,1,3  // forward for 7 ms, stop for 1ms, repeat
2 = 1,1,1,1,1,1,3,3  // stop for 2ms
3 = 1,1,1,1,1,3,3,3
4 = 1,1,1,1,3,3,3,3  // running for 50%, stopped for 50% or 1/2 speed
5 = 1,1,1,3,3,3,3,3
6 = 1,1,3,3,3,3,3,3
7 = 1,3,3,3,3,3,3,3  // running very slow.  Full speed for 1ms, stop for 7ms
8 = 3,3,3,3,3,3,3,3  // stopped
9 = 3,3,3,3,3,3,3,2  // slow reverse
10= 3,3,3,3,3,3,2,2
11= 3,3,3,3,3,2,2,2
12= 3,3,3,3,2,2,2,2  // 1/2 speed reverse
13= 3,3,3,2,2,2,2,2
14= 3,3,2,2,2,2,2,2
15= 3,2,2,2,2,2,2,2
16= 2,2,2,2,2,2,2,2  // reverse all the time

And if you just want to float the motors:
24= 0,0,0,0,0,0,0,0

It will never go forward, through stop, then reverse with a single motor
setting.  Because MotorRunningValue goes from 0 to 7 (eight steps) and there are
eight steps in each section of the array.  Lucky?  well, maybe.  :)

understand, yet?

Yes.  Thanks.

Your PWM wavelength is 8ms, MotorA or MotorC chooses the first of the 8 entries
used for the ON part of the wave.  The MotorRunningValue walks you through the
other 7 entries (the remainder of the wavelength).


Steve

Thanks!
Kevin



Message is in Reply To:
  Re: LEGWAY software questions
 
(...) Let me try with a couple examples. Given the above code, if you set MotorA=0, the motor direction will be set to 1 for the first ms (MotorRunningValue==0; 0+0=element 0 in array) and 1 for the second ms (MotorRunningValue==1; 0+1) and 1 for (...) (21 years ago, 15-Aug-03, to lugnet.robotics)

5 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    
Active threads in Robotics

 
Verified and Trusted Team of Hackers
5 hours ago
Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR