|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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
|
||||
|
||||
|
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 |
|
#3
|
||||
|
||||
|
Quote:
|
|
#4
|
||||
|
||||
|
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.
Last edited by Rickertsen2 : 05-08-2003 at 20:25. |
|
#5
|
|||
|
|||
|
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
|
||||
|
||||
|
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 . Last edited by Rickertsen2 : 06-08-2003 at 10:18. |
|
#7
|
||||
|
||||
|
Quote:
Quote:
Last edited by Adam Y. : 06-08-2003 at 10:43. |
|
#8
|
||||
|
||||
|
Quote:
|
|
#9
|
||||
|
||||
|
Quote:
Quote:
http://www.chiefdelphi.com/forums/sh...=555+cir cuit Last edited by Adam Y. : 06-08-2003 at 11:31. |
|
#10
|
||||
|
||||
|
[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. |
|
#11
|
||||
|
||||
|
......Well how are things coming?
![]() |
|
#12
|
||||
|
||||
|
Quote:
|
|
#13
|
|||
|
|||
|
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
|
|||
|
|||
|
Dear all,
Hello! Everybody, how are your ! I am Kam, a new comer to the world of embedded ! Any one know how to program BS2 using the ADC0832CCN converter ? As I was informed that the BS2 code for ADC0831 and ADC0832 are different. Any advise ? Thank you. Kam |
|
#15
|
|||
|
|||
|
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
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 | 17-10-2005 20:43 |
| switch speed control | wayne 05 | Programming | 6 | 01-10-2003 09:35 |
| A DEAD reckoning program | rcubes85 | Programming | 5 | 19-03-2003 14:21 |
| last years speed controllers..... | archiver | 2001 | 9 | 23-06-2002 23:44 |
| Speed Controllers | archiver | 2000 | 1 | 23-06-2002 23:01 |