Go to Post Anything that moves sideways is a waste of time. - Tom Bottiglieri [more]
Home
Go Back   Chief Delphi > Technical > Control System
CD-Events   CD-Media   CD-Spy   FRC-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 08-05-2012, 09:35 PM
Michael Hill's Avatar
Michael Hill Michael Hill is offline
Registered User
FRC #3138 (Innovators Robotics)
Team Role: Mentor
 
Join Date: Jul 2004
Rookie Year: 2003
Location: Dayton, OH
Posts: 846
Michael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond repute
Are we still using only 256 unique PWM steps?

It seems like that limitation should be lifted when using the cRIO board, which appears to be a rebranded NI-9076 board running the Xilinx Spartan-6 LX45 FPGA, which looks like it is a 16-bit controller, and that seems to usually be the "bit chokepoint" when trying to generate a pwm signal.....This isn't a limitation by the victors or jags are they? I haven't taken apart a Victor, but it looks like there are just a bunch of LM317s in there. It looks like there's a large capacitor. Now if you just have an RC filter in there (which explains the large cap), there should be no problem accepting a higher resolution PWM signal. I haven't tried this. Would that be possible to do? Sometimes 8-bits just isn't enough.
Reply With Quote
  #2   Spotlight this post!  
Unread 08-05-2012, 09:50 PM
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,596
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: Are we still using only 256 unique PWM steps?

There are many good explanations of the PWM communication protocol on the web and on these forums. I suggest starting there before moving forward.

Quote:
Originally Posted by Michael Hill View Post
It seems like that limitation should be lifted when using the cRIO board, which appears to be a rebranded NI-9076 board running the Xilinx Spartan-6 LX45 FPGA, which looks like it is a 16-bit controller, and that seems to usually be the "bit chokepoint" when trying to generate a pwm signal.....This isn't a limitation by the victors or jags are they? I haven't taken apart a Victor, but it looks like there are just a bunch of LM317s in there. It looks like there's a large capacitor. Now if you just have an RC filter in there (which explains the large cap), there should be no problem accepting a higher resolution PWM signal. I haven't tried this. Would that be possible to do? Sometimes 8-bits just isn't enough.
There are several fundamental misunderstandings in this section.

The FPGA is not a 16 bit controller.

The big capacitor is to handle the large current spikes when the bridge is switched.

These PWM signals are not decoded by an RC filter.

8 real bits certainly is enough for FRC.

The "bit chokepoint" in PWM is fundamentally limited by the IO update rate and the combined accuracy of the oscillators in sender and receiver.
Reply With Quote
  #3   Spotlight this post!  
Unread 08-05-2012, 09:59 PM
Michael Hill's Avatar
Michael Hill Michael Hill is offline
Registered User
FRC #3138 (Innovators Robotics)
Team Role: Mentor
 
Join Date: Jul 2004
Rookie Year: 2003
Location: Dayton, OH
Posts: 846
Michael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond repute
Re: Are we still using only 256 unique PWM steps?

Quote:
Originally Posted by EricVanWyk View Post
There are many good explanations of the PWM communication protocol on the web and on these forums. I suggest starting there before moving forward.



There are several fundamental misunderstandings in this section.

The FPGA is not a 16 bit controller.

The big capacitor is to handle the large current spikes when the bridge is switched.

These PWM signals are not decoded by an RC filter.

8 real bits certainly is enough for FRC.

The "bit chokepoint" in PWM is fundamentally limited by the IO update rate and the combined accuracy of the oscillators in sender and receiver.
I'd disagree that 8 bits is enough, but at any rate, how are the PWM signals decoded?
Reply With Quote
  #4   Spotlight this post!  
Unread 08-05-2012, 10:08 PM
Michael Hill's Avatar
Michael Hill Michael Hill is offline
Registered User
FRC #3138 (Innovators Robotics)
Team Role: Mentor
 
