BasicMicroUK - Forums

www.basicmicro.co.uk
It is currently Fri Jul 20, 2018 12:07 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 62 posts ]  Go to page 1, 2, 3, 4, 5  Next
Author Message
 Post subject: ARC32 and Lynxmotion Biped code - compatible ?
PostPosted: Tue Mar 27, 2012 4:23 pm 
Offline
Guru

Joined: Fri Feb 10, 2012 9:34 pm
Posts: 73
Hi All,
I am building a Biped Brat with the ARC32. My questions:
1. Can I use the code at Lynxmotion to do the servo settings and the other code like autonomous and bottle kicking without major modifications (to run on ARC 32) ?
2. If I have to change the code for ARC32, what areas should I be looking at ?

Please help.
Thanks


Top
 Profile  
 
 Post subject: Re: ARC32 and Lynxmotion Biped code - compatible ?
PostPosted: Tue Mar 27, 2012 5:33 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 7:00 pm
Posts: 1316
Location: Temecula, CA
Is the Lynxmotion code using hservo to run the brat? I think it is but I'm not 100% sure. Can you link to it? If it is then you shouldn't need to change much. You will probably need to change some pin names/numbers because wiring will be easier if you move things around. Are you going to use sensors on the Brat? If so you need to setup one group of 8 pins to run 5v instead of raw battery power. Connect the sensors to those pins(either group 0 to 7 or group 16 to 23 should be used). if you want you could instead use the Aux1 header I/O pins and 5v power from there.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: ARC32 and Lynxmotion Biped code - compatible ?
PostPosted: Tue Mar 27, 2012 6:04 pm 
Offline
Guru

Joined: Fri Feb 10, 2012 9:34 pm
Posts: 73
Thanks Nathan. I am linking to the page that has two programs: The offset finder and the autonomous .

http://www.lynxmotion.com/images/html/build133.htm

I believe these use HSERVO. Thanks for the tip on the 5V selection for sensors - I will be using one or more IRs I think.

Gopal


Top
 Profile  
 
 Post subject: Re: ARC32 and Lynxmotion Biped code - compatible ?
PostPosted: Tue Mar 27, 2012 10:33 pm 
Offline
Master

Joined: Tue Nov 21, 2006 5:34 pm
Posts: 662
Been awhile since I looked at that code...

But you will run into a few issues. Things like:

mechosf.bas: Is used to find the zero points of the servos. It uses the A/B/C buttons on the Atom Bot Board 2, to make the adjustments. The problem is the Arc32 does not have these buttons, so you will need to do something different. In the past I have had versions of this code (or code like this) on Arc32 that I use the hardware serial port connected up to the USB and use the keyboard on my Pc to select which servo and to make the adjustments. It also does sound outputs to pin 9... The Arc32 has no sound. I often get a cheap speaker from Radioshack or the speaker used on the BB2 (from Digikey) and wire it up to some pin on the Arc32, as I like the ability to make some sound...

Abrat5.bas: Is the main program in the tutorial you mentioned. You will need to adjust this some as the HSERVO system is dependent on the clock speed. That is the parameters for the pulse widths are specified in CLOCK units, so the value you pass in on a Bap28 running at 16mhz will not give you the same results on an Arc32 running at 20mhz. You can probably get around most of this by simply updating the constant stepsperdegree from 166.6 to the value (166.6*20)/16. You could/should convert this to a simple number...

Again you will have the same issues about sound command here as well...

Kurt


Top
 Profile  
 
 Post subject: Re: ARC32 and Lynxmotion Biped code - compatible ?
PostPosted: Tue Mar 27, 2012 10:38 pm 
Offline
Guru

Joined: Fri Feb 10, 2012 9:34 pm
Posts: 73
Kurt! Thanks for that. I am not worried about sound at this time. I appreciate the clock difference comment.

As to the servo offset - I have no idea how to do that without the buttons...Is there a program with Basic team that can do that for me ? I can use that instead of the lynxmotion one.

The autonomous - I will have to correct issues - hopefully not too many.

My main problem right now is that the IDE does not seem to connect to the ARC32. I have created a topic on that - the Find command in Tools > Preferences gets stuck at COM5 and CANCEL does not work making me kill the IDE to start again.

Thanks again!
Gopal


Top
 Profile  
 
 Post subject: Re: ARC32 and Lynxmotion Biped code - compatible ?
PostPosted: Wed Mar 28, 2012 1:17 am 
Offline
Master

Joined: Tue Nov 21, 2006 5:34 pm
Posts: 662
Hi again.

Actually I am also KurtE on the Lynxmotion forums... As for Basic Micro team... That more or less is Nathan (Acidtech).

Note: I normally don't use the find command. I simply see which IO port is assigned, and select that one from the drop down list, that is shown as part of the toolbar. Likewise I choose BasicATOMPro and in this case BAP ARC32.

As for using keyboard, I did a 5 minute hack up that compiles. Not sure if it runs... I attached it to this posting. Again no promises that it works, but maybe should get you a bit closer.

Kurt


Attachments:
mechosf_kybd.bas [7.46 KiB]
Downloaded 249 times
Top
 Profile  
 
 Post subject: Re: ARC32 and Lynxmotion Biped code - compatible ?
PostPosted: Wed Mar 28, 2012 10:26 am 
Offline
Guru

Joined: Fri Feb 10, 2012 9:34 pm
Posts: 73
Thanks Kurt, I will try the code this morning.

How do I find which COM port is assigned ? on my laptop I have 3 USB ports one of which is for the mouse.
The IDE list shows COM3, 4 and 5.
I don't see a BAP ARC32 in the processor select box - only BasicATOMPro, Basic ATOm and Basic Atom Nano.
Should the IDE be listing the ARC32 ?

I feel by choosing ARC32 that I am on the "bleeding" edge :)

Thanks


Top
 Profile  
 
 Post subject: Re: ARC32 and Lynxmotion Biped code - compatible ?
PostPosted: Wed Mar 28, 2012 1:59 pm 
Offline
Master

Joined: Tue Nov 21, 2006 5:34 pm
Posts: 662
First the easy part:
You choose: Basic Atom Pro in the first drop down list.
Then under the next list, choose the Arc32...

Comm Port: what I do is look at my device list and I can usually guess which Comm port it is. Most of the other information is missing and it shows as unknown... But that it is a comm port and it has a comm assigned to it.

When in doubt, I unplug it. See the list of comms and then plug it back in and see what new one is there...

Kurt


Top
 Profile  
 
 Post subject: Re: ARC32 and Lynxmotion Biped code - compatible ?
PostPosted: Wed Mar 28, 2012 6:18 pm 
Offline
Guru

Joined: Fri Feb 10, 2012 9:34 pm
Posts: 73
Thanks Kurt, I got the ARC32 to work using your directions. I was able to load the sample program - did not connect any servos as yet till I learn the pins etc - and it ran displaying the messages on Terminal 1.

Now to connect servos and take the plunge!


Top
 Profile  
 
 Post subject: Re: ARC32 and Lynxmotion Biped code - compatible ?
PostPosted: Thu Mar 29, 2012 5:40 pm 
Offline
Guru

Joined: Fri Feb 10, 2012 9:34 pm
Posts: 73
One question though - are the EEPROM locations the same in ARC32 ? When the servo offsets are written, when I need them in other programs that are from the other processor boards will the EEPROM addresses match ?

Thanks!


Top
 Profile  
 
 Post subject: Re: ARC32 and Lynxmotion Biped code - compatible ?
PostPosted: Thu Mar 29, 2012 6:26 pm 
Offline
Master

Joined: Tue Nov 21, 2006 5:34 pm
Posts: 662
The commands like readdm and writedm should work on either platform. The only difference I believe is that the Arc32 has a bigger EEPROM than the Bap28... But you can still choose to start saving the data at location 0 or elsewhere. You simply need to make sure that the program that sets the offsets and the program using them choose the same location. Note: Often in my programs on the Arc32, I will put the Servo Offset code into my main program and have a simple keyboard monitor that gets me into the mode.


Kurt


Top
 Profile  
 
 Post subject: Re: ARC32 and Lynxmotion Biped code - compatible ?
PostPosted: Thu Mar 29, 2012 6:53 pm 
Offline
Guru

Joined: Fri Feb 10, 2012 9:34 pm
Posts: 73
Thanks Kurt.
I like the idea of integrating servo offset in to the same program - I will try that also.
Gopal


Top
 Profile  
 
 Post subject: Re: ARC32 and Lynxmotion Biped code - compatible ?
PostPosted: Fri Mar 30, 2012 5:13 pm 
Offline
Guru

Joined: Fri Feb 10, 2012 9:34 pm
Posts: 73
Hi Kurt,
I loaded the modified program but was not able to see the various displays. The ARC32 program uses HSEROUT - should I be changing your code to be ARC32 compatible ?
Should I be using the ENABLEHSERVO2 ?
Please advise.
Thanks
Gopal


Top
 Profile  
 
 Post subject: Re: ARC32 and Lynxmotion Biped code - compatible ?
PostPosted: Fri Mar 30, 2012 5:18 pm 
Offline
Master

Joined: Tue Nov 21, 2006 5:34 pm
Posts: 662
I don't think you need any of the EnableHServo2 type stuff.

As for HSERIAL, the majority of the time on the Arc32, I do use the HSERIAL commands instead of STD_IN and STD_OUT, but I thought it should work as well...

You need to make sure the terminal program is configured to the same baud rate as the program is using.

Kurt


Top
 Profile  
 
 Post subject: Re: ARC32 and Lynxmotion Biped code - compatible ?
PostPosted: Fri Mar 30, 2012 5:25 pm 
Offline
Guru

Joined: Fri Feb 10, 2012 9:34 pm
Posts: 73
Thanks Kurt, I am comparing the ARC32 test code (from the IDE library) and making changes to your code so it may work now!
I will leave out the enablehservo as I don't see it in the ARC32 test program also.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 62 posts ]  Go to page 1, 2, 3, 4, 5  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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

Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO