Go to Post Mentors build mentors. - Siri [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Events   CD-Media   CD-Spy   FRC-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 01-25-2008, 10:42 AM
jax1488's Avatar
jax1488 jax1488 is offline
The Northern Chicken Wizards
AKA: jack stone
FRC #0522 (Robo Wizards)
Team Role: Alumni
 
Join Date: Feb 2006
Rookie Year: 2002
Location: staten island, new york
Posts: 131
jax1488 is a name known to alljax1488 is a name known to alljax1488 is a name known to alljax1488 is a name known to alljax1488 is a name known to alljax1488 is a name known to all
Send a message via AIM to jax1488 Send a message via MSN to jax1488 Send a message via Yahoo to jax1488
MAKE A MOTOR PULSE????

Hello, I would greatly appreciate if someone could help me figure out how to make a motor pulse using MPLab. For example, The motor (pwm03) needs to pulse on and off continually every second. Any help programming this would be greatly appreciated!!
__________________
"i dont like it, but i cant tell u why!" -"Dearrin"

2006 "aim high" national championship champions. (ty 296 and 217, NOTHERN CHICKEN WIZARDS... UNITE!)
2006 Greater Toronto Regional Chairman's Award
2004 N.Y.C. Regional Champion
2004 N.Y.C. GM Industrial Design
2004 N.Y.C. Daimler Chrysler Team Spirit
2003 N.Y.C. Regional Champion
  #2   Spotlight this post!  
Unread 01-25-2008, 10:55 AM
rhoads2234's Avatar
rhoads2234 rhoads2234 is offline
Registered User
AKA: Erin
FRC #2234
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: PA
Posts: 80
rhoads2234 will become famous soon enough
Re: MAKE A MOTOR PULSE????

why do you need it to?

use a timer and check it and then do mod math to find the time and turn on or off according to it
__________________
ALWAYS a mechanical problem!
  #3   Spotlight this post!  
Unread 01-25-2008, 11:03 AM
Tom Line's Avatar
Tom Line Tom Line is offline
Raptors can't turn doorknobs.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 2,114
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
Re: MAKE A MOTOR PULSE????

The easy way to do this is:

You know that user_routines.c Default executes once every 26 (approx) ms.

That means that every 38 loops is nearly exactly 1 second. Simply write a counter, and then an if-then-else. It would look something like this:

count=count+1;

if (count == 38)
{
pwmXX=255;
count=0;
}
else
pwmXX=127;

Note you would want to declare the counter as a static variable.
  #4   Spotlight this post!  
Unread 01-25-2008, 11:50 AM
jax1488's Avatar
jax1488 jax1488 is offline
The Northern Chicken Wizards
AKA: jack stone
FRC #0522 (Robo Wizards)
Team Role: Alumni
 
Join Date: Feb 2006
Rookie Year: 2002
Location: staten island, new york
Posts: 131
jax1488 is a name known to alljax1488 is a name known to alljax1488 is a name known to alljax1488 is a name known to alljax1488 is a name known to alljax1488 is a name known to all
Send a message via AIM to jax1488 Send a message via MSN to jax1488 Send a message via Yahoo to jax1488
Re: MAKE A MOTOR PULSE????

i need a little more help with this. Where exactly would i put the variables unsigned char unsigned int? Or does anyone have a simpler way of doing this? Please let me know i really need help. Thank You.
__________________
"i dont like it, but i cant tell u why!" -"Dearrin"

2006 "aim high" national championship champions. (ty 296 and 217, NOTHERN CHICKEN WIZARDS... UNITE!)
2006 Greater Toronto Regional Chairman's Award
2004 N.Y.C. Regional Champion
2004 N.Y.C. GM Industrial Design
2004 N.Y.C. Daimler Chrysler Team Spirit
2003 N.Y.C. Regional Champion
  #5   Spotlight this post!  
Unread 01-25-2008, 12:44 PM
Tom Line's Avatar
Tom Line Tom Line is offline
Raptors can't turn doorknobs.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 2,114
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
Re: MAKE A MOTOR PULSE????

The only variable involved is your counter. Put it in the declaration section of the routine that you put the code in. This is generally located at the beginning of the routine before any of the code, but after the open bracket {
  #6   Spotlight this post!  
Unread 01-25-2008, 01:14 PM
jax1488's Avatar
jax1488 jax1488 is offline
The Northern Chicken Wizards
AKA: jack stone
FRC #0522 (Robo Wizards)
Team Role: Alumni
 
Join Date: Feb 2006
Rookie Year: 2002
Location: staten island, new york
Posts: 131
jax1488 is a name known to alljax1488 is a name known to alljax1488 is a name known to alljax1488 is a name known to alljax1488 is a name known to alljax1488 is a name known to all
Send a message via AIM to jax1488 Send a message via MSN to jax1488 Send a message via Yahoo to jax1488
Re: MAKE A MOTOR PULSE????

eh, unfortunately, i'm still kind of lost. Someone please help
__________________
"i dont like it, but i cant tell u why!" -"Dearrin"

2006 "aim high" national championship champions. (ty 296 and 217, NOTHERN CHICKEN WIZARDS... UNITE!)
2006 Greater Toronto Regional Chairman's Award
2004 N.Y.C. Regional Champion
2004 N.Y.C. GM Industrial Design
2004 N.Y.C. Daimler Chrysler Team Spirit
2003 N.Y.C. Regional Champion
  #7   Spotlight this post!  
Unread 01-25-2008, 01:37 PM
Qbranch's Avatar
Qbranch Qbranch is offline
wow college goes fast.
AKA: Alex Suchko
FRC #1024 (Kil-A-Bytes)
Team Role: Alumni
 
Join Date: Apr 2006
Rookie Year: 2006
Location: Indianapolis
Posts: 1,174
Qbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond repute
Re: MAKE A MOTOR PULSE????

Quote:
Originally Posted by jax1488 View Post
eh, unfortunately, i'm still kind of lost. Someone please help
Ok, can you tell us how much experience you have with programming first of all.

-q
__________________



2008 Championship Rockwell Automation Innovation in Control Award Winners
Electrical Engineer Illini
1024 | Programmer '06, '07, '08 | Driver '08
  #8   Spotlight this post!  
Unread 01-25-2008, 01:40 PM
jax1488's Avatar
jax1488 jax1488 is offline
The Northern Chicken Wizards
AKA: jack stone
FRC #0522 (Robo Wizards)
Team Role: Alumni
 
Join Date: Feb 2006
Rookie Year: 2002
Location: staten island, new york
Posts: 131
jax1488 is a name known to alljax1488 is a name known to alljax1488 is a name known to alljax1488 is a name known to alljax1488 is a name known to alljax1488 is a name known to all
Send a message via AIM to jax1488 Send a message via MSN to jax1488 Send a message via Yahoo to jax1488
Re: MAKE A MOTOR PULSE????

well i can program the robot to move , program relays, sometimes digital inputs.... switches, triggers, buttons, autonomous.
__________________
"i dont like it, but i cant tell u why!" -"Dearrin"

2006 "aim high" national championship champions. (ty 296 and 217, NOTHERN CHICKEN WIZARDS... UNITE!)
2006 Greater Toronto Regional Chairman's Award
2004 N.Y.C. Regional Champion
2004 N.Y.C. GM Industrial Design
2004 N.Y.C. Daimler Chrysler Team Spirit
2003 N.Y.C. Regional Champion
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
Make my motor turn! [RSMT]sturm Programming 6 01-24-2008 06:54 AM
make motor go slower coolguybigt Motors 1 02-19-2007 08:36 AM
Remote Pulse Monitoring System kaveena Programming 1 07-19-2006 09:02 AM
Measuring a Pulse Width MikeDubreuil Programming 22 07-21-2005 09:22 AM
PUlse counting junkyarddawg Technical Discussion 1 01-31-2002 02:33 PM


All times are GMT -5. The time now is 08:53 AM.

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


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