Reversing one DOF using botboarduino with scc32 & Solar772's

I have built the phoenix hexapod and all is working well except for one aspect. Forward backward goes forward backward, Left right goes left right BUT up down goes down up…
Like when i turn off the hex using the remote it will go way up first and then shut down. I was working with a fella from tech support and he helped me getting it all running but because I didnt buy the servos from them he couldn’t help me any more.
So, I’m hoping there is someone here who might have run into this type of problem and be able to help. I’m using Solar 772 servos. Very strong and accurate servos and I like them alot.
I wouldn’t even care if all of the servos could be reversed. It would just walk in the other direction I assume but that would fix the down is up problem for me.

Hey,

That typically sounds like your servomotors for that joint are mounted backwards. As mentioned in the support, reversing their mounting (if possible) is probably the easiest solution for that one joint (x6, of course).

Well, it is not really related to your servomotors’ origin and more that the joint seems to move backwards because of the servomotors (either its internals or the way it is mounted). We did offer you ideas about the code to change, but this does require some work from you to actually try out and implement.

In the spirit of helpfulness, we did test the code recommendations that we made. Originally, we had given as an example to reverse the signal (in µs RC control pulse length) right before it is sent to the SSC-32U.
Since the signal is in the range of [500, 2500], it can be done with this: reversedPulse = (3000 - pulse)

Therefore, in the case of the hexapod code, you can make such a change in the phoenix_driver_ssc32.cpp between lines 202 (after the pulse is calculated) and 204 (but before it is used / sent off to the SSC-32U).

In the example we sent, we gave an example using wCoxaSSCV, but that is the horizontal motion. The vertical motion would be with the femur instead, wFemurSSCV.

Please find attached the modified file that inverts all vertical motion for each leg below.
Do not that we did not test this in an actual hexapod, but we did check the signal output on a servomotor on a femur channel and it does seem to now move in reverse compared to with the original code.

This should be enough to get you started with reversing the signal for that joint only.

Sincerely,
phoenix_driver_ssc32.cpp (19.1 KB)

THANK YOU for your reply and time! That did reverse all of the servos but I was thinking that it would just walk in the other direction if all servos where reversed however now slide left is now slide right, and rotate left is rotate right…
I just replaced the file you attached and it worked as you said. Is there maybe a way to only reverse the one DOF?

In theory the code there only changes the direction of the femur joints, nothing else. Therefore, that should only have an impact on 6 servomotors.
Check around lines 200-210, that is where all the code related to calculating each leg’s joint pulse length is done and then sent to the SSC-32U.

Yes, I see what you did there by adding the // Invert the femur angle (in µs RC control signal pulse length) wFemurSSCV = constrain(wFemurSSCV, 500, 2500); wFemurSSCV = (3000 - wFemurSSCV);
but it has reversed all joints direction. Forward walks backward now etc. Weird how reversing all when the only change was to wFemurSSCV… I dont get it.

Indeed. Not much to say here other than it shouldn’t. I’ll have another look at a later time.

That would be great! So strange. Thank you.

Its been a while now and im really hoping someone can maybe help me to get this changing of one DOF direction thing solved. I’ve got quite a bit of money tied up in this project and it kinda hurts to see it just sit there… Hoping someone can help as I am unable to do programming…