BasicMicroUK - Forums

www.basicmicro.co.uk
It is currently Mon Jan 22, 2018 7:15 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 62 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject: Re: ARC32 and Lynxmotion Biped code - compatible ?
PostPosted: Sat Mar 31, 2012 2:22 am 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 7:00 pm
Posts: 1316
Location: Temecula, CA
enablehservo doesn't do anything anymore. It will act as a label now so you can leave it in. The compiler automatically determines if hservo library code is needed now and which library code to use(code for ARC32 or for other AtomPro modules/processors.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: ARC32 and Lynxmotion Biped code - compatible ?
PostPosted: Tue Apr 03, 2012 2:12 pm 
Offline
Guru

Joined: Fri Feb 10, 2012 9:34 pm
Posts: 73
Thanks all!

When I load the ARC32 test code (ARC32.BAS) from the libraries folder on to my biped - where 6 servos are connected to pins 4,5,6,7,8 and 10) - it seems the program does not go beyond Servo 6.

The FOR loop is from 0 to 31 so I am wondering why it is not going beyond 6.

I am learning this BASIC and not sure why the FOR NEXT would not complete the 32 cycles.

Suggestions ?
Thanks


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

Joined: Fri Feb 10, 2012 9:34 pm
Posts: 73
Continuing to work with ARC32.BAS program but not getting expected results.

The count never goes beyond 6 for current servo. The loop starts with 0 then goes 0,1 then 0,1,2 and so on till 6 and then goes back to 0.

I don't know why it could not go past 6 and check the other servos.

The other odd thing is on power-on all the servos move (some travel quite a bit) and twitch - ending with one of the leg servos twitching constantly.

Am I missing something here ? Does ARC32 need some sort of firmware download before any programs are loaded ?

Any help is appreciated.
Thanks


Top
 Profile  
 
 Post subject: Re: ARC32 and Lynxmotion Biped code - compatible ?
PostPosted: Wed Apr 04, 2012 7:53 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 7:00 pm
Posts: 1316
Location: Temecula, CA
You are probably getting a brownout/reset. Are you powering the servos from a seperate battery or is one battery running the ARC32 and the servos?

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: ARC32 and Lynxmotion Biped code - compatible ?
PostPosted: Wed Apr 04, 2012 7:59 pm 
Offline
Guru

Joined: Fri Feb 10, 2012 9:34 pm
Posts: 73
This is getting to be weird!

I put display statements to see where the program and I find something odd - even with a main - goto main the programs seem to run from the top. I am attaching a test version of ARC32 that (a) does not want to go beyond Servo 6 and (b) seems to loop all the way to the top of the program.

I am used to programming in C and with a direct command like main goto main I did not expect the program to loop back to the top.

I see this because of the display in terminal window of the text - All Servos to zero done (from my hserout line).

May be the ARC32 board is bad ? Or may be the IDE is not creating correct code ? I still have not been able to access the libraries despite checking for all kinds of updates for XP and making sure my laptop is up to date.

I can't progress further with anything including zero setting - much less trying any useful program.

I just saw Nathan's reply. I am using a single 6V to run just these 6 servos.
I am using the slimmer 6V and I do have the thicker 6V but even with the slimmer there is no place to put it with the torso in place. I don't know where the thicker pack will go!


Attachments:
File comment: ARC32 file with some display statements
b0010 - arc32-gi.bas [1.23 KiB]
Downloaded 290 times
Top
 Profile  
 
 Post subject: Re: ARC32 and Lynxmotion Biped code - compatible ?
PostPosted: Wed Apr 04, 2012 8:11 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 7:00 pm
Posts: 1316
Location: Temecula, CA
Are you using Debug mode? If so you can't use debug and hserout/serout commands. Debug uses the s_in/s_out pins to communicate. You are corrupting the data stream which could cause the screwy behavior.

If you are not using debug mode I can almost gauruntee its the power. Your program is reseting which causes it to start over from the first line. This can be caused by code or power or even by your USB cable(those this is usually on purpose).

Possible solutions:
1. Stop using debug mode
2. use the seperate logic and servo power with 2 batteries to elliminate voltage slump on the logic causing a brownout. Servos can take a lot of power.
3. add delays between the moves in your code so no more than one servo is moving at a time. This could let you continue using one battery atleast for testing.
4. Get a better battery. Id recommend a 7.2v 2400mah or better. Its harder to pull the 7.2v below 4v. If the input voltage goes below around 4v the onboard regulator will output less than 3v which will cause the arc32 to reset.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: ARC32 and Lynxmotion Biped code - compatible ?
PostPosted: Wed Apr 04, 2012 8:32 pm 
Offline
Guru

Joined: Fri Feb 10, 2012 9:34 pm
Posts: 73
Acidtech wrote:
Are you using Debug mode? If so you can't use debug and hserout/serout commands. Debug uses the s_in/s_out pins to communicate. You are corrupting the data stream which could cause the screwy behavior.

If you are not using debug mode I can almost gauruntee its the power. Your program is reseting which causes it to start over from the first line. This can be caused by code or power or even by your USB cable(those this is usually on purpose).

Possible solutions:
1. Stop using debug mode
2. use the seperate logic and servo power with 2 batteries to elliminate voltage slump on the logic causing a brownout. Servos can take a lot of power.
3. add delays between the moves in your code so no more than one servo is moving at a time. This could let you continue using one battery atleast for testing.
4. Get a better battery. Id recommend a 7.2v 2400mah or better. Its harder to pull the 7.2v below 4v. If the input voltage goes below around 4v the onboard regulator will output less than 3v which will cause the arc32 to reset.

Thanks Nathan. I am not using Debug mode - in fact if I go to Debugger and click on Connect I get a COM port may not support baud rate error.

The voltage display statements in ARC32.BAS show voltages over 6.0V.

What could be the problem with the USB cable ?

With a biped brat with torso there is really no room for 2 batteries - I have 2 6V that now seem to be a wasteful buy!

Any additional things I should check ?
Thanks


Top
 Profile  
 
 Post subject: Re: ARC32 and Lynxmotion Biped code - compatible ?
PostPosted: Wed Apr 04, 2012 9:55 pm 
Offline
Guru

Joined: Fri Feb 10, 2012 9:34 pm
Posts: 73
updates to my testing
1. I connected the 2 6V packs - one to the logic power and one to S1. Same behavior as before - the program won't go beyond servo 6.
2. I moved all servos to 0 thru 5 pins. Now the program seemed to work cycling through all 32 servos (only 6 connected)
3. Then the program gets lost in the move to zero code with output to screen all messed up.

Do I have set some jumpers on the ARC32 to make this work ? At this time all jumpers are as from factory.

Thanks


Top
 Profile  
 
 Post subject: Re: ARC32 and Lynxmotion Biped code - compatible ?
PostPosted: Fri Apr 06, 2012 12:02 am 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 7:00 pm
Posts: 1316
Location: Temecula, CA
One more thing it could be. Are your power jumpers for the servo headers set to Vcc or VS? If they are set to Vcc that is a problem. Change them to VS. Vcc is pulling 5v regulated power from teh 1amp power regulator. Servos will pull more than it can handle.

If that isnt the problem then remove all the servo connections. Run the code. Does it do the same thing or not? If it does the same thing then you are definitely messing with a power problem but what is causing it I don't know.

Are you using the Rev C ARC-32 board? if so you need to remove the JP6 jumpers(both of them) in order to use 2 seperate batteries otherwise they are just connected in parallel and you still don't have seperate VL and VS.

If none of the above is the problem then I'd recommend using a 7.2v battery instead of 6v which should allow you to use one battery. Why is 6v battery not enough? Could be because the servos are pulling enough juice to pull the voltage down too far. if the voltage goes below about 5.5v the regulator will not produce 5v. it starts following the voltage down minus about 1 volt. So if your voltage dips to 5v the regulator will only output 4v. if it dips to 4v you will see 3v or less on the Vcc. Its not exactly linear but its close. Anything below about 3.1v and the Arc32 will reset.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: ARC32 and Lynxmotion Biped code - compatible ?
PostPosted: Fri Apr 06, 2012 12:39 pm 
Offline
Guru

Joined: Fri Feb 10, 2012 9:34 pm
Posts: 73
Acidtech wrote:
One more thing it could be. Are your power jumpers for the servo headers set to Vcc or VS? If they are set to Vcc that is a problem. Change them to VS. Vcc is pulling 5v regulated power from teh 1amp power regulator. Servos will pull more than it can handle.

If that isnt the problem then remove all the servo connections. Run the code. Does it do the same thing or not? If it does the same thing then you are definitely messing with a power problem but what is causing it I don't know.

Are you using the Rev C ARC-32 board? if so you need to remove the JP6 jumpers(both of them) in order to use 2 seperate batteries otherwise they are just connected in parallel and you still don't have seperate VL and VS.

If none of the above is the problem then I'd recommend using a 7.2v battery instead of 6v which should allow you to use one battery. Why is 6v battery not enough? Could be because the servos are pulling enough juice to pull the voltage down too far. if the voltage goes below about 5.5v the regulator will not produce 5v. it starts following the voltage down minus about 1 volt. So if your voltage dips to 5v the regulator will only output 4v. if it dips to 4v you will see 3v or less on the Vcc. Its not exactly linear but its close. Anything below about 3.1v and the Arc32 will reset.


Nathan, I had left the jumpers as they were from the factory BUT suspecting something like what you describe yesterday I changed the VCC to VS for the servo headers and the arc32.bas is working now!

The ARC32 is Rev C - I was wondering why when I switch the logic battery on, the servos were also getting powered up! Now I will set the JP6 jumpers. The ARC32 datasheet from the web site does not seem to show this jumper group. Is it possible to get an updated datasheet ?

Slow but steady progress.


I have been trying to use the modified servo centering (offset) program uploaded here by Kurt. It seems to step the servo in steps of 25. Is this too little to notice ? The program seems to be doing something but I don't see much of a physical movement.

Thanks
Gopal


Top
 Profile  
 
 Post subject: Re: ARC32 and Lynxmotion Biped code - compatible ?
PostPosted: Fri Apr 06, 2012 6:50 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 7:00 pm
Posts: 1316
Location: Temecula, CA
The JP6 jumpers were just added because we were finally able to make room for them. The new datasheet is being finished and will be up asap.

I'd bump that 25 up to see if the servos are actually moving.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: ARC32 and Lynxmotion Biped code - compatible ?
PostPosted: Fri Apr 06, 2012 7:03 pm 
Offline
Guru

Joined: Fri Feb 10, 2012 9:34 pm
Posts: 73
Acidtech wrote:
The JP6 jumpers were just added because we were finally able to make room for them. The new datasheet is being finished and will be up asap.

I'd bump that 25 up to see if the servos are actually moving.


Thanks Nathan. I would like to get the datasheet and would like to know any other major differences that have been implemented.


I will change the program to see if the servos move and then I can scale back.

I was wondering if there was some sort of "cheat sheet" for servo offset setting - I am using the Hitec 485HB.
I will probably dismantle the biped, set the servos to zero thru a simple program and reinstall everything back. I don't know if that's a good idea or not!

Gokul


Top
 Profile  
 
 Post subject: Re: ARC32 and Lynxmotion Biped code - compatible ?
PostPosted: Mon Apr 09, 2012 9:29 pm 
Offline
Guru

Joined: Fri Feb 10, 2012 9:34 pm
Posts: 73
KurtEck wrote:
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


Hi Kurt! I have been making changes to the offset program. I see something that I can't understand.
I connected the servos to P0 to P5 and changed the code also for this.
But the code does not seem to cycle from 0 to 5 but in a sequence like shown in the comments in the program!

I am unable to HSEROUT the Servotable values as I don't know how to output a string like that defined for this table!

Can you please take a quick look at the attached file and give me some guidance ?
Thanks


Attachments:
mechosf_kybd.bas [8.45 KiB]
Downloaded 174 times
Top
 Profile  
 
 Post subject: Re: ARC32 and Lynxmotion Biped code - compatible ?
PostPosted: Mon Apr 09, 2012 11:07 pm 
Offline
Guru

Joined: Fri Feb 10, 2012 9:34 pm
Posts: 73
Update to the last post!

I realized that CurrentServo is an index and not the actual servo pin number. I was able to do some offset setting.

Incorporating a torso has created some issues with the legs being too close - need to do some thing to space the legs.

What would be the right modifier in a HSEROUT to see text strings like the Texttbl etc ?

Thanks
Gopal


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

Joined: Thu Mar 01, 2001 7:00 pm
Posts: 1316
Location: Temecula, CA
The texttbl is laid out so it can easily be used with a str modifier. Each text string is 21 characters long with a null(0) after it. So t get any particular text string from the table you just do this:

hserout [str texttbl(index*22)\22\0]

the str modifier sends data from arrays(texttbl is a constant array). It will start at index*22. So if index is 0 then it will start at the first string. If index is 1 it wills tart at location 22 which is the second string etc... The \22 tells the str modifier the maximum number of characters to send and the \0 tells the string modifier that it should stop if it sees a null(0). Since you know the length of each string you don't actually need the \0 and you could just use \21 instead of \22\0.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 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

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

phpBB SEO