|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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
|
|||||
|
|||||
|
Re: Is the maximum PWM value 254 or 255?
I've always used 255.
the difference should be absolutely negligibly though. |
|
#3
|
|||||
|
|||||
|
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.
|
|
#4
|
|||
|
|||
|
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.
|
|
#5
|
||||
|
||||
|
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
|
||||
|
||||
|
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
|
||||
|
||||
|
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.
|
|
#8
|
||||
|
||||
|
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
|
|||||
|
|||||
|
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
|
||||
|
||||
|
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
|
||||||
|
||||||
|
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
|
||||
|
||||
|
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:
Last edited by markulrich : 25-06-2008 at 15:23. Reason: typo |
|
#13
|
||||
|
||||
|
Re: Is the maximum PWM value 254 or 255?
Are the PWM values valid for the new operating system?
|
|
#14
|
||||
|
||||
|
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
|
||||
|
||||
|
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 |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |