Xan's Phoenix Code

:wink:
would be interesting to see too?

great idea i might try this. have you got a working example? it still doent explain why i cannot get the values to change the positions anyway.

At what parameter level do you change things? At the angle level for the joints, or at the ā€œtargetā€ coordinate level?

What does this teach you? I can see that itā€™s a good way to explore the ranges of motion for each of the joints. but I get that from PowerPod.

Maybe youā€™re saying you set a local coordinate (target) in X,Y,Z, and you can move that location around?

Just curious!

Alan KM6VV

innerbreed, KM6VV

Hi,

well I donā€™t believe I have the code handy but If I had to try the code again, best bet would be to use the ps2 controller code as the atom pro isnā€™t so occupied with doing other things ā€¦in my case I think myself and Zenta are the only people who have RC controlled phoenixā€™sā€¦ it was pretty hard to get accurate results with having the bot board read all 7 PWM channels while that split second reading a small push button wired up to an un used channel on the phoenixā€¦

so I ended up putting the code in the main loop of things and just use serout with my variables that changed and sit there and keep track of when the legs stopped moving and took a note on when that happened. The goal was ultimately to try and find an alternative way to move the legs around in 3d space , I have code that Zenta had helped me with and referenced his non modified version of the T7C remote that has more features.

So KM6VV ā€“ The idea was to move the initialization target around with the rc sticks, although since they are an initialization value you need to figure out a creative way to return those values to normal when you exit your leg control mode and Iā€™m not able to adjust angle, but location in 3d space in MM values as far as I have figured out, and this teaches me the limits of the legs reallyā€¦ I guess your question as what parameter I change things atā€¦not sure what you mean, but if I had to guess it would be after the initial values have been plastered in memory, I change them after that.

Innerbreed ā€“ I honestly thing you have some other issue going on with your code if something does not move, I remember your setup was kinda unique I know when I first started messing around with the phoenix code Id make changes and nothing would workā€¦

I do not have an example unfortunately but I would figure out in the ps2 code how you switched modes and replace one of those modes with individual leg movement and have it add or subtract a single digit each key press and use 6 buttons on the ps2 remote and hard code a single foot for movement, honestly this should be pretty simple just a bunch of if statements nestedā€¦

Here is the code Ive been working with the last couple months
pastebin.com/f2c528682

there is a lot of stuff in there that isnā€™t working although it just takes up space on the atom, and some code looks like it works but is not accessible, with the amount of buttons I currently have.

Itā€™s a 7 channel transmitter 4 are normal directional joysticks.
Channel 5 is a 3 state switch, when a servo is connected its left right and center
Channel 6 is what they call a VR pot ā€œits basicly a volume knobā€ I have this setup to raise and lower the height of the spider.
Channel 7 is a toggle switch its either normally up or normally down but when pressed the state changes.

there are so many flipping options on this T7C heli transmitter and 90% of them are really unable to be used in my setup as I just need raw channels to do things.

Zenta also is using his own version of that code although he has a modified transmitter for quite a bit more options, however Iā€™m trying to use the stock transmitter and add as much stuff as possible, which is why theirs broken stuff in the code I posted above in the pastebin link.

So I hope that answered any questions you guys had

ā€“Aarion

Hi Aarion,

OK I get what youā€™re doing. Modifying and observing the ā€œinitial positionā€ of a leg.

On your R/C, does the T7C then give you 6 or more simple channels to work from? Iā€™ve got a HiTec Laser 6 Channel 75MHz RC Controller that Iā€™m trying to use on a 4WD 'bot. the last two channels seem to be blended together, I canā€™t get to simple relay closures out of the last two channels. Are you doing anything like that? does the T7C work for you?

Alan KM6VV

The t7C works fantastic!

try this program and figure out what all your values are doing

[code]channel_1 var word
channel_2 var word
channel_3 var word
channel_4 var word
channel_5 var word
channel_6 var word
channel_7 var word
channel_8 var word

counted var word
counted = 0

top

counted = counted+1
pulsin p8,0,channel_1
Pulsin p9,0,channel_2
pulsin p10,0,channel_3
pulsin p11,0,channel_4
pulsin p12,0,channel_5
Pulsin p13,0,channel_6
pulsin p14,0,channel_7
pulsin p15,0,channel_8
serout s_out,i57600,[dec channel_1," ā€œ,dec channel_2,ā€ ā€œ,dec channel_3,ā€ ā€œ,dec channel_4,ā€ ā€œ,dec channel_5,ā€ ā€œ,dec channel_6,ā€ ā€œ,dec channel_7,ā€ ā€œ,dec channel_8,ā€ ",dec counted,13]
;pause 100

goto top

[/code]

Code is pretty simply though it just outputs the pwm values of all channels, modify so it works for you, guessing rip off channels that you do not need.

ā€“Aaron

I can get code from all 7 channels, and its all usable, not sure where your mixing comes in, it must be something weird, best advice make a test application like mine or use it and jot down what your values do when you move the sticks around ā€œthis helped me a tonā€

Hi Alan,

I also have a laser 6. Aarons code will work for helping you debug what you want. Obviously you dont need to do 8 channels when yours only has 6. Also timing wise this code will eat up a lot of time as the code will not be fast engouth that for example after the P8 pulse happens, to be ready for the pulse for P9, so it will have to wait a complete RC cycle to get the next pulse. So you would probably get better results at reading every other channel. Something like 0, 2, 4, 1, 3, 5. Also I have posted assembly code MPulseIn which can do it in one pass, but it may be best to get yours up and running.

As for Channels 5 and 6, I donā€™t remember the order, byt one has to do with the gear switch on to top left and the other with the rotary knob AUX on the top right.

Kurt

Hi Aaron, Kurt,

The code is a good idea! I donā€™t have a CPU on the 'bot, but itā€™s worth programming up one to see better whatā€™s going on with the R/C transmitter. That would split up the problem a little better. OK, itā€™s not a real bot!

I have a R/C interface controller board from SuperDroidRobots. I run channels 1&2 into the two PWMs for the Left and Right pairs of motors, channels 3&4 into the tilt/pan, and channels 5&6 are supposed to operate two individual relays to control the camera focus and shutter.

My Hitec Optic 6 (Laser 6) has the gear sw on the left which Iā€™ve identified, and the little flappers on either side seem to want to be set together (like their vaues add?). Trouble is, both gear and flaps work the same relay on the interface board. I can get one relay (out of 3) to close on my command. Iā€™d like two. Seems like channels 5&6 should be operable independently. It could also be that the controller board wants a pair of the regular ā€œjoystickā€ channels driving them. Iā€™m going to try that today.

I did just think about making a ā€œdelayā€ circuit, that would close one relay first, and then the second, to work the camera.

I donā€™t even see the board advertised anymore. Theyā€™ve gone to something else.

Iā€™ve been studying the transmitter and the controller board manuals, but theyā€™re not as through as Iā€™d like. More play required!

Thanks for the comments guys!

Alan KM6VV

well to narrow down any sorta problem you might have, honestly why donā€™t you attach 6 servos and watch them all move when you press buttons it might eliminate any issues your having with your transmitter or interface boardā€¦

I know I had to do this with my t7C as its probably the most advanced transmitter I have toyed around with, at least attach the other 2 servoā€™s on the channels in question, and eliminate all doubt if its one thing or the other.

ā€“Aaron

Hi Aaron,

Thatā€™s exactly what Iā€™ve been doing for the past two or more hours!

Iā€™d had servos on the channels before, but I repeated the check. Still OK. I moved the controller inputs down to the left joystick pair, and got the same results, although it was easier to study the indicators on the controller. I get the two channels needed in, and I can see the respective LEDs change. But only one relay is activated (a little more obvious now).

Iā€™ve written it up and sent off an inquiry to SuperDroid, maybe they will respond and send a replacement.

The board is buried in the 'bot, but I did see a transistor relay driver on the board, so I suppose I could rip it out and get my 'scope on it for a closer look. The red LED seems to be driven from a separate pin of the PIC then the transistor.

Anyone know about the UART FM 27Mhz Receiver? HR1S-07

I canā€™t find a T7C!

KM6VV ā€“

wellā€™s good luck, If I had to bet on itā€¦ I would probably bet your little interface board is having some issues.

I really couldnā€™t imagine you having so much trouble with a transmitter and receiver ā€¦ flip a switch or turn a knob and if a servo doesnā€™t move seems like that would be a sign its having some problemsā€¦

ā€“Aaron

Yeah, the RX and TX are fine! Nice little R/C package.

But the interface board just isnā€™t doing itā€™s job. If I donā€™t get a quick response to enquiry to SuperDroids, Iā€™ll pull it and see if the driver xstr is bad, or if I get a signal out of the PIC. Of course the relay could be the culpret as well.

I just hope this board is not now an orphin!

Alan KM6VV

Xan,

Are you planning on using external robot config files in your upcoming 2.0 release? The reason I ask, is that I am hoping to add them to my HexControl app and wondered if you wanted to try to standardize? That way people could swap robot configurations in and out of programs. :bulb:

Right now I am just using simple ASCI windows .INI format for my tests

Example
[PIN NUMBERS]
RRCoxaPin=15

etc, etc.

