Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Pwm (http://www.chiefdelphi.com/forums/showthread.php?t=14565)

VanWEric 26-09-2002 18:44

Pwm
 
Last year we had a nice little black box that we could plug into a victor and control the motors from a little pot on the box. THe person who made it is no longer on our team, and i was wondering if anyone knows how to make one.

Thanks

fs_2002 27-09-2002 01:48

Hmm
 
I don't know what you're talking about but it sounds intriguing. Describe it some more, would you? Maybe some of us could help in comming up with a new design. :cool:
~bobb

sanddrag 27-09-2002 02:01

I believe what he wants is a potentiometer hooked up to something that coverts the potentiometer signal to Pulse Width Modulation (PWM) which would be used as an input to the Victor Motor/Speed Controller.

srawls 27-09-2002 10:34

You could do it with a basic stamp. Just take in the pot input and output a pwm signal based on that input. Of course, a basic stamp may be overkill and there's a really easy way to do it with some eletronic device I've never heard of :)

Stephen

rbayer 27-09-2002 13:02

Have you looked through a digiKey catalog? They have just about anything you could want. I'd look myself, but I can't find my catalog right now.

Andrew Rudolph 27-09-2002 18:00

yeah that idea sounds really interesting. Maybe you could open it and look and see whats inside?

VanWEric 27-09-2002 18:04

Quote:

I believe what he wants is a potentiometer hooked up to something that coverts the potentiometer signal to Pulse Width Modulation (PWM) which would be used as an input to the Victor Motor/Speed Controller
Thats exactly what i meant to say. I saw its guts once, and all it was was a 9 volt battery, a zener diode to drop it to 5v, a pot and some more junk like resitors and capacitors. I just cant remember what the junk was exactly, or how to hook it up.

Yes, we could use a stamp, but the whole point of this little box is to have something ready to be slapped in their between matches or in debugging.

Thanks again.

Lloyd Burns 29-09-2002 18:58

The PWM (so called) of the Basic Stamp is a series of random-width pulses with an average voltage set by the parameters in the call. The PWM output from the Robot Controller is a single, variable width pulse, followed by quiet, repeated often enough to keep the Victor from declaring signal loss. The signals would appear incompatible.

Perhaps you are looking for a 555 circuit, wherein the pot controlling the length of the "post" varies the width of the output pulse from 0.5 ms to 1.5 ms (or up to 2 for some spare room). The pot is connected from pin 7 to pins 6 and 2. The resistor from +5 to pin 7 should give an output pulse every 10 to 15 ms. I think that the polarity of the short part of the output pulse (on pin 3) is not a positive going pulse, but by using appropriate connections (or a single transistor -resistor inverter). You are aiming to drive a signal of around 15 mA through the Victor.

There are lots of websites with formulae for using 555's as free running "multivibrators", as they are called.

The waveform of the output you want is like this:


_______|"|_______________|"|_________

The timing I mentioned above applies.

kmcclary 24-10-2002 19:01

Re: Pwm
 
Quote:

Originally posted by VanWEric
Last year we had a nice little black box that we could plug into a victor and control the motors from a little pot on the box. THe person who made it is no longer on our team, and i was wondering if anyone knows how to make one.

Thanks

Oh, sure! That's called a "servo simulator", used in radio control modeling all the time...