Join Date: Jul 2004
Rookie Year: 2003
Location: Dayton, OH
Posts: 846
Michael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond repute
Re: Are we still using only 256 unique PWM steps?

Also, what bit controller is the LX45? Everything I'm seeing is saying it's 16-bit.
Reply With Quote
  #5   Spotlight this post!  
Unread 08-05-2012, 10:27 PM
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: 7,823
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: Are we still using only 256 unique PWM steps?

Quote:
Originally Posted by Michael Hill View Post
This isn't a limitation by the victors or jags are they?
It is. See the following FAQs on the IFI Technical Support Forum: http://ifirobotics.com/forum/viewtopic.php?t=317

I believe there is additional resolution when using a Jaguar in CAN.

Quote:
Originally Posted by Michael Hill View Post
Also, what bit controller is the LX45? Everything I'm seeing is saying it's 16-bit.
You can't think of an FPGA like you would a microcontroller. While you can embed a microprocessor core inside an FPGA, that isn't implemented in the FPGA. Instead, you can implement as large of a bus or register as you have available I/O and gates.

Note: The xilinx microblaze is a 32 bit processor.
Reply With Quote
  #6   Spotlight this post!  
Unread 08-06-2012, 01:11 AM
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 892
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Are we still using only 256 unique PWM steps?

Quote:
Originally Posted by Michael Hill View Post
Also, what bit controller is the LX45? Everything I'm seeing is saying it's 16-bit.
I can't imagine what you might be referring to. Can you post a link?
Reply With Quote
  #7   Spotlight this post!  
Unread 08-06-2012, 07:02 AM
Unsung FIRST Hero
Al Skierkiewicz Al Skierkiewicz is offline
Broadcast Eng/Chief Robot Inspector
AKA: Big Al
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1996
Location: Wheeling, IL
Posts: 9,932
Al Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond repute
Re: Are we still using only 256 unique PWM steps?

Quote:
Originally Posted by Michael Hill View Post
I haven't taken apart a Victor, but it looks like there are just a bunch of LM317s in there. It looks like there's a large capacitor.
The devices you think are 317's are in fact IRL3103 Power MOSFETs in the Victor. As Eric pointed out the large cap on both the Victor and the Jag are to smooth power supply. 317s can't handle brake mode, make a minimum of 1.25 volts output when the control input is grounded, can't control 40 amps each and require a large diode for reverse polarity protection.
As to the resolution, most teams don't use the ~120 bits (accounting for the deadband and only one direction) as it is and most don't even calibrate the controllers.
__________________
Good Luck All. Learn something new, everyday!
Al
WB9UVJ
www.wildstang.org
________________________
All is better now, NOS parts are working fine. Why does this year's game remind me of Violet in Willie Wonka? Hmmmm, I see blueberries!
Reply With Quote
  #8   Spotlight this post!  
Unread 08-06-2012, 07:37 AM
Greg McKaskle Greg McKaskle is offline
Registered User
no team (Team NI)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 3,914
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Are we still using only 256 unique PWM steps?

A few small points on the PWM signals.

The WPILib API uses a single float value ranging from -1 to 1. Under the hood, it maps this between the usable high and low int values based on the calibration info. This doesn't attempt to linearize the response, but does remove the outer shoulders. Even when not calibrated, these values are given mfr specific settings which should lead to pretty good performance, especially for drive motors.

As noted, neither the 9076's Freescale processor or the FPGA are 16 bit. The FPGA, as used, has no cores. It is highly reconfigurable, but for FIRST, thus far it acts as the high-horsepower I/O engine. It is capable of I/O rates up to 40MHz, but the I/O modules, especially those selected for use in the FIRST competition, take many cycles to reconfigure. The digital module being used is highly flexible with 32 channels, but with an access time of around 6.5microsecs. For discrete I/O on the robot, this is often the limiting factor -- encoder rate, PLM generation resolution, digital triggers, etc. As shown at ni.com/motion, the 9076 is not the limiting factor.

