Lynxmotion Tech Support

www.lynxmotion.com
It is currently Tue Jun 18, 2013 1:12 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Fri Oct 02, 2009 3:07 am 
Offline
Superguru of Robotics!!!
User avatar

Joined: Wed Nov 28, 2007 7:48 am
Posts: 1141
Location: Netherlands
Hi all,

Some of you might have noticed that the Phoenix code isn't running as it should when you're using the new BasicMicro Studio. When the Phoenix code is programmed the hexapod will wobble instead of walk. The movements will vary from big steps to tiny steps all the time.

Some interrupt enable features are changed in the new BasicMicro Studio. This causes the Wtimer to be disabled in the phoenix code. Since the synchronisation between the SSC and the BAP depends on this timer it will fail.

This can be easy solved by adding an additional enable without any arguments in the code. The additional enable should enable all interrupts. Just search the code for this line:
Code:
enable TIMERWINT_OVF


And add the additional enable like shown here:
Code:
enable TIMERWINT_OVF
enable

This should be all.

Xan

_________________
[b]Share, Use and Improve![/b]
Digging trough: [i]Theory of Applied Robotics: Kinematics, Dynamics, and Control[/i]
Xan's YouTube Channel
http://www.youtube.com/xanore


Top
 Profile  
 
PostPosted: Mon Nov 02, 2009 12:53 am 
Offline
Roboteer

Joined: Thu Oct 29, 2009 6:00 am
Posts: 7
Hello Xan.
Thank you very much for the description and help. It will be a great help. Keep this continue. Your posts are helpful for us.

_________________
minerals


Top
 Profile  
 
PostPosted: Mon Nov 02, 2009 3:09 am 
Offline
Superguru of Robotics!!!
User avatar

Joined: Wed Nov 28, 2007 7:48 am
Posts: 1141
Location: Netherlands
Thanks! And welcome as always ;)

_________________
[b]Share, Use and Improve![/b]
Digging trough: [i]Theory of Applied Robotics: Kinematics, Dynamics, and Control[/i]
Xan's YouTube Channel
http://www.youtube.com/xanore


Top
 Profile  
 
PostPosted: Sun Jan 02, 2011 8:23 am 
Offline
Superguru of Robotics!!!
User avatar

Joined: Wed Nov 28, 2007 7:48 am
Posts: 1141
Location: Netherlands
Hi Guys,

I had some new issues with the current Basic Micro Studio (2.0.0.5) in combination with the phoenix code. Kurt was happy to help me out on this and we found the issue.

There is a little change in how the compiler handles the assembly code. So make sure you've got the ASM{}, BEGINASMSUB and ENDASMSUB on the correct locations.

The timer functions should look like this.
Code:
;--------------------------------------------------------------------
;[Handle TimerW interrupt]
BEGINASMSUB
HANDLE_TIMERW
ASM{
  push.w   r1                     ; save away register we will use
  bclr #7,@TSRW:8                  ; clear the overflow bit in the Timer status word
  mov.w @WTIMERWOVERFLOWCNT:16,r1      ; We will increment the word that is the highword for a clock timer
  inc.w #1,r1
  mov.w r1, @WTIMERWOVERFLOWCNT:16
  pop.w  r1                        ; restore our registers
  rte                           ; and return   
}
ENDASMSUB
return
;-------------------------------------------------------------------------------------
;[Simple function to get the current time and verify that no overflow happened]
GetCurrentTime
ASM{
  nop      ; probably not needed, but to make sure we are in assembly mode
  mov.w  @WTIMERWOVERFLOWCNT:16, e1
  mov.w  @TCNT:16, r1
  mov.w  @WTIMERWOVERFLOWCNT:16, r2
  cmp.w  r2,e1                     ; make sure no overflow happened
  beq           _GCT_RETURN:8         ; no overflow, so return it

  mov.w  @WTIMERWOVERFLOWCNT:16, e1
  mov.w  @TCNT:16, r1

_GCT_RETURN:
  mov.l  er1, @LCURRENTTIME:16
}
return lCurrentTime                  ; switched back to basic
;--------------------------------------------------------------------


