Go to Post Since you have to undo all the connections anyway in order to swap them, you might as well take advantage of the opportunity to do some simple and straightforward troubleshooting. - Alan Anderson [more]
Home
Go Back   Chief Delphi > Technical > Programming
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 24-06-2008, 17:28
markulrich's Avatar
markulrich markulrich is offline
Head Captain and LabVIEW Programmer
FRC #2129 (Ultraviolet)
 
Join Date: Jan 2007
Rookie Year: 2003
Location: Minneapolis
Posts: 46
markulrich has a spectacular aura aboutmarkulrich has a spectacular aura about
Is the maximum PWM value 254 or 255?

My team has always used 255 as the cut-off point for PWM values (otherwise things loop over), but whenever I look at example code I see others using 254. Why is this? Are the victors pre-calibrated to use 254? Do you get any more power by using 255?
  #2   Spotlight this post!  
Unread 24-06-2008, 17:44
Joe G.'s Avatar
Joe G. Joe G. is offline
Taking a few years (mostly) off
AKA: Josepher
no team (Formerly 1687, 5400)
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2007
Location: Worcester, MA
Posts: 1,452
Joe G. has a reputation beyond reputeJoe G. has a reputation beyond reputeJoe G. has a reputation beyond reputeJoe G. has a reputation beyond reputeJoe G. has a reputation beyond reputeJoe G. has a reputation beyond reputeJoe G. has a reputation beyond reputeJoe G. has a reputation beyond reputeJoe G. has a reputation beyond reputeJoe G. has a reputation beyond reputeJoe G. has a reputation beyond repute
Send a message via AIM to Joe G.
Re: Is the maximum PWM value 254 or 255?

I've always used 255.
the difference should be absolutely negligibly though.
__________________
FIRST is not about doing what you can with what you know. It is about doing what you thought impossible, with what you were inspired to become.

2007-2010: Student, FRC 1687, Highlander Robotics
2012-2014: Technical Mentor, FRC 1687, Highlander Robotics
2015-2016: Lead Mentor, FRC 5400, Team WARP
2016-???: Volunteer and freelance mentor-for-hire
  #3   Spotlight this post!  
Unread 24-06-2008, 18:05
Madison's Avatar
Madison Madison is offline
Dancing through life...
FRC #0488 (Xbot)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1999
Location: Seattle, WA
Posts: 5,244
Madison has a reputation beyond reputeMadison has a reputation beyond reputeMadison has a reputation beyond reputeMadison has a reputation beyond reputeMadison has a reputation beyond reputeMadison has a reputation beyond reputeMadison has a reputation beyond reputeMadison has a reputation beyond reputeMadison has a reputation beyond reputeMadison has a reputation beyond reputeMadison has a reputation beyond repute
Re: Is the maximum PWM value 254 or 255?

The IFI system was designed to reset if it saw some series of values of 255, as I recall. Someone wiser than I in these matters will elaborate.
__________________
--Madison--

...down at the Ozdust!

Like a grand and miraculous spaceship, our planet has sailed through the universe of time. And for a brief moment, we have been among its many passengers.
  #4   Spotlight this post!  
Unread 24-06-2008, 18:09
tennispro9911 tennispro9911 is offline
Alumni
AKA: Matt
FRC #2053 (TigerTronics)
Team Role: Alumni
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Endicott
Posts: 86
tennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to beholdtennispro9911 is a splendid one to behold
Send a message via AIM to tennispro9911
Re: Is the maximum PWM value 254 or 255?

If 127 is truely exact middle then 254 should be max. In reality, I don't know. Our team has used both values at different points in time with no noticable differences.
__________________
2053 Alumni

  #5   Spotlight this post!  
Unread 24-06-2008, 18:42
usbcd36's Avatar
usbcd36 usbcd36 is offline
Registered User
AKA: "DOS"
FRC #2399 (The Fighting Unicorns)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Solon, OH
Posts: 151
usbcd36 is a jewel in the roughusbcd36 is a jewel in the roughusbcd36 is a jewel in the rough
Re: Is the maximum PWM value 254 or 255?

