VB.NET Project for SSC-32 Hex Control

Post code examples here

Re: VB.NET Project for SSC-32 Hex Control

Postby FlowbotX » Thu Nov 06, 2008 5:01 am

Visual Basic 2008
~Flowbot~

"But who can decide what they dream?..and dream I do." - Amy Lee
FlowbotX
 
Posts: 59
Joined: Sat Sep 20, 2008 7:28 pm
Location: New York, USA

Re: VB.NET Project for SSC-32 Hex Control

Postby Matt Denton » Thu Nov 06, 2008 7:51 am

I have added the zip file to the first post in this thread.
Matt Denton
AKA: Winchy_Matt

micromagic systems ltd
Matt Denton
Site Admin
 
Posts: 1622
Joined: Tue May 20, 2008 9:15 pm
Location: Winchester UK

Re: VB.NET Project for SSC-32 Hex Control

Postby No1_sonuk » Thu Nov 06, 2008 10:15 pm

Well, it kind of worked.

I think my femur servos might run "backwards" WRT the Hitecs. :?

e.g. when I hit "sleep", the legs extend under the robot - looks like a six-legged ballet dancer!

Now, to use the SSC-32's built-in hex engine, I needed to reverse the vertical servo numbers. Horizontal is OK - I'm using HS-225BBs.

I remapped the servos in the code to match my setup. Is there an option to reverse the servos, or what do I need to change in the code?

**EDIT**
My Tibia servos are going the right way (clockwise with increase in pulse length), but the femur ones are going the opposite way - Damn odd considering they're the same model servo... :?
I checked the actual pulse length and it's right too, so it's not like the SSC-32 is reversing it.
No1_sonuk
 
Posts: 123
Joined: Sat Aug 09, 2008 9:05 pm
Location: UK

Re: VB.NET Project for SSC-32 Hex Control

Postby FlowbotX » Fri Nov 07, 2008 6:31 pm

No1_sonuk wrote:Well, it kind of worked.

I think my femur servos might run "backwards" WRT the Hitecs. :?

e.g. when I hit "sleep", the legs extend under the robot - looks like a six-legged ballet dancer!

Now, to use the SSC-32's built-in hex engine, I needed to reverse the vertical servo numbers. Horizontal is OK - I'm using HS-225BBs.

I remapped the servos in the code to match my setup. Is there an option to reverse the servos, or what do I need to change in the code?

**EDIT**
My Tibia servos are going the right way (clockwise with increase in pulse length), but the femur ones are going the opposite way - Damn odd considering they're the same model servo... :?
I checked the actual pulse length and it's right too, so it's not like the SSC-32 is reversing it.


You said you matched the servo pins to your setup...make sure you set it up for the robot's right and robot's left

I am 99% sure that you just have the servo pin-outs flipped! I installed my SSC32 backwards in my MSR-01 because I wanted the serial port toward the rear. You just need to match up all the servo pinout correctly. That is the reason everything is going down instead of up when you sleep! The angles for the right and left sides will be the inverse of each other because the servos are oriented oppositely. I don't think you need to mess with the code! Just flip/redo the pinouts.

Let me know if it works. If the pinout really isn't the problem and your servos actually take opposite pulse widths...that should be relatively easy to correct.
~Flowbot~

"But who can decide what they dream?..and dream I do." - Amy Lee
FlowbotX
 
Posts: 59
Joined: Sat Sep 20, 2008 7:28 pm
Location: New York, USA

Re: VB.NET Project for SSC-32 Hex Control

Postby No1_sonuk » Fri Nov 07, 2008 9:36 pm

I just double-checked with a separate pulse generator and pulse length timer, and cleared up one of the puzzling things:

BOTH femur and tibia (not just the femur) rotate anti-clockwise with an increase in pulse length. They're Cirrus CS601BBs.
The coxa servo (HS-225BB) rotates clockwise with an increase in pulse length.