If you are also using the RC remote version you should also add the ASM{} brackets in the pulsin7 function
Code:
;-------------------------------------------------------------------
;[Pulsein7] Read in all 7 servo values in one pass.
Pulsein7:
ASM{
    ; Make sure all 7 IOs are set to input.
    PMR5 = 0 ; all IO lines are general IO
    PCR5 = 0 ; All are input  (may want to leave bit 7 alone...
   
...

_P17_RETURN_STATUS:   
   mov.b   r1l,@BPULSETIMEOUT
; finally transisition back to basic and return.
}
return
;--------------------------------------------------------------------


This solved the problem for me.

Kurt, Thanks again for solving this :)

Xan

_________________
[b]Share, Use and Improve![/b]
Digging trough: [i]Theory of Applied Robotics: Kinematics, Dynamics, and Control[/i]
Xan's YouTube Channel
http://www.youtube.com/xanore


Top
 Profile  
 
PostPosted: Sun Jan 02, 2011 9:33 am 
Offline
Robot Guru
User avatar

Joined: Sat Apr 15, 2006 1:42 pm
Posts: 4421
You are welcome and I am glad we have you up and running on Studio.

Kurt


Top
 Profile  
 
PostPosted: Sun Jan 02, 2011 10:18 am 
Offline
Superguru of Robotics!!!
User avatar

Joined: Wed Nov 28, 2007 7:48 am
Posts: 1141
Location: Netherlands
kurte wrote:
You are welcome and I am glad we have you up and running on Studio.

LOL, that sure took some time. Didn't it ;)

_________________
[b]Share, Use and Improve![/b]
Digging trough: [i]Theory of Applied Robotics: Kinematics, Dynamics, and Control[/i]
Xan's YouTube Channel
http://www.youtube.com/xanore


Top
 Profile  
 
PostPosted: Wed May 04, 2011 1:55 am 
Offline
Roboteer

Joined: Thu Apr 28, 2011 2:38 pm
Posts: 3
Hi Atmel here, I am new to microcontrollers and programming. I have completed the assembly and basic testing of the Phoenix hexapod. That would include the SSC and BB2/Atom pro28. I was able to get the bot servos to come online using the Lynxterm software and update the firmware. All of the servos are aligned and functioning as far as I can tell. The Atom pro/BB2 was successfully initialized using the test ascending beep program. I believe that I have followed the diagrams outlined in Figure 14-3 of the updated schematic for both boards, jumpers off or on where needed according to the schematics, wiring connected just so, R/C connected and on,etc. I then loaded the file and was rewarded with the following error.----> Error: FILE C:\USERS\PAUL\DOWNLOADS\PHOE2PS2\PHOENIX_V20.BAS(LINE 88) : [TOKEN CRRCOXAPIN] : Expected a constant <------
Could you help with this please?


Top
 Profile  
 
PostPosted: Wed May 04, 2011 4:42 am 
Offline
Superguru of Robotics!!!
User avatar

Joined: Wed Nov 28, 2007 7:48 am
Posts: 1141
Location: Netherlands
Hi Atmel/Paul, ;)

Make sure you've got the files in this order
;Project file order:
; 1. Phoenix_Config_xxx.bas
; 2. Phoenix_Core.bas
; 3. Phoenix_Control_xxx.bas

I think this could solve the issue.

Xan

_________________
[b]Share, Use and Improve![/b]
Digging trough: [i]Theory of Applied Robotics: Kinematics, Dynamics, and Control[/i]
Xan's YouTube Channel
http://www.youtube.com/xanore


Top
 Profile  
 
PostPosted: Wed May 04, 2011 12:17 pm 
Offline
Roboteer

