Xan's Phoenix Code

Hi guys,

Robot Dude Wrote:

I have a MiniABB board. I changed the PS2 connections to pins 4,5,6,7, as shown in the tutorial for PS2 / Mini ABB / Bot BoardII. I had it set up for a BB II so there would be no communications. :blush: The change has not shown any improvements. I have not played with it that much or checked the forum in a few days - - - job stuff. :frowning:

Thanks for the new thread and the patience :wink: Seems a good place to post some pics. :laughing:

Hi,

As far as I know the PS2 remote worked fine with the mini ABB when you use a non pro version of the Atom processor. If you do have a pro version you need to add some pull resistors to get the remote to work. The guys from LM helped us with that and added some pull resistors on the Bot Board II. So if you have a pro, stick with the Bot Board II and use pins 12,13,14,15 because the pull resistors are connected to those. You can check the schematic in the User guide.

DonƃĀ¢Ć¢ā€šĀ¬Ć¢ā€žĀ¢t forget to replace the ƃĀ¢Ć¢ā€šĀ¬Ć…ā€œNAP 4ƃĀ¢Ć¢ā€šĀ¬

Clarification: The Pro processor has a 3.3vdc I/O pin in the 4,5,6,7. Donā€™t remember which one. So if you use a Pro you need to move the PS2 connections to 12,13,14,15 and add the pullup to the data line. You can look at the schematic of the Bot Board II to see whatā€™s going on. Also donā€™t try to use the PS2 Port on the MiniABB as it was designed for the Basic Stamp II, and will not work with the Pro.

Robot guy

Yes, thanks. I seem to remember in the distant past discussing this issue. I have read up on it and will let you know when I get it completed. It will be a bit of surgery to remove the ABB board from my bot so it could take a few days. Also I will alter that line of code as mentioned. If I can get communication, I still need to set all the dimensional parameters (in millimeters) for my particular bot. It is only similar in dimension to Phoenix, Black Wido, IC Hex, and others. My final dimensions were all driven by the sizes of the LM boards and servos, in addition to what I thought looked cool! 8) 8) 8)

P6 and P7 opn AtomPro are 3.3v outputs(5v tolerant inputs). They are I2C capable via hardware(which is why they are limited to 3.3v I guess, though you will have to ask Renesas why that is).

Nap on the AtomPro is different than Nap on the Atom. Both use the hardware sleeping functions of the underlying chip. PIC sleeping functions a lot differently then Renesas sleeping. And there is possibly a bug in larger times though I havenā€™t had a chance to check it out yet. Nap on the AtomPro should be in increments of 2.048ms so Nap 4 would give you a pause approx 8ms long. Nap on the BasicAtom(PICmicro based processor) was a direct sleep command which had 8 possible settings. Maximum was 32ms IIRC which was Nap 7.

Robot dude,

I have been working a bit on the sugery to my hexā€™s mini ABB board. I tried a 10k resistor on the data line only as per a tutorial I found. No change in PS2 communications. I have studied the Bot Board II and found two pull-up resistors relating to this matter: one on the data & one on the clock line, both are 1K resisotrs. I am at work on that alteration now. I also did notice the change in timing when NAP was changed to a ā€œpause 100ā€ command. the beep frequency indicating no communications is now about 3 times faster. That timing makes sense with the explanations of its function, thanks. Now to get the PS2 working. Iā€™m not giving up, sooner or later, this botā€™s gonna walk like he means it . . . . :smiley:

Hi Zenta,

IƃĀ¢Ć¢ā€šĀ¬Ć¢ā€žĀ¢m working on a new version of my code. I want to include a improved universal gait sub which makes it possible to switch between a few gaits by pressing the select button. I also want to include the ƃĀ¢Ć¢ā€šĀ¬Ć…ā€œsneakingƃĀ¢Ć¢ā€šĀ¬

Hi Jim,

Any news about the ā€œQā€ command? This would solve some timing issues that IƃĀ¢Ć¢ā€šĀ¬Ć¢ā€žĀ¢m struggling with.

Thanks,

Xan

OK,
I added the 1K pull-up resistor to the dat pin on my Mini-ABB, also one on the clk pin. Couldnā€™t remember the situation with the second one on the clk. I donā€™t think it is needed here, yet the BotBoard II shows it on the schematic. Still no communications with the PS2, and none with the SSC-32 now either.