The Victors look like a standard RC servo (that's "radio control", not "robot controller") to the controller. It requires a 1ms to 2ms positive going 5v pulse, repeated somewhere in the 15ms - 20ms range. In reality it shouldn't be more often than about 15ms, yet it has to be more frequent than whatever timeout value the Victor's "I've lost the Robot Controller so I must shut down" watchdog timer is set to.

1.5 ms corresponds to "127" or the center "off" position of the Victor, and the 1ms and 2ms times correspond to the two full on directions. (I'm assuming 0 generates 1ms and 255 generates 2ms, but I've never bothered to verify that. Doesn't matter, though. One's full on in one direction, and the other is full on the other way.) :D

You can make that with a simple 555 circuit. Piece of cake... Here's a link to Ahmet Onat's page, which includes both the circuit and servo theory.

**BE CAREFUL THOUGH*** Ahmet's diagram has the leads in the wrong order for the Victors!!!

Victors use the "Futaba standard" for wiring order (Black, Red, White), where Black is Ground, Red is +5VDC, and White (or other color) is the pulse signal... Ahmet's diagram OTOH has the white signal lead in the MIDDLE for diagram simplicity, which is the WRONG ORDER for the Victors! Make sure it is in "SIGNAL, +5, GROUND" order on your connector!!! If you look closely at a Victor's case, you'll see it is marked "W R B" for White, Red, and Black respectively.

Here's Ahmet's page:
- http://www.geocities.com/BourbonStre...rvobasics.html

A couple of notes on part selection:

Transistor - If you need a part number for the "small signal NPN transistor", use whatever you can find, like a 2N2222, or a 2N3904.

Potentiometer - Make SURE you use a LINEAR TAPER pot, and NOT an "audio taper". The first has a resistance vs shaft_angle graph that's a straight line of constant slope from one end to the other. An "audio taper" pot has a logarithmic resistance vs shaft_angle graph. That means the center of the pot is NOT "the middle value", and the Victor will not be off in that position. You can tell you have an audio pot if the motor will want to run almost full on in one direction for all but a small pot angle on one end.

BTW, you will not be able to use the CH Flightstick or other PC joystick for this circuit, because (1) they are the wrong resistance value, and (2) they don't bring all three connections of the pot to the connector.

Disclaimer: Verify your connections BEFORE powering it up. I disavow any damage to your Victors caused by improper wiring...

- Keith

Adam Y. 24-10-2002 21:08

Quote:

The Victors look like a standard RC servo (that's "radio control", not "robot controller") to the controller. It requires a 1ms to 2ms positive going 5v pulse, repeated somewhere in the 15ms - 20ms range. In reality it shouldn't be more often than about 15ms, yet it has to be more frequent than whatever timeout value the Victor's "I've lost the Robot Controller so I must shut down" watchdog timer is set to.
Hmm if they act anything like a sevro then you should be able to control the victors with a basic stamp. I know that you can control severos with a basic stamp.

Lloyd Burns 24-10-2002 21:52

Quote:

Originally posted by wysiswyg

Hmm if they act anything like a sevro then you should be able to control the victors with a basic stamp. I know that you can control servos with a basic stamp.

True, but NOT with the stamp PWM command - use a toggle, pause, toggle sequence, or a PULSOUT command.

Using PULSOUT pin, variable , the variable is a value 0-65535 which is the length of the pulse, and for a BS2sx, the uuits are 0.8 us - 1250 ought to give a 1 ms pulse.

You could use a PAUSE to get the inter-pulse time to order (say 15 to 25ms), or you could let the program loop do that, for which you would have to test (verify) that your loop time works with the Victor.

Cost-wise, a 555 circuit is way ahead. ;-)

kmcclary 25-10-2002 00:05

Stamps vs a 555 for a one channel PWM tester
 
Quote:

Originally posted by wysiswyg

Hmm if they act anything like a [servo] then you should be able to control the victors with a basic stamp. I know that you can control [servos] with a basic stamp.

Well, if you're REALLY insane, yes it can. But that's the EXPENSIVE way to go... A Stamp-II is about $50 a pop... A 555 timer is about $1! (I guess you could always use a Stamp-I for it... That's ONLY 34x more expensive rather than 50x more expensive... ;) )

BTW... Remember with a Stamp you also have to digitize the pot with a POT command, *AND* run the Victor with a PULSOUT. BOTH statements use an "ignore the world timing loop", and won't complete the statement until the counting is complete. Therefore, the higher the pot resistance (or the longer the pulse), the longer it takes to complete that statement.

It'll probably be OK for a "one pot & one Victor" situation, but if you try more of either, then under certain circumstances the POT or the PULSOUT commands may take long enough to cause an ignored Victor's watchdog timer to time out, shutting it down. (I don't know the timout value of the Victor's watchdog.) You'll definitely run into that problem quickly if you try more than a few pot and servo pairs.

FYI, That's exactly why the Robot Controller uses dedicated PIC micros for its I/O, and we have to talk to them via the infamous SERIN and SEROUT statements at the ends of the robot program's main loop... :D

Bottom line: Even if a 555 and a Stamp were equal cost, IMHO a 555 would STILL be a better choice!

However, it might be something fun to try for giggles... A Stamp-I version CAN use a CH Flightstick for the pots, and MAY be able to run a pair of Victors without them shutting down.

- Keith

Adam Y. 25-10-2002 20:48

Quote:

1.5 ms corresponds to "127" or the center "off" position of the Victor, and the 1ms and 2ms times correspond to the two full on directions. (I'm assuming 0 generates 1ms and 255 generates 2ms, but I've never bothered to verify that. Doesn't matter, though. One's full on in one direction, and the other is full on the other way.)
Hear is a stupid question if the victors rely on pwm excatly like other esc's for radios then why do can't you use a radio to control the esc's or can you???

kmcclary 25-10-2002 23:05

Using a Victor with a hobby Radio Control system
 
Quote:

Originally posted by wysiswyg

Hear is a stupid question if the victors rely on pwm exactly like other esc's for radios then why do can't you use a radio to control the esc's or can you???

Well, yes and no...

That's exactly what they were originally designed to use, but they tweaked it for Robot Controller use... However, read on. We may be able to fix that. :)

Many BattleBot competitors use IFI hardware with their basic RC controls and no computer in the middle. HOWEVER, IFI makes two versions of the Victor 883, an IFI Robot Controller version, and a Radio Control version for BattleBot and others to use.

First off, check out the IFIRobotics site, another entry to the same company we call "InnovationFIRST":
= http://www.ifirobotics.com/
You'll see a bunch of BattleBots there.

Now check out their products area:
= http://www.ifirobotics.com/products.htm
You'll see the bigger THOR 883 modules, which are TWICE the current capacity of the Victor 883's (120A continuous! Whoof!)
Compare these monsters:
= http://www.ifirobotics.com/victor_883.htm
= http://www.ifirobotics.com/thor_883.htm

NOW... According to the Victor 883 datasheet above the IFI version of the 883 we use "does not come with a signal driver". I'll betcha it means the PWM signals need to be 12V square waves for our version, instead of 5V. If so, that means you'll only need a simple opamp or transistor driver to level shift the voltage from the RC control's 5V up to 12V square waves. That's EASY...

HEY... LET'S CHECK IT!!! :D

Here's a test for someone with a working robot: Put an oscilloscope on the signal leads between the Robot Controller and the Victor, and read off the square wave amplitude.

Settings: "DC coupled", "5V/division", zero = any convenient line below the centerline.

Connections: Tie the scope ground to the BLACK lead, and probe the WHITE lead.

Test: Measure the amplitude of the square waves and report it back here. (If you wish, take a digital pic of the scope's trace and either post it or email it to me...)

(I can't do it because I'm now starting up my second rookie team in two years, and we don't have hardware in hand yet...)

BTW, If someone want to make one HECK of an RC car out of: an RC system, a thrown out Fisher Price kid's riding jeep with the front wheels changed to castors, a spare FIRST robot battery, and a spare pair of Victor 883s, I'll betcha it'll probably only take a buffer amp to do it! :D (It sounds like a good team exercise to me!) If someone wishes to do that, I'll help you make the signal driver for it...

FYI, some of us in my town's robotics club are making Autonomous Jeep Sumo bots for parking lot battle now with: thrown away kid's jeeps, home grown MOSFET drivers in place of the Victors, and whatever micros we each have on hand to drive them (i.e. Mindstorms RCX bricks, Stamps, PICs, Amtels, Palm Pilots, etc...). But that's a separate thread for another time and forum... :)

Somebody let me know what you find about about the waveforms, and I'll tell you what you need to use a Victor with an RC system!

- Keith

Adam Y. 26-10-2002 17:24

Quote:

FYI, some of us in my town's robotics club are making Autonomous Jeep Sumo bots for parking lot battle now with: ,
Err that scared me until I read the rest of it.


All times are GMT -5. The time now is 23:17.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi