Go to Post The rules are the rules, but if the rules get so ridiculous some of us may choose not to play anymore and that is the bigger shame. - Paul Copioli [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,447
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,243
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,567
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.
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 00:08.

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