Compiling problems

Im trying to compile a phoenix program for my hexapod using a lynxmotio SSC-32u and a botboarduino.

Im using the phoenix parts master found here........

Ive copied copied and pasted the correct files together in a folder but when i hit the compile button i get an error meassge saying...

Fatal error : Phoenix.h : no such file exists. But the file is showing that its there in the IDE.

have you tried compiling with a previous version of the IDE like 1.0X ?

Would seem that would be a good test to run %

dan

Instead of taking a picture of your screen, you can copy and paste the text from it into your post. That would make it much easier to read for us.

Did you follow the installation instructions?

Thank you that helped i knew i had to be doing something wrong.

ok im using the phoenix_ps2-ssc32 version of parts. I havent added the other oarts to that folder but still compiles.

Dont i still need to add the appropriate files to that folder?

Duhjoker:
I havent added the other oarts to that folder but still compiles.
Dont i still need to add the appropriate files to that folder?

No need to add anything to the phoenix_ps2-ssc32 folder or any of the other example sketch folders. Once you have installed a library it can be included in any sketch. If you were to move the library source files to the sketch folder then they can only be included by that sketch.

Awesome did not know that thank you.

Ok i was told by Xan that the code is written for hitec hs645 servos and im using MG90 servos that have a different PWM range.

Im supposed to look at the servo driver function for the conversion but ive looked all over the code and cannot find anything like that.

Would any of you guys know what im looking for?

It might be line 290 and 291 in {sketchbook}/libraries/Phoenix_Driver_SSC32/Phoenix_Driver_SSC32.h:

#define cPwmDiv       991  //old 1059;
#define cPFConst      592  //old 650 ; 900*(1000/cPwmDiv)+cPFConst must always be 1500
// A PWM/deg factor of 10,09 give cPwmDiv = 991 and cPFConst = 592
// For a modified 5645 (to 180 deg travel): cPwmDiv = 1500 and cPFConst = 900.

pert:
It might be line 290 and 291 in {sketchbook}/libraries/Phoenix_Driver_SSC32/Phoenix_Driver_SSC32.h:

#define cPwmDiv       991  //old 1059;

#define cPFConst      592  //old 650 ; 900*(1000/cPwmDiv)+cPFConst must always be 1500
// A PWM/deg factor of 10,09 give cPwmDiv = 991 and cPFConst = 592
// For a modified 5645 (to 180 deg travel): cPwmDiv = 1500 and cPFConst = 900.

Very good. I tried to find this myself but failed.

@Dujoker, you'll want to run some sort of test program to measure the angle your servo moves when given two different pulse values.

I think i can move the servo by hand and use the lynxterm to read the pwm.

Plus we know the range of my servos to be from 400 - 2400.

I saw that piece of code with the 900 which is the lowest range but never found the 2100us which is the far end of the 5645's pwm angle range.

Duhjoker:
I think i can move the servo by hand and use the lynxterm to read the pwm.

I'm not following?

The terminal won't can't read the position from normal hobby servos.

Can you use the terminal to set the positions? If so you could find the required values.

Duhjoker:
Plus we know the range of my servos to be from 400 - 2400.

Good. You also need/want to know how many angles the servo moves between extremes.

Duhjoker:
I saw that piece of code with the 900 which is the lowest range but never found the 2100us which is the far end of the 5645's pwm angle range.

There are mechanical limits listed in the "Hex_Cfg.h" file. These appear to be listed in angles (scaled by 10).

The equation used to convert angles to pulses doesn't require the upper pulse limit. The equation just requires the lower limit and the "cPwmDiv" constant.

I think I could help you calculate the value to use for "cPwmDiv" if you tell give me a few angle and pulse pairs.

How many degrees between the two extreme pulses? How many degrees between the lowest pulse value and a 1500us pulse?

Sorry misunderstood what the program could do.

Yea i can use it to calibrate the positions then write it to the board but youll have to instruct me in what i need to do.

Also i found this looking for different versions. Supposedly its optimized for MG90's but after pouring over it for a while, the only difference i see is in the mechanical limits in the config.h file.

Do i need to change the
mechanical limits?

The servos move from 0* to 180* depending on the pw

Since the range is between 400 and 2400 i would guess that 1400 would be the center or 90* position.

If you can instruct me on what to do i can give you what ever info you need.

And thank you!!!

Did a lil math, dont know if its right but i used the equation below

0* x 4160 / 360 - 1500

Except i substituted the 1500 with 1400 since that would be the middle. Looks like a pwm of 1500 would be 8.6*

I was just checking my hexapod programs and I see I have this constant for my small hex.

  US_PER_TAU = 4160

There are 360 degrees per tau1. This works out to 1040us per 90 degrees.

My large hex uses:

  US_PER_TAU = 4000

This is 1000us per 90 degrees.

I see you have the same 4160us figure I’m using. I suggest measuring this directly from your servos to make sure it’s accurate with the servos you’re using.

To check to see if this is correct, use the two pulse lengths 980us2 and 2020us3. Measure the angle between these two positions. It should be 90 degrees. If it’s not, you’ll need to try a different conversion factor.

I wouldn’t try measuring a full 180 degrees. I don’t think servos are as accurate near their extremes as they are near their center position.

You might want to change the endpoint in the config file. You need to change the pulses lengths to degrees.

  1. In case you’re not aware, tau is an alternative circle constant to pi. (The first time I heard of tau I thought it was stupid but it turns out those troublemakers were right. I now think tau is better (more intuitive) than pi for doing math with circles and I use it in my programs.)

  2. 1500 - (4160 / 8 ) = 980

  3. 1500 + (4160 / 8 ) = 1520

I did not know that. Awesome!!!

The equation i learned from you but i dont remember seeing the 4160 in the code.

Ok i hooked the SSC-32u up to the sequencer this time so i could save the frames and replay them.

I held up a pencil since it was at hand held it at a right angle from 980 then switched to 2020 and its a lil over id say around 98*.

Duhjoker:
angle from 980 then switched to 2020 and its a lil over id say around 98*.

Okay, I think we’re getting closer to figuring this out.

You tried 520us from center, I think you should try 468us1 from center next time.

So try 1032us and 1968us.

If these values don’t work (I think it’s unlikely these are the correct values), try increasing or decreasing the 468us value until you get a pair of pulses which will cause 90°2 rotation.

Once you get a pair of pulse lengths which produce a 90° rotation, try this same pair on a few other servos in your robot. Make sure the other servos also rotate 90° between the two positions.

Once you get this pair of pulses, let me know what they are and I can help you calculate the appropriate conversion constant.

  1. 90% of 520us = 468us
  2. I just learned alt + 0176 will produce a degree symbol.

Ok the 1032us - 1968us produces a 90* from each other.

Using phone to free up computer but have made a note about the degree symbol for later.

Chrcked the other servos and they all seem to be at 90* with those numbers.

Based on the comments included in the code posted by pert, I think you should use the following constants.

#define cPwmDiv       936;
#define cPFConst      538;  // 900*(1000/cPwmDiv)+cPFConst must always be 1500
// 900 * 1000 / 936 + 538 = 1499.54

I'm not sure if "cPFConst" should be 538 or 539. I personally have a hard time seeing a 1us change in servo position so I doubt the exact value of "cPFConst" really matters. I the in value of "cPwmDiv" is more important than "cPFConst".