Go to Post No matter what route you choose, it's always a good idea to keep Mike Walker's cell phone on speed dial. - Joe Ross [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Events   CD-Media   CD-Spy   FRC-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 08-05-2003, 04:45 PM
rosebud rosebud is offline
Registered User
#0115 (MVRT)
 
Join Date: Sep 2002
Location: California
Posts: 24
rosebud is on a distinguished road
initialization program and speed controllers

does anyone know how the initialization program works? heres my problem:

1) my team wants to build a motorized cart to haul our robot around
2) we want to be able to have tank drive
3) therefore, we need some kind of speed controller
4) the victor 884 needs to be programmed or have pulses sent to it
5a) sol: use a stamp
5b) sol: something else to generate pulses???

problems with 5a)

1) the default code or something in the special stamp designed for first requires the operator interface. too complicated and not one to spare.

2) we have spare bs2 stamps that are very like the the bs2sx, except without all the fancy stuff. it uses direct contact with the pins, not serial messaging. no operator interface required. unfortunately, the programming seems to be different. it wont allow a simple pwm = ***. it has to be the command
pwm pin#, duty cycle, #of milliseconds to recharge a capacitor

i dont really get it.

so, what i need help on:

1) anyone know if its a hardware or software thing that requires the operator interface? and how to make our first robot controllers not require it?
2) to accomplish #1, anyone have documentation for the initialization program?
3) anyone know how to generate pulses to work the victor 884 speed controllers cheaply and easily without going through a stamp?
4) anyone know how to program non-first bs2 stamps?

thanks!
  #2   Spotlight this post!  
Unread 08-05-2003, 05:30 PM
dez250 dez250 is offline
54... What a good number!
no team
 
Join Date: Dec 2002
Rookie Year: 2000
Location: Upstate NY / Manchester, NH
Posts: 1,692
dez250 has a reputation beyond reputedez250 has a reputation beyond reputedez250 has a reputation beyond reputedez250 has a reputation beyond reputedez250 has a reputation beyond reputedez250 has a reputation beyond reputedez250 has a reputation beyond reputedez250 has a reputation beyond reputedez250 has a reputation beyond reputedez250 has a reputation beyond reputedez250 has a reputation beyond repute
Send a message via AIM to dez250
BS2 Programming

One site i really reccomend you check out for Basic Stamp Programming is http://www.parallax.com/ that site is for the BOEBOTS and many other educational rpbptocs kits and things, check them out for help.
~Mike
__________________
#5

-Michael Dessingue
  #3   Spotlight this post!  
Unread 08-05-2003, 06:04 PM
Adam Y.'s Avatar
Adam Y. Adam Y. is offline
Adam Y.
no team (?????)
 
Join Date: Mar 2002
Location: Long Island
Posts: 1,979
Adam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to behold
Send a message via AIM to Adam Y.
Quote:
unfortunately, the programming seems to be different. it wont allow a simple pwm = ***. it has to be the command
I think you use the pulseout command to make pwm waves. PWM actually creates an analog voltage which is not what you want. And in this case its called PPM not PWM. PPM is the wave signal that goes into the speed controller while PWM is the voltage wave that comes out.
__________________
If either a public officer or any one else saw a person attempting to cross a bridge which had been ascertained to be unsafe, and there were no time to warn him of his danger, they might seize him and turn him back without any real infringement of his liberty; for liberty consists in doing what one desires, and he does not desire to fall into the river. -Mill
  #4   Spotlight this post!  
Unread 08-05-2003, 07:23 PM
Rickertsen2 Rickertsen2 is offline
Umm Errr...
None #1139 (Chamblee Gear Grinders)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2002
Location: ATL
Posts: 1,422
Rickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant future
Send a message via AIM to Rickertsen2 Send a message via Yahoo to Rickertsen2
I can help you with al of the above mentioned Okay first of all pwm does not generate an analog voltage by itself. A pwm signal can however be filtered to make an analog voltage. The PWM command in pbasic outputs a PWM signal jsut like what you need but there is a problem. While the basic stamp is executing the PWM command it can't do anything else. This makes the command useless for your purposes because you will need a steady PWM signal and you can't spend all your time in the PWM command. The easiest way to acomplish this with a bs2 is with Parallax's new PWM PAL THe Basic stamp plugs into this and allows for PWM in the backgroung while doing other tasks like reading joysticks. Just ask if you need any other help or a mosre specific explanation. I can even write the code and give you a circuit if u need.
__________________
1139 Alumni

Last edited by Rickertsen2 : 08-05-2003 at 07:25 PM.
  #5   Spotlight this post!  
Unread 08-05-2003, 11:27 PM
rosebud rosebud is offline
Registered User
#0115 (MVRT)
 
Join Date: Sep 2002
Location: California
Posts: 24
rosebud is on a distinguished road
thanks for the help everyone. two up from me it was mentioned that i want to use pulseout, which i think will be easier than buying anything now. ive used pulseout with a servo, but what is the frequency i want with the speed controller? if possible, include the code. thanks!
  #6   Spotlight this post!  
Unread 08-06-2003, 08:48 AM
Rickertsen2 Rickertsen2 is offline
Umm Errr...
None #1139 (Chamblee Gear Grinders)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2002
Location: ATL
Posts: 1,422
Rickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant future
Send a message via AIM to Rickertsen2 Send a message via Yahoo to Rickertsen2
Okay i called innovation first and they said it uses standard RC signals with a period of 1-2ms sent every 17 ms, not a true PWM pulse like i previously thought. If you send a 1ms pulse, that will be full backward, a 1.5 millisecond pulse, still, a 2ms pulse full forward etc. The 1-2ms part will be easy. It will not be easy however to do this exctly every 17 ms. Usually (at least with servos the 17 ms is not all that critical though and there may be some leeway). you may or may not be able to acheive acceptable spacing without any external hardware. below is an example of the type of pulsout command you need. In a few minutes i will post more.

Pulsout 1,1000
'on a BS2 this would send a 2ms pulse out on pin 1. note: the period paramater of the pulsout command is in units of 2microsconds. (ie: 1000 = 2milliseconds)

======== The rest i promised ==============
Here is some code that will take two numbers from 0 to 255 (First style) and send the appropriate pulses. This code obviously does not handdle the spacing between the pulses. This code will only work for a BS2 or BS2E.

'put this stuff at the beginning of your code.
Temp var word
L_pin con 0 'pin tio send left pulses too
R_pin con 1 'pin to send right pulses too
Pause_time con 17 'adjust this accordingly to acheove 17 ms spacing. I put 17 ms only as an example and you will have to play with this. You may not need a dalay you program may already take more than 17 ms. In this case you need to do some optimizing to the rest of you program.

beginning:

'code to read joysticks or whatever and assign values to
r _speed and L_speed goes here

'put this at the end of your code.
temp2 = L_speed * 256
temp2 = (temp / 32) + 2000
PULSOUT L_Pin,Temp
temp2 = R_speed * 256
temp2 = (temp / 32) + 2000
PULSOUT R_pin,Temp
pause pause_time
goto beginning

Note: the forums messed up the spacing and i am too lazy to fix it so it may be a bit hard to read .
__________________
1139 Alumni

Last edited by Rickertsen2 : 08-06-2003 at 09:18 AM.
  #7   Spotlight this post!  
Unread 08-06-2003, 09:33 AM
Adam Y.'s Avatar
Adam Y. Adam Y. is offline
Adam Y.
no team (?????)
 
Join Date: Mar 2002
Location: Long Island
Posts: 1,979
Adam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to behold
Send a message via AIM to Adam Y.
Quote:
Okay first of all pwm does not generate an analog voltage by itself. A pwm signal can however be filtered to make an analog voltage. The PWM command in pbasic outputs a PWM signal jsut like what you need but there is a problem. While the basic stamp is executing the PWM command it can't do anything else.
Actually I just looked through the documentation. The PWM command is supposed to be used to generate an analog voltage with the help of a capacitor.
Quote:
Note: the forums messed up the spacing and i am too lazy to fix it so it may be a bit hard to read .
Just use the code command. It should retain the formating of anything you type. It is that pound symbol next to the php button.
__________________
If either a public officer or any one else saw a person attempting to cross a bridge which had been ascertained to be unsafe, and there were no time to warn him of his danger, they might seize him and turn him back without any real infringement of his liberty; for liberty consists in doing what one desires, and he does not desire to fall into the river. -Mill

Last edited by Adam Y. : 08-06-2003 at 09:43 AM.
  #8   Spotlight this post!  
Unread 08-06-2003, 09:37 AM
Rickertsen2 Rickertsen2 is offline
Umm Errr...
None #1139 (Chamblee Gear Grinders)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2002
Location: ATL
Posts: 1,422
Rickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant future
Send a message via AIM to Rickertsen2 Send a message via Yahoo to Rickertsen2
Quote:
Originally posted by Adam Y.
Actually I just looked through the documentation. The PWM command is supposed to be used to generate an analog voltage with the help of a capacitor.
That is ONE of its purposes. The PWM command by itself generates only a train of digital pulses. Like you said, this can however be filtered to create a rather rough analog. Kindof a really bootleg DAC. Now lets not start a stupid argument about this.
__________________
1139 Alumni
  #9   Spotlight this post!  
Unread 08-06-2003, 10:28 AM
Adam Y.'s Avatar
Adam Y. Adam Y. is offline
Adam Y.
no team (?????)
 
