Go to Post The Tekin's used to constantly suffer from spontaneous combustion, it was extremely frustrating how often they would go. - Kingofl337 [more]
Home
Go Back   Chief Delphi > Technical > Control System
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 18-05-2005, 19:42
ghansel ghansel is offline
my amp goes to eleven
AKA: George H.
FRC #0019 (Big Red Robotics)
Team Role: Engineer
 
Join Date: Jan 2005
Location: Connecticut
Posts: 38
ghansel is infamous around these parts
PWM inputs?

Is there any way for the RC to accept a PWM input?
  #2   Spotlight this post!  
Unread 18-05-2005, 19:44
Matt Krass's Avatar
Matt Krass Matt Krass is offline
"Old" and Cranky. Get off my lawn!
AKA: Dark Ages
FRC #0263 (Sachem Aftershock)
Team Role: Mentor
 
Join Date: Oct 2002
Rookie Year: 2002
Location: Long Island, NY
Posts: 1,187
Matt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond repute
Send a message via AIM to Matt Krass
Re: PWM inputs?

I believe there's a way to build a small resistor-capacitor circuit that'll convert the PWM pulse in to a 0 to 5 volt charge that can read through the ADCs. You'll have to get more info from Google or someone else on here though.
__________________
Matt Krass
If I suggest something to try and fix a problem, and you don't understand what I mean, please PM me!

I'm a FIRST relic of sorts, I remember when we used PBASIC and we got CH Flightsticks in the KoP. In my day we didn't have motorized carts, we pushed our robots uphill, both ways! (Houston 2003!)
  #3   Spotlight this post!  
Unread 18-05-2005, 19:52
Bharat Nain's Avatar
Bharat Nain Bharat Nain is offline
Registered User
no team
Team Role: Alumni
 
Join Date: Jan 2004
Rookie Year: 2003
Location: New York
Posts: 2,000
Bharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond repute
Send a message via AIM to Bharat Nain Send a message via MSN to Bharat Nain
Re: PWM inputs?

Quote:
Originally Posted by ghansel
Is there any way for the RC to accept a PWM input?
umm.. Why would you like to do that?
__________________
-= Bharat Nain =-

Whatever you do, you need courage. Whatever course you decide upon, there is always someone to tell you that you are wrong. There are always difficulties arising that tempt you to believe your critics are right. To map out a course of action and follow it to an end requires some of the same courage that a soldier needs. Peace has its victories, but it takes brave men and women to win them. - Ralph Waldo Emerson
  #4   Spotlight this post!  
Unread 18-05-2005, 22:29
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,587
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: PWM inputs?

Presumably you'd have a sensor that has a PWM output or something. A R-C circuit would smooth the signal out into a mostly DC signal.... However, the smoother you get it, the bigger delay there would be in the system. It's probably not terribly relevant if your PWM is high frequency, though.

For direct input, I think you'd need two digital interrupt inputs and a NOT IC. interrupts firing on the rising edge of the signal, so you start a timer when the straight signal fires, and stop the timer when the NOTed signal fires. Voila, the time of the pulse. Then you just need to calibrate the time widths to your data. And account for the delay from the NOT gate if you need real precision or something. It'd act to add a constant amount to your pulse widths, so as long as you calibrate it it shouldn't matter, though. Note that I'm not figuring out if the pulses are wide enough for the controller to measure or if there would be too many interrupts per second for the processor to handle.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
  #5   Spotlight this post!  
Unread 18-05-2005, 22:43
ghansel ghansel is offline
my amp goes to eleven
AKA: George H.
FRC #0019 (Big Red Robotics)
Team Role: Engineer
 
Join Date: Jan 2005
Location: Connecticut
Posts: 38
ghansel is infamous around these parts
Re: PWM inputs?

Quote:
Originally Posted by Kevin Sevcik
Presumably you'd have a sensor that has a PWM output or something. A R-C circuit would smooth the signal out into a mostly DC signal.... However, the smoother you get it, the bigger delay there would be in the system. It's probably not terribly relevant if your PWM is high frequency, though.

For direct input, I think you'd need two digital interrupt inputs and a NOT IC. interrupts firing on the rising edge of the signal, so you start a timer when the straight signal fires, and stop the timer when the NOTed signal fires. Voila, the time of the pulse. Then you just need to calibrate the time widths to your data. And account for the delay from the NOT gate if you need real precision or something. It'd act to add a constant amount to your pulse widths, so as long as you calibrate it it shouldn't matter, though. Note that I'm not figuring out if the pulses are wide enough for the controller to measure or if there would be too many interrupts per second for the processor to handle.

Thanks. I'll see what I can do, and I'll probably post my solution on here when (if?) I finish a PWM/analog converter.

Bharat: http://www.robot-electronics.co.uk/s...CMPS032004.htm

For gyro redundancy.

Thanks to all,
George
  #6   Spotlight this post!  
Unread 20-05-2005, 15:51
Unsung FIRST Hero
Mike Betts Mike Betts is offline
Electrical Engineer
no team
Team Role: Engineer
 
Join Date: Dec 2001
Rookie Year: 1995
Location: Homosassa, FL
Posts: 1,442
Mike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond repute
Re: PWM inputs?

Quote:
Originally Posted by Kevin Sevcik
...For direct input, I think you'd need two digital interrupt inputs and a NOT IC. interrupts firing on the rising edge of the signal, so you start a timer when the straight signal fires, and stop the timer when the NOTed signal fires. Voila, the time of the pulse...
Kevin, et al,

Use DIO3 and use both rising and falling edges as interrupts. Read Port B within the interrupt handler to determine which edge you are processing...

Mike
__________________
Mike Betts

Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013

As easy as 355/113...
  #7   Spotlight this post!  
Unread 20-05-2005, 21:08
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: PWM inputs?

Quote:
Originally Posted by Mike Betts
Kevin, et al,

Use DIO3 and use both rising and falling edges as interrupts. Read Port B within the interrupt handler to determine which edge you are processing...

Mike
This is exactly how the RC decoded the modulated IR signals from 2004. The code in receiver.c would be a great starting point. Receiver.c can be found in edu_tracker.zip and frc_tracker.zip located here: http://kevin.org/frc/2004.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #8   Spotlight this post!  
Unread 14-09-2005, 17:57
ghansel ghansel is offline
my amp goes to eleven
AKA: George H.
FRC #0019 (Big Red Robotics)
Team Role: Engineer
 
Join Date: Jan 2005
Location: Connecticut
Posts: 38
ghansel is infamous around these parts
Re: PWM inputs?

Thanks a bunch. Unfortunately (should have posted about it before) we've decided to use an integrator on a gyro instead of a compass.

Thanks anyway,
George

Last edited by ghansel : 14-09-2005 at 18:03.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling Failed Teh Mike Programming 7 09-02-2005 13:27
FYI about using PWM 13-16 with interrupts cabbagekid2 Programming 6 22-01-2005 00:54
Using an Operator Interface with the 2004 EDU RC wirelessly Dave Flowerday Robotics Education and Curriculum 34 19-04-2004 19:06
pwm 13-15 wayne 05 Programming 2 04-10-2003 12:08
PWM and burning out motors patrickrd Technical Discussion 7 19-06-2003 15:30


All times are GMT -5. The time now is 03:49.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi