Go to Post I have no clue. All I know is that every year the riddle in the clue has confused me but this year it is the lack of confusion that confuses me. - hallk [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-02-2007, 19:44
Monochron's Avatar
Monochron Monochron is offline
Engineering Mentor
AKA: Brian O'Sullivan
FRC #4561 (TerrorBytes)
Team Role: Engineer
 
Join Date: Feb 2007
Rookie Year: 2002
Location: Research Triangle Park, NC
Posts: 914
Monochron has a reputation beyond reputeMonochron has a reputation beyond reputeMonochron has a reputation beyond reputeMonochron has a reputation beyond reputeMonochron has a reputation beyond reputeMonochron has a reputation beyond reputeMonochron has a reputation beyond reputeMonochron has a reputation beyond reputeMonochron has a reputation beyond reputeMonochron has a reputation beyond reputeMonochron has a reputation beyond repute
Speed controlling a relay..?!?!?one/????

Okay. We want to slow down the speed with which a spike relay drives a motor. We have tried programming in delays in the proccessing, and creating loops that would only let the relay activate after they had cycled for a while. We are trying to make it pulse on and off instead of constantly open or closed.

The problem with that is that the method that tells the relay to active makes it so that there will be a delay after we press the button so it takes a minute for the motor to go, but doesn't pulse the relay.

Has anyone successfully programed something that would pulse a relay in this fasion?

ps. We don't want to reduce the voltage to the motor because we want to retain power.
  #2   Spotlight this post!  
Unread 16-02-2007, 20:17
Dave K.'s Avatar
Dave K. Dave K. is offline
Engineer/Mentor
FRC #0930
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2005
Location: WI
Posts: 91
Dave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to behold
Re: Speed controlling a relay..?!?!?one/????

Quote:
Originally Posted by Monochron View Post
Okay. We want to slow down the speed with which a spike relay drives a motor. We have tried programming in delays in the proccessing, and creating loops that would only let the relay activate after they had cycled for a while. We are trying to make it pulse on and off instead of constantly open or closed.

The problem with that is that the method that tells the relay to active makes it so that there will be a delay after we press the button so it takes a minute for the motor to go, but doesn't pulse the relay.

Has anyone successfully programed something that would pulse a relay in this fasion?

ps. We don't want to reduce the voltage to the motor because we want to retain power.

Your post is a little confusing, but it sounds like you want to turn on a relay output immediately, then control the amount of time that it is on, and then enforce a minimum 'off' time.

How about something like this in your default_user() code...

Code:
#define TIMER_ON_VALUE 10;    // 26.3ms * 10 = 263ms
#define TIMER_OFF_VALUE 38;  // 26.3ms * 38 = 1 second

unsigned int TimerOn = 0;
unsigned int TimerOff = 0;

    if (TimerOn) {            // if on timer is running
      if (!(--TimerOn)) {    // decrement it, and if it just hit zero then...
         relay1_fwd = 0;     // turn off the output
        TimerOff = TIMER_OFF_VALUE;    //... and start the off delay timer
      }
    }

    if (TimerOff) {   // if off delay timer is running
      --TimerOff;     // decrement it
    }

      // if user triggers motor on and neither timer is running
    if (p1_sw_trig && (!(TimerOff)) && (!(TimerOn))) { 
      relay1_fwd = 1;                       // turn on the relay output
      TimerOn = TIMER_ON_VALUE;             // ... and start the 'on' timer
    }
__________________
--Dave
  #3   Spotlight this post!  
Unread 16-02-2007, 20:53
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: Speed controlling a relay..?!?!?one/????

If I read that correctly, it sounds like you're trying to make the Spike emulate a Victor with the pulsed power output. Why not just use a Victor? Pulsing the Spikes that rapidly is probably bad for them as well.
__________________
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!)
  #4   Spotlight this post!  
Unread 17-02-2007, 00:20
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,721
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: Speed controlling a relay..?!?!?one/????

Concur with Matt. All you're doing here is making a very poor imitation of a speed controller. The speed controllers do exactly what you're trying to do, only faster, better, and more reliably. If you're trying to slow the motor down without losing power, you might just try mechanically gearing it down more. With your method, the motor will just sag and be backdriven during the off periods so you'll still be losing "power" just the same as with the speed controllers.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
  #5   Spotlight this post!  
Unread 17-02-2007, 03:03
Ben Englert Ben Englert is offline
Registered User
FRC #1072
 