I too have the SSC-32 with the serial connector at the back, but I made sure to wire the coxa and femur servos correctly to match the SSC-32's 12-servo hex sequencer, then fitted the tibia servos in higher sockets.
Having reversed the limits in Lynxterm, my hex walks properly (albiet with the tibia servos holding on a midpoint) with the SSC-32's sequencer, so they're not in the wrong place.

I just tested Futaba s148 and s3003 servos, and they both go the same way as the CS601BBs.

The Hitec servo manual says:
"All Hitec servos turn Clockwise direction ( CW )."

The S3003 data says:
"Counter Clockwise/Pulse Traveling 1520-1900usec"

Info on the ServoCity web site says:
"Futaba and Hitec are different from one another in regards to direction of rotation right out of the box. If you plug in a Hitec servo into your radio control receiver or servo controller and you tell the servo to turn to the right, it will move to the right, if you then plug a Futaba servo into the same receiver or servo controller and tell it to go the same direction as the Hitec servo did, it will move the opposite direction."

I could open up all 12 and turn the motors around, but I'd rather not go that far, so it would appear I need a 12-servo reverser... Perhaps this could be an option in your hardware setup - individual reversers.
No1_sonuk
 
Posts: 123
Joined: Sat Aug 09, 2008 9:05 pm
Location: UK

Re: VB.NET Project for SSC-32 Hex Control

Postby No1_sonuk » Fri Nov 07, 2008 11:15 pm

BTW, servo reversing is easy in a micro -
Assuming 500 to 2500 usec pulses, subtract the "forward" time in usec from 3000. The result is the new, reversed, value.
No1_sonuk
 
Posts: 123
Joined: Sat Aug 09, 2008 9:05 pm
Location: UK

Re: VB.NET Project for SSC-32 Hex Control

Postby FlowbotX » Sat Nov 08, 2008 7:14 pm

No1_sonuk wrote:BTW, servo reversing is easy in a micro -
Assuming 500 to 2500 usec pulses, subtract the "forward" time in usec from 3000. The result is the new, reversed, value.


O.k. In that case, you just need to go into the function named "servo driver" and remove the negative sign in front of the all the angles in the lines:

Math.Round((-RFFemurAngle + 90) / 0.10588238) + 650
and

Math.Round((-RFTibiaAngle + 90) / 0.10588238) + 650

so they look like

Math.Round((RFFemurAngle + 90) / 0.10588238) + 650

for all 6 of the femur and tibia lines to reflect the oposite pulse width. Cheers.
~Flowbot~

"But who can decide what they dream?..and dream I do." - Amy Lee
FlowbotX
 
Posts: 59
Joined: Sat Sep 20, 2008 7:28 pm
Location: New York, USA

Re: VB.NET Project for SSC-32 Hex Control

Postby No1_sonuk » Sat Nov 08, 2008 7:57 pm

:D
That did the trick. Works OK now.
No1_sonuk
 
Posts: 123
Joined: Sat Aug 09, 2008 9:05 pm
Location: UK

Re: VB.NET Project for SSC-32 Hex Control

Postby Tony » Wed Nov 12, 2008 3:42 am

this is great work! i am going to test it now. will report results later. :lol:
Tony
 
Posts: 98
Joined: Fri Jun 06, 2008 7:30 am

Re: VB.NET Project for SSC-32 Hex Control

Postby Tony » Wed Nov 12, 2008 3:48 am

when i open Hex Control App SSC32v1.0beta.vbproj, there is an error message shown on the screen:

d:\XXXXXXXXXXX The
> imported project "D:\Microsoft.VisualBasic.targets" was not found.
> Confirm that the path in the <Import> declaration is correct, and that
the file exists on disk.


I use VS2005, XP. shall I put the code into a specific folder?

-----------------------------------

I guess i need download framework 2.0, I throught i have but seems not. :|
Tony
 
Posts: 98
Joined: Fri Jun 06, 2008 7:30 am

PreviousNext

Return to Code Examples

Who is online

Users browsing this forum: No registered users and 1 guest

cron