Reversing one DOF using botboarduino with scc32 & Solar772's - RobotShop Forum

Putting robotics at your service™

Free shipping on orders over $75

Reversing one DOF using botboarduino with scc32 & Solar772's

Print view Share :
Previous topicNext topic

Page 1 of 1 [ 7 posts ]

New ( offline )
Posts: 4
Posted: 2018-04-09 19:07 
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.


User avatar
Admin ( offline )
Posts: 1612
Posted: 2018-04-11 14:24 
Hey,

claytonc2001 wrote:
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.
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).

claytonc2001 wrote:
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.
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,


Attachment:
phoenix_driver_ssc32.cpp [19.05 KiB]
Downloaded 2 times

_________________
Sébastien Parent-Charette
Robotics Software Specialist

RobotShop inc.
Putting Robotics at your service!™
www.robotshop.com

Lynxmotion
Imagine it. Build it. Control it.™
http://www.Lynxmotion.com
New ( offline )
Posts: 4
Posted: 2018-04-11 18:51 
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?


User avatar
Admin ( offline )
Posts: 1612
Posted: 2018-04-11 19:53 
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.

_________________
Sébastien Parent-Charette
Robotics Software Specialist

RobotShop inc.
Putting Robotics at your service!™
www.robotshop.com

Lynxmotion
Imagine it. Build it. Control it.™
http://www.Lynxmotion.com


New ( offline )
Posts: 4
Posted: 2018-04-11 20:46 
Yes, I see what you did there by adding the
Code:
    // 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.


User avatar
Admin ( offline )
Posts: 1612
Posted: 2018-04-17 16:19 
Indeed. Not much to say here other than it shouldn't. I'll have another look at a later time.

_________________
Sébastien Parent-Charette
Robotics Software Specialist

RobotShop inc.
Putting Robotics at your service!™
www.robotshop.com

Lynxmotion
Imagine it. Build it. Control it.™
http://www.Lynxmotion.com


New ( offline )
Posts: 4
Posted: 2018-04-17 16:26 
That would be great! So strange. Thank you.


 

All times are UTC - 5 hours [ DST ]. It is currently 2018-04-24 17:14