I've always calculated the PWM value as being 127±127, so I say 254.
  #6   Spotlight this post!  
Unread 24-06-2008, 18:44
JimWright949's Avatar
JimWright949 JimWright949 is offline
The Owen Day of Seattle
AKA: Jim Wright
FRC #4542 (Titanium Talons)
Team Role: Mentor
 
Join Date: Sep 2003
Rookie Year: 2003
Location: Redmond, WA
Posts: 94
JimWright949 is a splendid one to beholdJimWright949 is a splendid one to beholdJimWright949 is a splendid one to beholdJimWright949 is a splendid one to beholdJimWright949 is a splendid one to beholdJimWright949 is a splendid one to beholdJimWright949 is a splendid one to behold
Re: Is the maximum PWM value 254 or 255?

If memory serves, pre-2004 RCs would disable the PWM port if it saw 255. 2004 up to now can use the full 0-255 range. A signed 8 bit number goes from -128 to 127 by the way.

-Jim
  #7   Spotlight this post!  
Unread 24-06-2008, 18:49
Alex.Norton's Avatar
Alex.Norton Alex.Norton is offline
Fidgetting
no team
 
Join Date: Apr 2005
Rookie Year: 2003
Location: Ft. Collins, Colorado
Posts: 190
Alex.Norton has much to be proud ofAlex.Norton has much to be proud ofAlex.Norton has much to be proud ofAlex.Norton has much to be proud ofAlex.Norton has much to be proud ofAlex.Norton has much to be proud ofAlex.Norton has much to be proud ofAlex.Norton has much to be proud of
Send a message via AIM to Alex.Norton Send a message via MSN to Alex.Norton
Re: Is the maximum PWM value 254 or 255?

Since everything in a computer is measured in binary. In this it is a char there fore is 8 bits so can hold 2^8 possibilities, or 256, however as with everything in programing start with zero so it holds any number from 0 to 255.
__________________
"History doesn't repeat itself - at best it sometimes rhymes" --Mark Twain
  #8   Spotlight this post!  
Unread 24-06-2008, 18:59
tseres's Avatar
tseres tseres is offline
obsessed with FIRST...
FRC #1565 (Think Tank Tech)
Team Role: Leadership
 
Join Date: Apr 2007
Rookie Year: 2007
Location: Cambridge, ON
Posts: 305
tseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of light
Re: Is the maximum PWM value 254 or 255?

255 is max, as an 8bit number is 256, therefore 0-255. the victors also have a deadband of +/- 5 values, so anything from 122-132 should be neutral, but i'll still do 127 just to be sure
__________________


  #9   Spotlight this post!  
Unread 24-06-2008, 20:02
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Is the maximum PWM value 254 or 255?

The IFI control system will not send a pwm value of 255. If you try to set a 255, it turns into a 254.

The historical reason for this is the design of the data packets between the OI and RC. Two 255s in a row flag the start of a packet.
  #10   Spotlight this post!  
Unread 24-06-2008, 20:08
markulrich's Avatar
markulrich markulrich is offline
Head Captain and LabVIEW Programmer
FRC #2129 (Ultraviolet)
 
Join Date: Jan 2007
Rookie Year: 2003
Location: Minneapolis
Posts: 46
markulrich has a spectacular aura aboutmarkulrich has a spectacular aura about
Re: Is the maximum PWM value 254 or 255?

Thanks Alan! That explains a lot; using 254 is also nice because then 127 is the true middle.
  #11   Spotlight this post!  
Unread 24-06-2008, 22:47
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,586
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Is the maximum PWM value 254 or 255?

There isn't any difference between 254 and 255 when used with a victor speed controller, in fact, there isn't any difference between 255 and 233. See this post on the IFI forum: http://www.ifirobotics.com/forum/viewtopic.php?t=317

Also notice that at the default calibration, the real center is 132.
  #12   Spotlight this post!  
Unread 25-06-2008, 14:17
markulrich's Avatar
markulrich markulrich is offline
Head Captain and LabVIEW Programmer
FRC #2129 (Ultraviolet)
 