Greg McKaskle
Reply With Quote
  #9   Spotlight this post!  
Unread 08-06-2012, 07:38 AM
Chris Hibner's Avatar Unsung FIRST Hero
Chris Hibner Chris Hibner is offline
Eschewing Obfuscation Since 1990
AKA: Lars Kamen's Roadie
FRC #0051 (Wings of Fire)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1997
Location: Canton, MI
Posts: 1,393
Chris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond repute
Re: Are we still using only 256 unique PWM steps?

Quote:
Originally Posted by Michael Hill View Post
I'd disagree that 8 bits is enough...
8 bits is more than enough for FRC, especially considering the PWM signal is actually a 1 bit signal.

You can get more resolution than 8 bits if you modulate the PWM command properly. For example, if you want 9 bit resolution you can alternately add and subtract a half bit from every output. For example, let's say you really want an output of 132.5. In that case, send 133 one sample and 132 the next sample (over and over again) and the electronics and mechanics of the system will act just as if you're sending 132.5. Of course, this depends on the system "time constant" being much slower than the rate you are outputting PWM commands (which it usually is for an FRC robot). If you want more resolution than that, you can create a fancy algorithm with a counter and a threshold, which is how PWM is actually implemented in many cases.
__________________
-
An ounce of perception is worth a pound of obscure.
Reply With Quote
  #10   Spotlight this post!  
Unread 08-06-2012, 06:11 PM
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,596
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: Are we still using only 256 unique PWM steps?

When I teach my students, I stress the difference between Pulse Width Modulation and Duty Cycle Modulation. It is a bit pedantic, but I feel that it helps to clear things up.

There are four measurements that can describe the timing of a square wave, but you can use any two to fully define it: duty cycle, frequency, positive width, negative width. The choice of which two depends heavily on the application, and helps separate the relevant factors.

PWM is dimensioned by the positive width (value) and the frequency (symbol rate). As frequency changes, the positive width stays the same to send the same information.

DCM is dimensioned by the duty cycle (applied 'voltage') and the frequency (allowed ripple). As frequency changes, the duty cycle stays the same to send the same average 'voltage' to the motor.

The microcontroller in a victor or jaguar measure the pulse width of the PWM signal from the cRIO and calculate an appropriate duty cycle for the DCM signal they send to motor through their bridge.

In mechanical terms, you can dimension a drawing many ways and produce the same part, but you may choose to show and hide a particular set to better communicate intention.
Reply With Quote
  #11   Spotlight this post!  
Unread 08-06-2012, 06:50 PM
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to earth once again
FRC #1676 (Pascack PI Oneers)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Montvale NJ
Posts: 6,388
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: Are we still using only 256 unique PWM steps?

To beat a dead horse, 256 levels of PWM control are plenty. One must consider the system to which the output of the controller is connected - DC motors don't really have much of a reaction to voltages that differ by something on the order of 0.1 volt. Take that into the mechanism to which the motor is attached, and inertia will foil you every time.

Once you have reached overkill, more is not useful.
__________________

I am N2IRZ - What's your callsign?
Reply With Quote
  #12   Spotlight this post!  
Unread 08-06-2012, 09:16 PM
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 6,005
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Are we still using only 256 unique PWM steps?


Doing the math for grins, a 4 microsecond change in pulse width signal to the Victor corresponds to roughly 0.8% change in the duty cycle output which is approximately equivalent to a 0.1 volt change seen by the motor.

A 0.1 change in voltage to a CIM operating at 12 volts into a constant load at the max efficiency point on the curve results in about a 1% change in motor speed.

I wonder how stable and accurate the pulse width coming from the DSC is. Has anybody ever hooked it up to a logic analyzer?




Last edited by Ether : 08-07-2012 at 03:38 PM. Reason: I found some equipment with 1 MHz edge sampling. I'll re-post as time permits.
Reply With Quote
  #13   Spotlight this post!  