Soooooo . . . . . . I ordered a BotBoard II yesterday.
:unamused: I guess itā€™s time I updated my hardware to keep up. :unamused: The mini-ABB will likely be mounted on an old LM hex with the Basic Atom I got, then I can use the ServoPod to generate some code . . . .So many robots, so little time. :smiley:

Hi Xan,
I used a scoop and another Basic Atom Pro to measure a port (I used P15).
Snip from code: (This example measures how long time it takes to read all RC channels)

...
;From Phoenix program
...
;test pin
TestPin	con P15	
...
main:

  	high TestPin
	
	gosub RCInput
	low TestPin
	gosub WhatToDo

Code on the other BAP doing the measures:

pwmCH01Input var long

main:

pulsin p1,0, pwmCH01Input
timeout:
serout s_out, i9600, "Pin1=", sdec pwmCH01Input,13]


goto main

By measuring the pulse length on P15 youā€™ll get the result.
BTW I experienced some trouble when trying to measure pulses longer than 65,535 mS with the pulsin command. The manual mentioned a timeoutlabel and timeoutmultiplier, I followed the example but it didnā€™t work. I donā€™t know what I did wrong thoughā€¦ :unamused:

.
My guess is that there is something else going on other than just the 3.3v. For example I believe these pins may be used internally to talk to the EEPROM. I know that the Propeller chip can talk to the PS2 and all of the IO pins are 3.3V. All 4 data lines are connected to IO pins through a 1K resistor with a 10K pull-up resister to +5V to the DAT pin.

It would be interesting to find out what the actual reason is, on ther other hand it is proably just easier to work around it.

Now back to on subjectā€¦

What PS2 controller are you using? Could also be a current problem more so than a 3.3v problem. Also, no those pins are not used to connect to the eeprom on the modules. They are available for the user to use as I2C but we donā€™t use them for anything on the module itself.

FYI - I continued the PS2 questions in a seperate threadā€¦

Zenta - Nice approach for timings!

Kurt

Thanks Kurt,

About Xanā€™s codeā€¦
Iā€™m still working with some new features. But not everything seems to be as easy or straight forward as I hoped for. :unamused:

Hi Xan

I see in this video
youtube.com/watch?v=NMtifBKX3kE
You have a gait implemented with Wii control, thought iā€™d ask if you could post that code revision before i work through adding the bluesmirf code into the Phoenix PS2 Code.

Psymon

Hi Xan and Zenta,

Ok, today I finally got my hex back in one piece. I swapped in a BB2, the SSC32 was updated to an ATMEGA128 and I installed a new Lynxmotion PS2 controller and cableā€¦ I used the newer tutorial to make sure I had everything back on properly (lynxmotion.com/images/html/build99c.htm. At first my PS2 controller did not work properly, but I found I plugged in the cable backwords (p12-15). I was temporarily confussed by Figure 7 in the tutorial as I think the picture may be wrongā€¦ But this is a different issue. Now It is working.

I was now thinking of trying out your code on the round hex. My assumption is that I will need to change the constants in the Body Dimensions. Likewise probably the Min/Max angles. Any suggestions?

Thanks
Kurt

Hi Kurt,

I think you got it, especially the body and leg dimensions are the most important. And I also think you might want to change the ā€œFeet positionsā€ in the [INIT] section, the RFPosX,Z,Y and so on. You donā€™t need to change them. A little tip, the LM- and RMPosX are recommended to be close to the length of the femur + coxalength.

Ex. you can use my PEP sheet to experiment with different setup for the ā€œFeet positionsā€, remember to change the leg and body values in the setup sheet. And click the Body2 button to switch to a round body.

Good luck! Looking forward to see a video?! :wink:

Thanks zenta,

I am looking at PEP, but right now I am in the process of trying to figure out how to get Excel from the edit mode to more or less run mode. This is the vista versionā€¦ I used to reasonably know excel, butā€¦

UPDATE: Note, by default excel disabled all of the macros as being unsafe. Found I had to reload and then tell it, that it is Ok to runā€¦

Ok, I have made some progress. I updated the lenghts of the different joints and updated the starting point as you suggested. I have still not updated the min/max angles yet. It is starting to work reasonably now.

This is my first attempt of uploading a video from my digital camera, so it is not anything special, but at least it hopefully shows some progress :smiley:
i416.photobucket.com/albums/pp245/Kurts_Robots/th_MOV02953.jpg
Kurt

Hi Kurt,

It looks like you got it right, well done!