I know that many of our variables have different namesā€¦though most have been ā€œinheritedā€ from your original code. This might be more complicated than I am imagining but I figured that I would ask.

Let me know what you think.

Hi FLowbot,

V2.0 uses 3 separate files.

  1. The main program
  2. Configuration (containing all configuration concerning the hexapod hardware)
  3. Input (to easy switch between PS2, RC and others)

The IDE for the BAP is very limited compared to the Visual Basic environment you are using. IƃĀ¢Ć¢ā€šĀ¬Ć¢ā€žĀ¢m not capable of using ini files for configuration. But you are free to use my configuration file. ItƃĀ¢Ć¢ā€šĀ¬Ć¢ā€žĀ¢s a good idea to use the same configuration over multiple platforms.

You could read the configuration file directly or make some kind of import/export function. It could read/write some tags using a template or something. Just think about the options. Also keep in mind that the configuration files can chance in number of variables for extra servos and stuff.

I can send you a copy of the phoenix configuration file if you want.
Let me know what you think.

Xan

You knowā€¦ just tossing out an idea here flowbotXā€¦

I know in the previous code Iā€™ve been fiddling around with the last bunch of months, all the variables are declaimed at the beginning of the code, why not just parse the entire .bas file as if it were an ini, I know the code is less then 30k 'that doesnā€™t seem too horrible for an ini" even though it would be the entire bas code for the atomProā€¦ sure it sounds kinda weirdā€¦

or just copy and paste the variableā€™s from xanā€™s Phoenix code into your iniā€¦ and parse it from there.

ā€“Aaron

There is no need for that. All settings that are hardware related are in a separate setup file in V2.0.

Xan

Just to give some more background to this decision, I am working on encapsulating that massive (and slightly overwhelming) list of variables at the begining of the code in a hexapod object class and I want to allow people to be able to modify the setup of the hexapod without going into the code to make the changes. Thusā€¦the config file.

The question I am facing is whether to set the config file up as 1) an INI (as suggested by LikWidChz) which would allow for easy .txt based editing or 2) as XML (allows for the easiest and most intuitive savingā€¦but requires that people set up the hexapod through a series of menus in the program.)

If I run the INI route, the file will look very similar to Xanā€™s new 2.0 config fileā€¦which is an added bonus.

well Iā€™m sure with whatever decision you make will be probably the easiestā€¦I generally have been involved in way too many projects at one time and tend to use the ā€œKISSā€ method mostly.

Keep
It
Simple
Stupid

:stuck_out_tongue: hope that helpsā€¦ but probably notā€¦

ā€“Aaron

I vote for XML. XML can be edited in an xml editor (of which many are free) and lends itself well for reading and writing in a variety of programming languages.

Iā€™d like to be able to setup xml configuration settings not only for a hexapod but also other types of robots such as an arm, biped, or rover.

If we can standardize on settings, for say a com port config, Iā€™ll make sure all my apps look for that file first and if it doesnā€™t find it then Iā€™ll create it.

If we standardized on a location for saving the files to, like ā€œMy SSC32ā€ and a file name like ā€œSerialPortConfig.xmlā€ and agree on settings we want to store in it we can create an XSD to then describe it.

The SSC32 Servo Controller Software v2.2 - Visual Basic .NET
otherrobots.com/Downloads/tabid/56/Default.aspx
Has sample code for how to create the directory, an xml and xsd file. The program above saves the XML and XSD files in the ā€œMy SSC32ā€ directory under my documents so you can see some code on how to make it work.

On another note:
Iā€™ve also been working on standard serial com port code in that project to read binary data and display commands going out to the SSC32 and information coming back.

Iā€™ve also been working on a standard XML format for scripting (recording) commands for playback. My hope is to create a standard format for recording and playback of SSC32 command sets. That way you could record a pose or walk in your program, save it as XML, and give it to someone else and they could play it back in a player program like the one above.

Iā€™ve been working on this stuff off to the side because I didnā€™t want to distract from the work youā€™ve been doing on your application. I would like to eventually come up with a suite of programs that all interact. I also want to get your code working in the Microsoft Robotics simulation environment.

Thanks again for your great work on this code!

XML Notepad 2007 (a free XML editor)
microsoft.com/downloads/deta ā€¦ laylang=en

This is all really good info! In order not to hi-jack Xanā€™s thread, Iā€™m going to take the discussion back over to the VB.net project thread. See my post thereā€¦

KISS = Keep It Short and Simple, not Keep It Simple Stupid. I donā€™t know about others, but that is kind of offending, doesnā€™t it? :wink: The original code is in fact the shortest and simplest. Xan is putting up a really great effort to improve it so that it is more user-friendly to other users.

ā€œStupid is a mean wordā€ by Peyton, in The Game Plan.