Joined: Thu Apr 28, 2011 2:38 pm
Posts: 3
Xan, I don't know where you found the files listed in your post. The files that open for me using the PHOE2PS2 zip file contain:

phoenix_cfg
Phoenix_control_ps2
phoenix_v20.asm
phoenix_v20
phoenix_v20.pdb
phoenix_v20.prj
This is the order in which the files open upon extract. Is "core" your vernacular for .asm?
I am trying to get this up and running for a group of seniors ( of which I am one) for a sort of "show and tell". The friends that I have at the Senior Center are really a neat bunch and they love seeing stuff that abounds on the Discovery Channel.
Paul


Top
 Profile  
 
PostPosted: Wed May 04, 2011 12:28 pm 
Offline
Salmon of Retribution
User avatar

Joined: Fri Jul 28, 2006 5:41 pm
Posts: 540
Location: The Plane of Suck.
When you open the .prj file in Basic Micro Studio, the project will appear on the left side of the screen. Click on the little + and the project will expand showing all of the files contained in the project. THAT is where you find the file order that Xan is talking about. They have to be in the correct order or it will not compile correctly.

_________________
Curiously enough, the only thing that went through the mind
of the bowl of petunias as it fell was "Oh no, not again."

James "Don't call me Jim" Frye
Lynxmotion, Inc
http://www.lynxmotion.com


Top
 Profile  
 
PostPosted: Wed May 04, 2011 12:49 pm 
Offline
Lynxmotion Founder
User avatar

Joined: Mon Oct 31, 2005 10:46 am
Posts: 9325
Location: my quiet place
Xan is several revisions farther along with the code evolution, so the names are not exactly the same as in the current zip. The latest version has a separate config file for the different control methods. This should help.

phoenix_cfg.bas = Phoenix_Config_xxx.bas
phoenix_V20.bas = Phoenix_Core.bas
phoenix_control_ps2.bas = Phoenix_Control_xxx.bas

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...


Top
 Profile  
 
PostPosted: Wed May 04, 2011 11:48 pm 
Offline
Roboteer

Joined: Thu Apr 28, 2011 2:38 pm
Posts: 3
IT LIVES! Thanks to all of you, Xan, Jim, everybody else that contributed.


Attachments:
IMG_2353.JPG
IMG_2353.JPG [ 329.25 KiB | Viewed 2293 times ]
Top
 Profile  
 
PostPosted: Thu May 05, 2011 8:37 am 
Offline
Superguru of Robotics!!!
User avatar

Joined: Wed Nov 28, 2007 7:48 am
Posts: 1141
Location: Netherlands
Robot Dude wrote:
Xan is several revisions farther along with the code evolution, so the names are not exactly the same as in the current zip. The latest version has a separate config file for the different control methods. This should help.

phoenix_cfg.bas = Phoenix_Config_xxx.bas
phoenix_V20.bas = Phoenix_Core.bas
phoenix_control_ps2.bas = Phoenix_Control_xxx.bas

Oh, sorry about that...

Glad you got it to work! Enjoy!

_________________
[b]Share, Use and Improve![/b]
Digging trough: [i]Theory of Applied Robotics: Kinematics, Dynamics, and Control[/i]
Xan's YouTube Channel
http://www.youtube.com/xanore


Top
 Profile  
 
PostPosted: Thu May 05, 2011 9:10 am 
Offline
Lynxmotion Founder
User avatar

Joined: Mon Oct 31, 2005 10:46 am
Posts: 9325
Location: my quiet place
atmel wrote:
IT LIVES! Thanks to all of you, Xan, Jim, everybody else that contributed.


I am pleased on your behalf. :)

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...


Top
 Profile  
 
PostPosted: Thu May 05, 2011 9:17 am 
Offline
Roboteer

Joined: Thu May 05, 2011 9:10 am
Posts: 1
Yes me too I would like to learn on that and so that I can use it in my daily work.

_____________________
[url=http://www.justlogical.com.au/]It support perth[/url]


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

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