Lynxmotion Tech Support

www.lynxmotion.com
It is currently Tue May 21, 2013 6:48 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Mon Jul 26, 2010 5:19 pm 
Offline
Roboteer

Joined: Mon Mar 08, 2010 11:20 am
Posts: 42
Location: Texas
Hey everybody...Im working on a A4WD1/AL5Arm project and gotten to the point of making it wireless with PS2. Im just waiting on another battery that I ordered. When I am done with this step I know next will be programming it. I do have a basic understanding of C++ that I took in class a couple of years ago but I want to learn about BASIC since it seems it is the most common used here in the forum. I found a post that is very helpful with BASIC and what the person was asking viewtopic.php?f=28&t=6338. In the post it mentions the BasicMicro-Forum where you can learn about BASIC programming from the manual. http://forums.basicmicro.net/syntax-man ... t9180.html. I was wondering if anybody can write a simple program for me of a Rover that I can use as an example while I go over the material. For example: have a Rover go forward so many inches/speed, stop for 5 seconds, then reverse inches/speed. Anything that needs to be added is fine. As time goes on I will be posting questions but I feel that a simple program for an example will be helpful.
Thanks guys.


Top
 Profile  
 
PostPosted: Mon Feb 21, 2011 7:18 pm 
Offline
Roboteer

Joined: Sat Oct 25, 2008 8:10 pm
Posts: 8
Location: San Diego, California
It's difficult to provide locomotion code without knowing what motor controller you are using. Most of them have different commands.

I'm building a Lynxmotion Rover, http://www.richardvannoy.info/rover.php and What I'm doing is testing each thing, one at a time.
My plan is to test sound, the Ping Sensor, The Sharp GP2D12 IR sensors, then the motor controller in that order. For example, here is my sound test code which should work on your board with no hardware or modifications.

Code:
; sound.bas 
; A program to test the piezo speaker on the BasicATOM Pro 28
; On this board, Pin 9 is hardwired to the speaker, so this
; requires no wiring or components.

freq var word ; The frequency to send to the speaker. Word is
                     ; used to allow numbers up to 65,535.

for freq = 500 to 10000 step 500
  sound P9, [1000\freq] ;step through the frequencies
  ;   P9 = Pin 9, the output to the speaker
  ; 1000 = duration = 1000 milliseconds or one second
  ; freq = The frequency sent to the speaker
next

; After running the code above, the three frequencies
; 1500, 4000 and 5000 seemed clearest and loudest, so
; these three wil be the foundation for the rover's
; audio inventory. Here is one second of each:
sound P9, [1000\1500]
sound P9, [1000\4000]
sound P9, [1000\5000]

_________________
College Electronics and Computer Programming Instructor
http://www.RichardVannoy.info


Top
 Profile  
 
PostPosted: Mon Feb 21, 2011 7:52 pm 
Offline
Robot Guru
User avatar

Joined: Sat Apr 15, 2006 1:42 pm
Posts: 4414
Are you using a sabertooth as the motor controller. If so than the tutorials have several programs to do some things with the rover. But these are usually very simple things like drive the rover forward or backward, by supplying a PWM signal, where if the pulse width is near 1500us the motors stop and if it the pulse width is less than this it goes one direction and if it is more it goes the other direction. The farther from 1500 the faster it goes... This works fine for driving the rover around with the PS2 controller...

However it does not provide any real exact control to allow you to say go at some actual speed or for some specific distance. You can experiment some and get some control, but if you want more real control, than you need additional feedback. One way to do this is by the use of encoders, such as (http://www.lynxmotion.com/p-448-quadrat ... cable.aspx). These require motors that have an external shaft like: http://www.lynxmotion.com/p-653-gear-he ... shaft.aspx. Basic Micro sells a set of motor controller like: http://www.lynxmotion.com/p-765-robocla ... oller.aspx that allow you to actually issues commands like go forward at some speed, or for some distance...

I have done some playing around with the roboclaw on a tri-track, which operates more or less the same as a rover. There are more details and code up on the thread: viewtopic.php?f=20&t=6205

Good Luck
Kurt


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group