|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
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. |
![]() |
| 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 |