Go to Post This reminds me a lot of how millennials are regularly called out for simply being younger and having different perspectives. In the end it's the ones who are calling them out in unprofessional in ways that end up embarrassing themselves and looking uninformed. - Karthik [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 16-04-2006, 09:20
JJG13's Avatar
JJG13 JJG13 is offline
Yoda
AKA: Joshua Graffman
None #0180 (SPAM)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2003
Location: Martin County, Florida
Posts: 105
JJG13 has a spectacular aura aboutJJG13 has a spectacular aura aboutJJG13 has a spectacular aura about
Question about relays: update frequency

For the past couple of years the logic in my 26.2 ms loop area has looked like this:

GetData(&rxdata);
set all pwms to neutral and set all relays (fwd and rev) to 0
execute logic that sets pwms and relays
PutData(&txdata);

By setting all pwms and relays to neutral, I know that nothing will move if I don't set it and outputs from the previous pass won't interfere with the current pass. Also, if I need to put relay1 forward, all I have to do is write relay1_fwd = 1 and not worry about relay1_rev because I know it is set to zero at the beginning.

This year I realized that PutData handles the pwms(and a few other things) but not the relays. In fact, I have no idea how or how quickly the master processor sets the relays after it is set in code. This makes me think that my habit of resetting all relays at the start of each loop may not be such a good idea if enough time elapses between the time I set the relays to off at the start and I set the relays to what I want them to be to adversely effect the robot.

I've had no problems doing this so far but, in order to sleep soundly, I need to know how quickly the master processor processes what I set the relays to and if I will ever get burned by zeroing the relays before each pass.
__________________
Behold the power of SPAM.
  #2   Spotlight this post!  
Unread 16-04-2006, 10:16
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,685
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: Question about relays: update frequency

The master processor has no control at all over the relays. If you'll look in ifi_aliases.h, you'll see that the relays are all aliased off pins on the user processor. So the relays get updated literally the instant* you set them to something in your code. So if relay1_fwd is 1 before your loop, and you set it to 0, and then set it back to 1 again, you'll actually be getting a veeeery short pulse from 0 to 1 on the output pin. This is almost certainly negligible and won't affect anything, but it will be there. Plus you're wasting valuable processor cycles clearing variables. Why, back in my day our user processor was a monkey with a calculator and.....

*actually an instant plus a few nanoseconds of propagation delay.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
  #3   Spotlight this post!  
Unread 16-04-2006, 18:12
JJG13's Avatar
JJG13 JJG13 is offline
Yoda
AKA: Joshua Graffman
None #0180 (SPAM)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2003
Location: Martin County, Florida
Posts: 105
JJG13 has a spectacular aura aboutJJG13 has a spectacular aura aboutJJG13 has a spectacular aura about
Re: Question about relays: update frequency

Quote:
Originally Posted by Kevin Sevcik
The master processor has no control at all over the relays. If you'll look in ifi_aliases.h, you'll see that the relays are all aliased off pins on the user processor. So the relays get updated literally the instant* you set them to something in your code. So if relay1_fwd is 1 before your loop, and you set it to 0, and then set it back to 1 again, you'll actually be getting a veeeery short pulse from 0 to 1 on the output pin. This is almost certainly negligible and won't affect anything, but it will be there. Plus you're wasting valuable processor cycles clearing variables. Why, back in my day our user processor was a monkey with a calculator and.....

*actually an instant plus a few nanoseconds of propagation delay.

So that's what all the LATEbits stuff is...

In that case, it might be possible to create a "poor man's speed controller" by using a high resolution timer to set or zero relays based on how fast you want the motor to run. Could be useful if you have too many servos taking up PWM outputs.
__________________
Behold the power of SPAM.
  #4   Spotlight this post!  
Unread 16-04-2006, 19:16
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,573
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: Question about relays: update frequency

Quote:
Originally Posted by JJG13
So that's what all the LATEbits stuff is...

In that case, it might be possible to create a "poor man's speed controller" by using a high resolution timer to set or zero relays based on how fast you want the motor to run. Could be useful if you have too many servos taking up PWM outputs.
They are rated for 6 operations a minute at full load, so that would be an extremely slow PWM

http://www.ifirobotics.com/spike.shtml
  #5   Spotlight this post!  
Unread 16-04-2006, 21:22
Matt Krass's Avatar
Matt Krass Matt Krass is offline
"Old" and Cranky. Get off my lawn!
AKA: Dark Ages
FRC #0263 (Sachem Aftershock)
Team Role: Mentor
 
Join Date: Oct 2002
Rookie Year: 2002
Location: Long Island, NY
Posts: 1,187
Matt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond repute
Send a message via AIM to Matt Krass
Re: Question about relays: update frequency

Quote:
Originally Posted by Joe Ross
They are rated for 6 operations a minute at full load, so that would be an extremely slow PWM

http://www.ifirobotics.com/spike.shtml

That's the Spike, not the output. I believe the output would be considerably faster.
__________________
Matt Krass
If I suggest something to try and fix a problem, and you don't understand what I mean, please PM me!

I'm a FIRST relic of sorts, I remember when we used PBASIC and we got CH Flightsticks in the KoP. In my day we didn't have motorized carts, we pushed our robots uphill, both ways! (Houston 2003!)
  #6   Spotlight this post!  
Unread 16-04-2006, 22:43
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,685
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: Question about relays: update frequency

You'd have a fun time wiring it. The red and white pins are both signal on the relay ports, so you'd have to make sure you're pulsing the right one. You'd never use them as servo outputs because the red wire is signal, so you wouldn't get the 7.2V to power the servo. And to top it off, you'd have the same interrupt problem that the Generate_PWMs() has for PWM13-16. But yes, it could be done in theory.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
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
team update 13 question matt111 General Forum 5 25-02-2004 22:34
MIM's question of the day on programming. Gene F Programming 3 24-02-2004 16:32
A question about control system options computhief263 Control System 7 04-02-2004 14:46
Official update #1 - 9/13 - Mike Martus Mike Martus OCCRA 0 13-09-2003 21:48
Update 6..last Question archiver 2001 9 24-06-2002 00:25


All times are GMT -5. The time now is 21:44.

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