Subject:
|
RE: r/c servos and firmware
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Sat, 21 Aug 1999 01:02:10 GMT
|
Viewed:
|
984 times
|
| |
| |
> Ralph Hempel <rhempel@bmts.com> wrote:
> > What about this...
> >
> > 1. "Wedge" a custom OC1A interrupt service routine into the existing
> > slot - remember TSR programming on PCs?
> > 2. Every 3 times (3 msec) turn on a motor output.
> > 3. The next time, set OC1B to expire at a sub 1msec interval.
> > 4. When OC1B interrupts, turn off the motor.
> >
> > Total elapsed time is about 5 msec, multiply by three for 3 motors
> > and you have 15 msec, and about 60Hz!
>
> Almost exactly how I'd do it.
Whew! I'm glad I got that much right :-)
> The problem is what if OCIB must be set to a small value, and the FRT has
> already passed this value when the OCIA handler sets up OCIB in step 3?
We could check OC1B and if it's "close" just turn off the motor...as far as the
long timer goes, OC1A should always force the output off...on the other hand,
the OC1B could be set NO GREATER than the OC1A timeout.
I'll cobble something up early next week.
Cheers,
Ralph Hempel - P.Eng
--------------------------------------------------------
Check out pbFORTH for LEGO Mindstorms at:
<http://www.hempeldesigngroup.com/lego/pbFORTH>
--------------------------------------------------------
Reply to: rhempel at bmts dot com
--------------------------------------------------------
|
|
Message has 1 Reply: | | Re: r/c servos and firmware
|
| (...) Thinking about this more, I do not know what I was thinking earlier. Since you are in an ISR, you know can count the number of cycles in the instructions between reading the FRT and enabling the OCIB interrupt, and you can estimate "close" (...) (25 years ago, 21-Aug-99, to lugnet.robotics)
|
Message is in Reply To:
| | Re: r/c servos and firmware
|
| (...) Almost exactly how I'd do it. The problem is what if OCIB must be set to a small value, and the FRT has already passed this value when the OCIA handler sets up OCIB in step 3? This problem is solvable. If the total interval is closer to 1 ms, (...) (25 years ago, 20-Aug-99, to lugnet.robotics)
|
4 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
Active threads in Robotics
|
|
|
|