Join Date: Mar 2002
Location: Long Island
Posts: 1,979
Adam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to behold
Send a message via AIM to Adam Y.
Quote:
That is ONE of its purposes. The PWM command by itself generates only a train of digital pulses. Like you said, this can however be filtered to create a rather rough analog. Kindof a really bootleg DAC. Now lets not start a stupid argument about this.
Yeah I know but I have read this in two differnt places. One was an article about the PwmPal and the instruction manual. Also a question about the victors. I know that the RC versions of them require a signal booster. What does that do to the signal??
Quote:
anyone know how to generate pulses to work the victor 884 speed controllers cheaply and easily without going through a stamp?
You could try a 555 pwm circuit. I know it is here somewhere on this forum. It may not work.
http://www.chiefdelphi.com/forums/sh...=555+cir cuit
__________________
If either a public officer or any one else saw a person attempting to cross a bridge which had been ascertained to be unsafe, and there were no time to warn him of his danger, they might seize him and turn him back without any real infringement of his liberty; for liberty consists in doing what one desires, and he does not desire to fall into the river. -Mill

Last edited by Adam Y. : 08-06-2003 at 10:31 AM.
  #10   Spotlight this post!  
Unread 08-06-2003, 10:44 AM
Rickertsen2 Rickertsen2 is offline
Umm Errr...
None #1139 (Chamblee Gear Grinders)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2002
Location: ATL
Posts: 1,422
Rickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant future
Send a message via AIM to Rickertsen2 Send a message via Yahoo to Rickertsen2
[quote]Originally posted by Adam Y.
[b] Also a question about the victors. I know that the RC versions of them require a signal booster. What does that do to the signal??QUOTE]
call IF tech support @ 903-454-1978 and ask. Im not even really sure what the difference btw the IF and RC version is in the first place.
__________________
1139 Alumni
  #11   Spotlight this post!  
Unread 08-09-2003, 05:01 PM
Rickertsen2 Rickertsen2 is offline
Umm Errr...
None #1139 (Chamblee Gear Grinders)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2002
Location: ATL
Posts: 1,422
Rickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant future
Send a message via AIM to Rickertsen2 Send a message via Yahoo to Rickertsen2
......Well how are things coming?
__________________
1139 Alumni
  #12   Spotlight this post!  
Unread 08-09-2003, 06:46 PM
FotoPlasma FotoPlasma is offline
\: |
no team
 
Join Date: Jul 2001
Rookie Year: 2001
Location: San Jose
Posts: 1,900
FotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond repute
Send a message via AIM to FotoPlasma
Quote:
Originally emailed to me by Tom Watson, of IFI
The part number of the IC that we use is MM74HCT14M. You can get datasheets on the web.
This response was to my question of which IC it is that IFIRobotics (the BattleBots oriented branch of IFI) provides with the "PWM Signal Driver" option, on the order form for a Victor 883/885 (their Thor 883 was recently discontinued).
__________________
I played hacky sack with Andy Baker.

2001-2004: Team 258, The Sea Dawgs
2005: Team 1693, The Robo Lobos
  #13   Spotlight this post!  
Unread 08-11-2003, 08:20 PM
Lloyd Burns Lloyd Burns is offline
Registered User
FRC #1246 (Agincourt Robotics)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Toronto
Posts: 292
Lloyd Burns is an unknown quantity at this point
BLAH, BLAH
When I cloned the '98 controller (in the clear plastic box), I made up a PIC 16c84 program to do the interfacing with the Tekins, which have the same signal standards as the Victors : Pulse 1 ms +/- 0.5 ms, repeated every 16 ms. Biggest problem was getting the eight serial signals out of the BS2 at the fastest it would go, into the PIC. For only four, just use an interrupt or poll to see when the BS2 wants to send (using SEROUT); blast in the numbers, then start all outputs at the same time, let them stay on for 0.5 ms, then run through the stored numbers, while counting the milliseconds - input number is zero, drop the pin immediately - input number 254, wait until the count has reached 254 before dropping the output (a full millisecond). Wait for the next time BS2 wants to talk.