Join Date: Jan 2007
Rookie Year: 2003
Location: Minneapolis
Posts: 46
markulrich has a spectacular aura aboutmarkulrich has a spectacular aura about
Re: Is the maximum PWM value 254 or 255?

Look at the attached chart. The PWM input is x-axis, and y-axis is estimated output (%) based on these figured from IFI:

Quote:
VAULE STATE LED STATUS Pulse Width
0 – 41 Full Reverse RED 0.856 – 1.06 ms
42 – 125 Reverse OFF 1.07 – 1.48 ms
126 – 139 Neutral YELLOW 1.49 – 1.55 ms
140 – 230 Forward OFF 1.56 – 2.00 ms
231 – 254 Full Forward GREEN 2.01 – 2.12 ms
The other, darker line is the target output based on a cubic function with dead bands at the beginning, middle, and end. I am working on creating a look-up table to insert into code that could accomplish this. Any suggestions are appreciated.
Attached Thumbnails
Click image for larger version

Name:	target v estimated.jpg
Views:	100
Size:	41.8 KB
ID:	6722  

Last edited by markulrich : 25-06-2008 at 15:23. Reason: typo
  #13   Spotlight this post!  
Unread 25-06-2008, 16:15
craigcd's Avatar
craigcd craigcd is offline
Registered User
FRC #2221 (RoboDawgs)
Team Role: Engineer
 
Join Date: Nov 2004
Rookie Year: 2004
Location: Carriere Ms 39426
Posts: 70
craigcd has a brilliant futurecraigcd has a brilliant futurecraigcd has a brilliant futurecraigcd has a brilliant futurecraigcd has a brilliant futurecraigcd has a brilliant futurecraigcd has a brilliant futurecraigcd has a brilliant futurecraigcd has a brilliant futurecraigcd has a brilliant futurecraigcd has a brilliant future
Re: Is the maximum PWM value 254 or 255?

Are the PWM values valid for the new operating system?
  #14   Spotlight this post!  
Unread 25-06-2008, 17:03
markulrich's Avatar
markulrich markulrich is offline
Head Captain and LabVIEW Programmer
FRC #2129 (Ultraviolet)
 
Join Date: Jan 2007
Rookie Year: 2003
Location: Minneapolis
Posts: 46
markulrich has a spectacular aura aboutmarkulrich has a spectacular aura about
Re: Is the maximum PWM value 254 or 255?

I think these values are valid for the new operating system because I believe that the new operating system will be using the same victors from IFI.
  #15   Spotlight this post!  
Unread 02-07-2008, 01:50
Fletch1373's Avatar
Fletch1373 Fletch1373 is offline
Registered User
AKA: Fletch
FRC #3181 (Panthers)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2004
Location: Rochester, NY
Posts: 251
Fletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud of
Re: Is the maximum PWM value 254 or 255?

from what I've read about the new control system(and anyone is free to correct me), it will be using the same Victors as previous years and therefore the 8 bit 0-255 range would still be valid

I apologize if I just restated everything that was already said... I just thought I'd get my 2 cents in
__________________
Student:
<04: FRC0213> <05-08: FRC1373>
Mentor:
<09-10: FRC0809> <11-12: FRC3555> <12-14: FRC0073> <15-??: FRC3181>
Volunteer:
<FTAA> <CSA> <Defense Coordinator> <Scorekeeper> <Robot Inspector> <Official Scorer>
2016 Tour:
CTWAT [DefCoord] > Pittsburgh[Mentor/DefCoord] > TVR[FTAA] > FLR[CSA] > NE DCMP[CSA] > CMP[CSA]
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
Robot Controller reset issue when pwm value changes wt200999 Programming 4 04-01-2008 22:15
Maximum PWM length mechanicalbrain Electrical 5 13-03-2006 23:18
Dividing PWM value - easy question jgannon Programming 1 04-02-2004 22:57
Encoder Counts/time period to PWM value Zee Programming 10 04-02-2004 01:41
Why can't you use 255 in PWM? Andrew Technical Discussion 4 29-05-2003 14:50


All times are GMT -5. The time now is 19:27.

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