Join Date: Jan 2006
Location: San Jose CA
Posts: 40
Ben Englert has a spectacular aura aboutBen Englert has a spectacular aura aboutBen Englert has a spectacular aura about
Re: Speed controlling a relay..?!?!?one/????

Spikes are mechanical - that is, the current is controlled by moving parts. (Victors also are, internally, but they're tuned for high speed switching) You can probably wear one out pretty quickly by clicking it on and off too fast.
__________________
Before a match at SVR, 3/17/06
Tatsu: "Yo Englert, what's our autonomous mode?"
Me: "We'll find out, won't we."
Both: *maniacal laughter*
After the match's autonomous period ends:
Me: "Well, the basic control system still responds. That's always good."
Both: *further laughter*
  #6   Spotlight this post!  
Unread 17-02-2007, 03:26
Dave K.'s Avatar
Dave K. Dave K. is offline
Engineer/Mentor
FRC #0930
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2005
Location: WI
Posts: 91
Dave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to behold
Re: Speed controlling a relay..?!?!?one/????

Quote:
Originally Posted by Ben Englert View Post
Spikes are mechanical - that is, the current is controlled by moving parts. (Victors also are, internally, but they're tuned for high speed switching) You can probably wear one out pretty quickly by clicking it on and off too fast.
The specifications can be found here, and as long as the pulsing falls within the specifications, there is nothing inherently wrong with pulsing the relay on and off.

Since no expectations as to duration and repetition rate were provided, I chose somewhat reasonable values to use in my example. If a small motor were connected, the relay would probably survive at least couple days of competition. If a large motor were connected, then it would probably be good to have a box of spare relays on hand.
__________________
--Dave
  #7   Spotlight this post!  
Unread 17-02-2007, 16:58
Monochron's Avatar
Monochron Monochron is offline
Engineering Mentor
AKA: Brian O'Sullivan
FRC #4561 (TerrorBytes)
Team Role: Engineer
 
Join Date: Feb 2007
Rookie Year: 2002
Location: Research Triangle Park, NC
Posts: 914
Monochron has a reputation beyond reputeMonochron has a reputation beyond reputeMonochron has a reputation beyond reputeMonochron has a reputation beyond reputeMonochron has a reputation beyond reputeMonochron has a reputation beyond reputeMonochron has a reputation beyond reputeMonochron has a reputation beyond reputeMonochron has a reputation beyond reputeMonochron has a reputation beyond reputeMonochron has a reputation beyond repute
Re: Speed controlling a relay..?!?!?one/????

Thanks. I know that a victor would be better (and yes, that is what I want the result to emulate) however, we can't really do that at this stage. Our board is very compact and we don't have as much time as we would like. We really desire a programming solution.

If anyone has a solution to make a spike emulate a victor, though, that would be extremely helpful.
  #8   Spotlight this post!  
Unread 17-02-2007, 17:01
kitscuzz's Avatar
kitscuzz kitscuzz is offline
Not alotta posts
AKA: Kit
FRC #1389 (Worst Case Scenario)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Home
Posts: 47
kitscuzz will become famous soon enough
Re: Speed controlling a relay..?!?!?one/????

Quote:
Originally Posted by http://www.ifirobotics.com/spike.shtml
Max Switching Rate 20 operations per second no load, 6 operation per minute for rated life at rated load.
Sure, it can switch 20 times a second, but only if you have NOTHING CONNECTED AND NO POWER.

At best you can turn it on and off 6 times per minute if you plan on attaching a motor to it. The spikes really just can't do speed controlling.
  #9   Spotlight this post!  
Unread 17-02-2007, 17:42
Shinigami2057 Shinigami2057 is offline
Slackware Is Your New God (Mentor)
AKA: Harry Bock
FRC #1350 (Rambots)
Team Role: Programmer
 
Join Date: Oct 2006
Rookie Year: 2006
Location: Johnston, RI
Posts: 106
Shinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really nice
Re: Speed controlling a relay..?!?!?one/????

Yeah, you are really much better off just using a Victor - they're not all that bigger than the spikes, you can probably squeeze them in somewhere.
__________________
One of the main causes of the fall of the Roman Empire was that, lacking zero, they had no way to indicate successful termination of their C programs.
  #10   Spotlight this post!  
Unread 17-02-2007, 20:07
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,721
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: Speed controlling a relay..?!?!?one/????

Quote:
Originally Posted by kitscuzz View Post
Sure, it can switch 20 times a second, but only if you have NOTHING CONNECTED AND NO POWER.

At best you can turn it on and off 6 times per minute if you plan on attaching a motor to it. The spikes really just can't do speed controlling.
I have to disagree. 6 times per minute? 10 seconds between switches? That is patently untrue. I can walk over to the robot and toggle a switch a few times if you'd like proof.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
  #11   Spotlight this post!  
Unread 17-02-2007, 20:49
MasterZahn's Avatar
MasterZahn MasterZahn is offline
Master of all things electrical!
FRC #1652 (LakeView Legends)
Team Role: Programmer
 
Join Date: Feb 2007
Rookie Year: 2007
Location: Pleasant prarie wisconsin
Posts: 15
MasterZahn will become famous soon enough
Re: Speed controlling a relay..?!?!?one/????

Spike relays are meant to give a on signal, reverse signal, and a neutral signal. As someone said earlier, you should use a speed controler if variation is what you want.
__________________
MasterZahn
  #12   Spotlight this post!  
Unread 17-02-2007, 20:59
blaise blaise is offline
Registered User
FRC #1652 (LakeView Legends)
Team Role: Programmer
 
Join Date: Feb 2007
Rookie Year: 2007
Location: Pleasant Prairie
Posts: 19
blaise is an unknown quantity at this point
Thumbs up Re: Speed controlling a relay..?!?!?one/????

I had this idea, but my team shot it down, I later learned that a relay is for full forward or full back or not at all, and speed controlers are used for motors. I hoped this helped.
Blaise
__________________
¡ Its electrical !
  #13   Spotlight this post!  
Unread 17-02-2007, 21:36
paulcd2000's Avatar
paulcd2000 paulcd2000 is offline
Accidentally speaks in C
AKA: Paul Dagnelie
FRC #1719 (The Umbrella Corp.)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Baltimore
Posts: 368
paulcd2000 is a jewel in the roughpaulcd2000 is a jewel in the roughpaulcd2000 is a jewel in the rough
Send a message via AIM to paulcd2000
Re: Speed controlling a relay..?!?!?one/????

yeah, i see why you might want to use a spike. But frankly, unless you've used every PWM port, your team will basically need to deal. I'm not trying to be rude, but why even risk (i'm not sure of the electrical component, so i wont take a side) unnecessary damage to a SPIKE when a VICTOR is designed for exactly this purpose? They're not that much larger, and it sounds like this is exactly what you want.
__________________
"People don't say 'It's just a game' when their team is winning!" -- Scott Adams

5.5 students (on average)* $7/h *210 hours/student= $8085 of labor, all volunteered (not counting mentors', who are each that much)

We have blades on our robot?! ***sweeeeeet***

There are 11 types of people in the world. Those who can read binary, those who can't, and those who say this joke is supposed to be, "There are 10 types of people in the world. Those who can read binary and those who have a life."
  #14   Spotlight this post!  
Unread 17-02-2007, 21:43
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
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: Speed controlling a relay..?!?!?one/????

Quote:
Originally Posted by Ben Englert View Post
Spikes are mechanical - that is, the current is controlled by moving parts. (Victors also are, internally, but they're tuned for high speed switching) You can probably wear one out pretty quickly by clicking it on and off too fast.
Untrue. The only moving parts on a victor are the fan. They switch using MOSFETs (transistors).

Spikes do use mechanical parts. They do not like being switched quickly. However, nothing says you can't do so provided you are willing to live with the consequences. It is very possible that you will burn your Spike out.

Modify this code to fit it into your program.

spike_pwm_timer++;
if(spike_pwm_timer>=spike_pwm_max_value)
spike_pwm_timer=0;
spike=spike_pwm_timer<spike_pwm_ontime;


This will pulsewidth modulate your spike's output with a frequency of 40Hz/spike_pwm_max_value, with a duty cycle of spike_pwm_ontime/spike_pwm_max_value.

I did this one year for the last 8 rounds of nationals. It worked, sort of.

I think my values were
spike_pwm_max_value 32
spike_pwm_ontime 10
but your mileage may vary.

Again, you do run the risk of breaking things, so don't blame me for lighting your Spikes on fire.
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
Controlling motor speed WGRAY Programming 9 16-02-2009 22:50
Controlling team 803 Programming 10 21-02-2006 13:56
Edit- Can we connect more than one speed controller fan per breaker? DemonYawgmoth Rules/Strategy 7 03-02-2006 21:37
Controlling motors railerobotics Programming 6 17-01-2006 17:17
<R86> No more than one motor may be connected to each speed controller. Michael Hill Electrical 2 08-01-2006 02:00


All times are GMT -5. The time now is 00:25.

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