Problem with apod code

Hello,
I’ve downloaded and unzip the apod zip file.
Opned in Studio project file and verified that the order of the files in the workspace is like showed in the table 16 …connected the receiver and turned on the ps2 controller…
But when i program the atom pro i hear a beep when starting to program …
In the build space is write so:
Preparing files…
D:/HEXAPOD/APOD/PHOENIX_CONFIG_3DOFAPOD.BAS
D:/HEXAPOD/APOD/PHOENIX_CONTROL_PS2.BAS
D:/HEXAPOD/APOD/PHOENIX_CORE.BAS
D:/HEXAPOD/APOD/PHOENIX_DRIVER_SSC32.BAS
compiling…
Error:D:/HEXAPOD/APOD/PHOENIX_CONTROL_PS2.BAS(LINE 148) : [TOKEN )] : Unexpected token type
Error Detected

Where I wrong?
When i use the ps2 controller I can hear all beeps when i push bottons but the bot doesn’t move:-(
Can sameone help me?
Download the .zip file, and unzip it. Open the .prj file in Studio (File->Open->*.prj), and verify that the files listed in the Workspace are in the order shown in Table 16. Install the PS2 controller receiver into the PS2 cable on the robot, make sure your PS2 controller is turned on, and then apply power to the robot. Program the Atom Pro. If all is well, you will hear a beep after power up. Press Start and the legs should snap to position. At this point, if you properly calibrated the servo offsets, the legs should be perfectly aligned.

Not sure. I just downloaded the zip file and loaded the project file and did a Build and it worked for me…

What version of the Basic Micro IDE are you using?
Do you have it set to BasicAtomPro and then BAP 28?

Does line 148 look like:

TorqueLevel = (cMandibleFSRminTorque + (TorqueSelect(TorqueIndex)*cTorqueMultiFactor2)/c2DEC) ;Middle torque value (128)

??? Kurt

Note: I am running build 2.0.0.16 of the IDE

Hi kurte,
I’m using ide version 2.0.0.15…i see only that version on the link:-(
I have setted basic atom pro…but then not the bat 28…mmmm…maybe is that my wrong??
:frowning:

I’ve setted bap28…but it still doesn’t work!
I notice that if i open the prj and i see the order of the files…that is different from what is write in tables…
If i leave that files in the origin order ide start to program the atom and when all is writed i hear the beep sound of good operation…I can move the bot but not in the right way…it doesn’t responde right to my command:-(
If I put the files in the order like in the Tables in the built compare the error that i sayed…
Where i wrong?

It needs to be in the order (config, core, control, driver_scc)

Kurt

going back to this point.
Specify?

your problem is not longer the files. i feel your assembly may be wrong.
can you post some pictures of the APOD. i fear some servos may be orientated wrong?

Hi jonny,
Like i sayed i can’t move in the right way…all movement are wrong:
For example when I push start 5 legs strechs down its body…:frowning:…one stay in another position…
When i give other commands all movement are wrong…:
The bot can’t walk…tail and head doesn’t responde ( even if the servos are active )
I can control only the mandible…

Before to program the atom i have done the calibration with linxterm like i did with Phoenix and like in writed on the apod tables…

I don’t know what to do…:frowning:

If it were me, I would start by doule checking which servo is connected to what pin on the ssc-32. The order may be different than some other hexes like the Phoenix.

Also That the ssc-32 has the right baud…

Morning…
Each servos are connected at the pins like illustrated in Apod tables.

Baude rate:
If we look in Phoenix tables and Apod tables the baude rate is setted in different way
I set the ssc like in Apod tables

I use ide 2.0.0.15 and the atom pro 28 seams to’ be connected well
I think is not problem of comunication

The calibracion with linxterm is good and writed on the ssc

Order of files:
If i unzip and take the prj file in workspace th order of the file is different from what showed in Apod tables…if i program in this way the BOT have the problem of the movements…

If i put the order files like showed it give me the error like i writed

I use Windows 7

:frowning:…HELP

rearranging the files won’t help. It won’t compile as variables that are used in one file are defined in that file or in previously included files. If you reorder it is likely that some variables will not be defined before they are used. Hence the error!

Now back to your problem. Please note, I do not have an A-POD, so I can only make educated guesses, but not test out anything.

However I am pretty sure that there is a major discrepancy between the complete tutorial: lynxmotion.com/images/html/build184.htm
Servo Channel Numbering chart and the SSC Pin Numbers given in the file: phoenix_config_3dofapod.bas. Not sure which one is better, but if you are wired up the way that is shown in the tutorial. It is probably easier to change the file than to move all of the servos wires.

Again I can not test it, but I would try changing the source file I mentioned. Look for the are marked: ;[SSC PIN NUMBERS]
And try changing the pin numbers to:

[code]cLFCoxaPin con P24 ;Rear Right leg Hip Horizontal
cLFFemurPin con P25 ;Rear Right leg Hip Vertical --CHANGED FROM 1; FAULTY SSC-32
cLFTibiaPin con P26 ;Rear Right leg Knee

cLMCoxaPin con P20 ;Middle Right leg Hip Horizontal
cLMFemurPin con P21 ;Middle Right leg Hip Vertical
cLMTibiaPin con P22 ;Middle Right leg Knee

cLRCoxaPin con P16 ;Front Right leg Hip Horizontal
cLRFemurPin con P17 ;Front Right leg Hip Vertical
cLRTibiaPin con P18 ;Front Right leg Knee

cRFCoxaPin con P8 ;Rear Left leg Hip Horizontal
cRFFemurPin con P9 ;Rear Left leg Hip Vertical
cRFTibiaPin con P10 ;Rear Left leg Knee

cRMCoxaPin con P4 ;Middle Left leg Hip Horizontal
cRMFemurPin con P5 ;Middle Left leg Hip Vertical
cRMTibiaPin con P6 ;Middle Left leg Knee

cRRCoxaPin con P0 ;Front Left leg Hip Horizontal
cRRFemurPin con P1 ;Front Left leg Hip Vertical
cRRTibiaPin con P2 ;Front Left leg Knee

cHeadRotPin con P13 ;Head Rotate
cHeadPanPin con P12 ;Head Panorate (side to side)
cHeadTiltPin con P14 ;Head Tilt (up and down)

cMandRightPin con P28;Right Mandible
cMandLeftPin con P29;Left Mandible

cAbdomPanPin con P30;Abdomen Panorate (tail side to si
cAbdomTiltPin con P31;Abdomen Tilt (tail up and down) [/code]
Hope that helps.
Kurt

Hi kurte,
I’m not sure to understand u:-(
Coz I have looked in the phoenix_config_3dofapo.bas and looked the pins assignment into it and their assignmet are not different from how i have set my ssc
So i think that problem can’t be resolved changing the pins assignment in that file…
I think must be another error samewhere
I tried again to turn on the bot ( keeping raised from the ground ) , then turn on the controller,and pushing start botton I can hear beeps but the bot starts to do same movement without i give it any command…
If i push other botton i hear the beeps but bot doesn’t reaponde corretly!
:frowning:
I really don’t understand where i wrong!!!

i?ll put same pics to show u like the bot starts:
seams to be a problem of servos offsets…but I’m not sure coz the calibration with the ssc went good.
looking in the confg file :

;[CONDITIONAL COMPILING] - COMMENT IF NOT WANTED
;c4DOF con 1 ; Switch between 3DOF and 4DOF
;cTurnOffVol con 630 ; When uncomment the bot will turn off when
; the voltage drops below this setpooffsets

;Zenta, the UsecodeOffsets section can be removed in the final release:
;--------------------------------------------------------------------
;[SERVO Offsets]
#IFDEF UseCodeOffsets
cRFCoxaOffset con 644 ;Front Right leg Hip Horizontal ;650-6
cRFFemurOffset con 564 ;Front Right leg Hip Vertical ;650-86
cRFTibiaOffset con 670 ;Front Right leg Knee ;650+20

cRMCoxaOffset con 662 ;Middle Right leg Hip Horizontal ;650+12
cRMFemurOffset con 555 ;Middle Right leg Hip Vertical ;650-95
cRMTibiaOffset con 675 ;Middle Right leg Knee ;650+25

cRRCoxaOffset con 707 ;Rear Right leg Hip Horizontal ;650+57
cRRFemurOffset con 556 ;Rear Right leg Hip Vertical ;650-94
cRRTibiaOffset con 684 ;Rear Right leg Knee ;650+34

cLFCoxaOffset con 629 ;Front Left leg Hip Horizontal ;650-21
cLFFemurOffset con 802 ;Front Left leg Hip Vertical ;650+152
cLFTibiaOffset con 573 ;Front Left leg Knee ;650-77

cLMCoxaOffset con 689 ;Middle Left leg Hip Horizontal ;650+39
cLMFemurOffset con 720 ;Middle Left leg Hip Vertical ;650+70
cLMTibiaOffset con 584 ;Middle Left leg Knee ;650-66

cLRCoxaOffset con 713 ;Rear Left leg Hip Horizontal ;650+63
cLRFemurOffset con 790 ;Rear Left leg Hip Vertical ;650+140
cLRTibiaOffset con 564 ;Rear Left leg Knee ;650-86

#endif

maybe is here the problem?

What I was trying to say, is that the image in the tutorial does not match the servo numbers I was seeing in the config file. In particular the image:

I am reading it that the servos for the Right Rear leg would be on SSC-32 pins 0, 1, 2 but the code has them on 24-26. Looking at the config file again, the comments are all wrong in here as well. That is:

cRRCoxaPin con P24 ;Front Left leg Hip Horizontal cRRFemurPin con P25 ;Front Left leg Hip Vertical cRRTibiaPin con P26 ;Front Left leg Knee
Note: the RR as the constant names. This stands for Right Rear. You will see LR for left Rear, LM for Left Middle… So it looks like someone needs to make a pass and clean this up.

Anyway, when I run into problems like this I often write a quick and dirty program to do things like wiggle each servo to verify that they work and that they are on the pins that I expect…
I uploaded one here that moves all servo to their center location (1500), asks you to enter a servo number and then moves it back and forth. This is usually helpful to for example look at the diagram I mentioned above and enter a servo and see what happens…

Again try changing the section I mentioned to what I included in the previous post and see if things work a little better!

Kurt
wigglesscservo.bas (1.2 KB)

thanx Kurte!
now I understand!!!
for sure that is the problem…or unoe of problems!
I’ll do like u say…ohh and thanx for the program.
a think I don’t understand…It’s possible that nobody have looked that errors?!
for sure changing the pins assignment will resolve the walking problems…but what will be the cause of the initial position of the bot ( i thnk is not correct)
i try to load same pics

Hi,

You must comment out this line in the config file:

UseCodeOffsets 	con 1 	;Comment this line if you are using the internal SSC32 registry offsets

I can’t see that there is anything wrong with the tutorial and the config file:

[code];[SSC PIN NUMBERS]
cRRCoxaPin con P0 ;Rear Right leg Hip Horizontal
cRRFemurPin con P1 ;Rear Right leg Hip Vertical
cRRTibiaPin con P2 ;Rear Right leg Knee

cRMCoxaPin con P4 ;Middle Right leg Hip Horizontal
cRMFemurPin con P5 ;Middle Right leg Hip Vertical
cRMTibiaPin con P6 ;Middle Right leg Knee

cRFCoxaPin con P8 ;Front Right leg Hip Horizontal
cRFFemurPin con P9 ;Front Right leg Hip Vertical
cRFTibiaPin con P10 ;Front Right leg Knee

cLRCoxaPin con P16 ;Rear Left leg Hip Horizontal
cLRFemurPin con P17 ;Rear Left leg Hip Vertical
cLRTibiaPin con P18 ;Rear Left leg Knee

cLMCoxaPin con P20 ;Middle Left leg Hip Horizontal
cLMFemurPin con P21 ;Middle Left leg Hip Vertical
cLMTibiaPin con P22 ;Middle Left leg Knee

cLFCoxaPin con P24 ;Front Left leg Hip Horizontal
cLFFemurPin con P25 ;Front Left leg Hip Vertical
cLFTibiaPin con P26 ;Front Left leg Knee

cHeadRotPin con P13 ;Head Rotate
cHeadPanPin con P12 ;Head Panorate (side to side)
cHeadTiltPin con P14 ;Head Tilt (up and down)

cMandRightPin con P28;Right Mandible
cMandLeftPin con P29;Left Mandible

cAbdomPanPin con P30;Abdomen Panorate (tail side to si
cAbdomTiltPin con P31;Abdomen Tilt (tail up and down)[/code]

apodpins.jpg

Looks equal and correct if you ask me.

EDIT:

OH, WAIT.
I see the problem in the tutorial. At first I checked the files I had sent to Lynxmotion. But the file in the tutorial at the step 16 inside table 16 are wrong!

This is the file I originally sent to Lynxmotion:APod_PS2.zip (26.8 KB)

Remember to comment out the functions you don’t need in the config file.

Thanx kare…and thanx kurte!!
Tomorrow morning I’ll program again the bap28 and I’ll keep u informed.