If there isn't unity in your team, the outcome will never be good. - Arefin Bari [more]
 Chief Delphi MAKE A MOTOR PULSE????
 CD-Media CD-Spy
 portal register members calendar search Today's Posts Mark Forums Read FAQ rules

#1
01-25-2008, 10:42 AM
 jax1488 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
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
01-25-2008, 10:55 AM
 rhoads2234 Registered User AKA: Erin FRC #2234 Team Role: Programmer Join Date: Jan 2007 Rookie Year: 2007 Location: PA Posts: 80
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
01-25-2008, 11:03 AM
 Tom Line 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,449
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
01-25-2008, 11:50 AM
 jax1488 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
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
01-25-2008, 12:44 PM
 Tom Line 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,449
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
01-25-2008, 01:14 PM
 jax1488 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
Re: MAKE A MOTOR PULSE????

__________________
"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
01-25-2008, 01:37 PM
 Qbranch wow college goes fast. AKA: Alex FRC #1024 (Kil-A-Bytes) Team Role: Alumni Join Date: Apr 2006 Rookie Year: 2006 Location: Indianapolis Posts: 1,174
Re: MAKE A MOTOR PULSE????

Quote:
Ok, can you tell us how much experience you have with programming first of all.

-q
__________________
Electrical Engineer Illini
1024 | Programmer '06, '07, '08 | Driver '08
#8
01-25-2008, 01:40 PM
 jax1488 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
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

 Thread Tools Display Modes Rate This Thread Linear Mode Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 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 User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements     User Announcements FIRST     General Forum         FIRST E-Mail Blast Archive     Rumor Mill     Career     Robot Showcase Technical     Technical Discussion     Robotics Education and Curriculum     Motors     Electrical         CAN     Programming         NI LabVIEW         C/C++         Java         Python     Control System         FRC Control System         Sensors     Pneumatics     Kit & Additional Hardware     CAD         Inventor         SolidWorks         Pro ENGINEER / Creo     IT / Communications         3D Animation and Competition         Website Design/Showcase         Videography and Photography         Computer Graphics     National Instruments LabVIEW and Data Acquisition         LabView and Data Acquisition Competition     Awards         Chairman's Award     Rules/Strategy         Scouting         You Make The Call     Team Organization         Fundraising         Starting New Teams         Finding A Team         College Teams     Championship Event     Regional Competitions     District Events     Off-Season Events     Thanks and/or Congrats     FRC Game Design     OCCRA         OCCRA Q&A         OCCRA Programming Other     Unsung FIRST Heroes     Chit-Chat         Games/Trivia             Fantasy FIRST     Car Nack's Corner     College & University Education     Dean Kamen's Inventions     FIRST-related Organizations         Western Region Robotics Forum         Robot Chicks Union (RCU)         Southern California Regional Robotics Forum         FIRST Interactive Rural SupporT         FIRST Scouting Network         FloridaFIRST         FIRSTwiki         The Blue Alliance             Video Archives     FIRST Historians     FIRST In the News...     FIRST Lego League         Lego Mindstorm Discussion     FIRST Tech Challenge     VEX         VEX Robotics Competition         VEX IQ     Televised Robotics     Math and Science         NASA Discussion ChiefDelphi.com Website     CD Forum Support     Extra Discussion Old Forum Archives     1999     2000     2001

 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 10:53 PM.

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

 -- English (12 hour) -- English (24 hour) Contact Us - Chief Delphi - Rules - Archive - Top