DETAILS
- Clock in the BS2 data (which could include a PWM channel number if you want to get picky), and store each in its own cubby hole.
- Start all (or just those you want to function) pins high, use TMR0 to count down 500 us, then set TMR0 to count to 1 ms = 1000 us, and set your own counter to zero, and see if channel 'n' is supposed to be '0' : if so, turn it off; if not, skip to test channel 'n+1'. Repeat for all channels, then check that you have a proper length for your loop [each loop represents 1000 ms/128, or 1000 ms/32 if you count by 4's]. Then go back and loop through it all again until they are all off. Wait till TMR0 has finished the 1 ms, and/or wait for BS2.

If you count by 4's, then the number you receive from BS2 should be divided by 4 (shift right) so 254 becomes 63. 63 loops will then time out at around 1 ms, or to turn it around, 63 loops through the comparing-and-turning-off loop will take 1000 us. if you counted by 2's, and divided by 2 to start, 127 loops would take 1000 us.

Feed this pulse train to your Victor (one Victor / output) and it should work. If you would like, you could use the timer to do two pulse every time the BS2 does a loop (during which it does a SEROUT).

MORE INFO
No Transmitter
Remember, if you write your own program for the BS2, the timing for the BS2 loop comes from the sampling loop in the transmitter: there is one BS2 loop for each data set sent by the transmitter. For a simple program, there is no advantage to using a faster BS2xyz. If you don't have a transmitter, you will have to time your BS2 loop, and adjust as required.

Joystick into BS2 via ADC
You may want the BS2 to read an ADC (eg ADC0832) as laid out by Parallax, with the joystick being run from Ground to the ADC input, then to a constant current source (LM134?) connected to a higher voltage that the V+ for the ADC. The current should be set at enough to make full resistance give 5V. This is more linear with pot position than Innovation First's circuit by a percent or so: They use the charge-a-cap'r-and-count method, also detailed by Parallax.

And No, the Victor does not respond to an analog voltage level, however well filtered your BS2 PWM output may be, on its input. It times out the input pulse, then does its own PWM thing at 12 V.

And Yes, the timing values may need adjustments : it's been 5-6 years and three computers since I did the work.
  #14   Spotlight this post!  
Unread 08-11-2003, 09:48 PM
rosebud rosebud is offline
Registered User
#0115 (MVRT)
 
Join Date: Sep 2002
Location: California
Posts: 24
rosebud is on a distinguished road
thanks everyone for the help. we got the program to work with servos that were on the bot we were testing with. we arent sure about the motors because the program was barely outputing fast enough. when their were debug statements, the servos were very jerky. however, i still want to know if anyone has documentation on the intillization program. i have no idea how it works, and ive been wondering for a while. thanks
  #15   Spotlight this post!  
Unread 08-12-2003, 08:46 PM
Lloyd Burns Lloyd Burns is offline
Registered User
FRC #1246 (Agincourt Robotics)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Toronto
Posts: 292
Lloyd Burns is an unknown quantity at this point
The BS2sx program goes through some housekeeping: after the directives to the compiler, variables are declared, and typed (p1_x VAR byte, for example). Some bytes are reserved for the transmitted data, and for the local on-robot stuff, as both OI stuff and the RC input stuff are not "read" directly by the 'computing process', but are passed to it from the input process via the SERIN statement.

Think of the CPU as three functions ; input, 'computing', and output.

When you get to the "set the initiallization constants" section, you are preparing to tell the input organizer which bytes to send. As they tell you in the default program, you cannot accept all the bytes the input section has and can send you; you must select a subset to be sent.

You set the constant for a particular byte you want, and then, in the MASTER uP INIT'N section of the default, tempA = (the constant for p3_x shift left once + the constant for p4_x) shift left + the next yada yada ... shifts the first 5 bits into tempA.

dataInitA shifts the 5 bits collected in tempA, along with 3 more, to give eight bits.

Eventually you have 4 bytes of dataInit, A,B,C, and D and then after declaring you want to send it, you wait until the input process is ready to receive, the shift it out. OUTPUT COMA sets the COMA pin to output, LOW sets it to 0 V, INPUT puts the pin into input mode. Lows on COMA and COMB are a signal to the input process. You don't send right away, but you wait, until IN3 goes low, which is the signal the input process is ready to hear from you.

Once that's sent, you get into the main loop, and there the serin command expects to hear as many bytes as you requested, sent in the order IFI has arranged for in their machine code, in the input process, and in the which order you have written your serin (as they cautioned you to do). If you didn't make the c_whatever CON equal 1, it won't be sent; if you don't have it in the correct order (IFI's), your right front wheel might well be executing the commands for your battle-arm. If you don't have the correct number of bytes in the SERIN, you'll see BASIC INIT ERROR.

Think of the input process looking at the 4 bytes, bit by bit, as it sends out data - "is this one that i send ? , if so I will, if not I'll test the next bit, and if it's set, I'll send that". Each bit corresponds to a byte it can send to the computing process

Clearer ?
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
Battlebots I.Q.- A serious threat to FIRST or a half thought up cheep copy? Joe Matt General Forum 75 10-17-2005 07:43 PM
switch speed control wayne 05 Programming 6 10-01-2003 08:35 AM
A DEAD reckoning program rcubes85 Programming 5 03-19-2003 01:21 PM
last years speed controllers..... archiver 2001 9 06-23-2002 10:44 PM
Speed Controllers archiver 2000 1 06-23-2002 10:01 PM


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