Unread 08-07-2012, 04:32 PM
Michael Hill's Avatar
Michael Hill Michael Hill is offline
Registered User
FRC #3138 (Innovators Robotics)
Team Role: Mentor
 
Join Date: Jul 2004
Rookie Year: 2003
Location: Dayton, OH
Posts: 846
Michael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond reputeMichael Hill has a reputation beyond repute
Re: Are we still using only 256 unique PWM steps?

Quote:
Originally Posted by Al Skierkiewicz View Post
The devices you think are 317's are in fact IRL3103 Power MOSFETs in the Victor. As Eric pointed out the large cap on both the Victor and the Jag are to smooth power supply. 317s can't handle brake mode, make a minimum of 1.25 volts output when the control input is grounded, can't control 40 amps each and require a large diode for reverse polarity protection.
As to the resolution, most teams don't use the ~120 bits (accounting for the deadband and only one direction) as it is and most don't even calibrate the controllers.
Ah, that makes a lot more sense. I was wondering how they would get by the 1.25 reference voltage of a LM317. I guess they COULD use LT3080s to get around that, but like I mentioned before, I haven't taken a Victor apart (mostly because they're not mine, and our team doesn't have the kind of resources to waste on me accidentally breaking a Victor).

The reason I mentioned that it would be nicer to have more resolution is well...put it this way. This year, the majority of teams (including 3138), had shooter wheels with a speed controller. If your max speed (that is full voltage to the motors/128 counts) is 4000 RPM, which is easily attainable, the finest you can change your motor speed by is ~30 RPM, which can be a heck of a difference. I'm sure there's got to be a way to use it as an unsigned value (that is 0-12V rather than -12-12V) to get 256 counts of resolution, but that would still only give you a 15 RPM resolution. While many teams figured out it didn't make a huge difference, it would be nice from a controls perspective to be able to control it down to a single RPM (which would be attainable with a 12-bit PWM signal)
Reply With Quote
  #14   Spotlight this post!  
Unread 08-07-2012, 04:50 PM
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 6,005
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Are we still using only 256 unique PWM steps?

Quote:
Originally Posted by Michael Hill View Post
The reason I mentioned that it would be nicer to have more resolution is well...put it this way. This year, the majority of teams (including 3138), had shooter wheels with a speed controller. If your max speed (that is full voltage to the motors/128 counts) is 4000 RPM, which is easily attainable, the finest you can change your motor speed by is ~30 RPM, which can be a heck of a difference.
If:

a) your wheel has sufficient moment of inertia, and

b) you are reading the wheel speed sensor, computing your control algorithm, and outputting a new motor command fast enough,

... then you are not limited by the resolution of the motor command.

In fact, you can get very accurate and stable motor speed with only 1-bit resolution of the command (ie ON or OFF), as described here.


Reply With Quote
  #15   Spotlight this post!  
Unread 08-07-2012, 04:59 PM
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,596
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: Are we still using only 256 unique PWM steps?

Even an LT3080 would go vapor phase / light on fire / explode if used for this. Simply put, linear regulators are not used to drive motors. You should look up "H-Bridge" for some good explanations of how motor controllers work.

I'm still not convinced that you would actually see any benefit from additional resolution. The issue is resolution vs accuracy. In your 30RPM vs 4000 RPM example you have less than 1% error from resolution, but the accuracy is going to be many times that error from sources. For example, a good battery's rest voltage will vary several volts over the course of a match, and the actual voltage seen will swing wildly during normal transient loads. Open loop, any extra resolution in the bridge's duty cycle will be worthless.

To compensate, wrap a PID loop around an encoder on the wheel. This will help with the accuracy error sources, and will eventually oscillate around a few values as it tries to dial in the speed. It will never be perfect, but it should be good enough.
Reply With Quote
Reply


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


All times are GMT -5. The time now is 01:41 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