What is the proper start position for the Sted-E-Man walker to prevent damage?

  • Thread starter wolram
  • Start date
  • Tags
    Code
In summary, the Sted-E-Man needs a strat sequence to set the legs in the correct position. Unless the servo positions are known, the feet could clash on first start-up or reset and cause damage to the walker.
  • #1
wolram
Gold Member
Dearly Missed
4,446
558
Please can anyone see an error.

'##############################################################################
'Start Position: The Sted-E-Man needs a strat sequence to set the legs in the
'correct position. Unless the servo positions are known, the feet could clash
'on first start-up or reset and cause damage to the walker.
'##############################################################################

Dim Left_Hip As New oServo 'Left hip servo set
Dim Right_Hip As New oServo 'Right hip servo set
Dim Right_Foot As New oServo 'Right foot servo set
Dim Left_Foot As New oServo 'Left foot servo set
'******************************************************************************

Sub Main()
'###############################################################
'This is the first routine that is entered on start up or reset.
'###############################################################
Left_Hip.IOLine = 14 'Left Hip servo IOLine
Left_Hip.Center = 27 'Center position
Left_Hip.Operate = CVTrue 'Servo object turns on

Right_Hip.IOLine = 12 'Right Hip servo IOLine
Right_Hip.Center = 27 'Center position
Right_Hip.Operate = CVTrue 'Servo object turns on

Right_Foot.IOLine = 10 'Right foot servo IOLine
Right_Foot.Center = 30 'Center position
Right_Foot.Operate = CVTrue 'Servo object turns on

Left_Foot.IOLine = 8 'Left foot servo IOLine
Left_Foot.Center = 28 'Center position
'Left_Foot.Operate = CVTrue 'Servo oject turns onCall Start_Pos 'Call the start position for all servos
oopic.delay = 300 '3 second delay for Sted-E-Man positioning
End Sub
'******************************************************************************

Sub Start_Pos()
'################################################################
'A routine to set the start position is needed otherwise the
'Sted-E-Man's feet could clash damaging the robot.
'################################################################
Right_Foot.Value = 0 'Move Right Foot outwards full
oopic.delay = 200 '2 second delay
Left_Foot.Operate = CVTrue 'Servo oject turns on
Left_Foot.value = 56 'Move Left Foot outwards full
oopic.delay = 200 '2 second delay
Left_Hip.Value = 27 'Move the Hip servos to start
oopic.delay = 200 '2 second delay
Right_hip.Value = 10 'position
oopic.delay = 200 '2 second delay

'Right_Foot.Value = 30 'Move Right foot to start position
'Left_Foot.Value = 28 'Move left foot to start position

End Sub
'**************************************************************
 
Technology news on Phys.org
  • #2
wolram said:
Please can anyone see an error.
I see an error, but not in the code.:uhh:
Perhaps you could tell us where it's going awry. Any error messages you'd care to share?
 
  • #3
I see an error... but I will bite my toung, it has nothing to do with the code.
 
  • #4
Just shooting in the dark until I get more info:

In your Start_Pos, you set Left_Foot.Operate , but I don't see any .Operate sets for any other servos.
 
  • #5
DaveC426913 said:
I see an error, but not in the code.:uhh:
Perhaps you could tell us where it's going awry. Any error messages you'd care to share?

This code is supposed to activate 4 servoes to a start possition, but they just
go crazy, there are no error messages.
the servoes work ok independantly, this from another set up code used to find
center values that are then transferred into this one.
 
  • #6
OK, strip it down to the bare bones.
Get one servo making one move.
Get another servo making a move.
Throw away everything else until you have a maximum of two movements coordinated.

Question: the time units you are using: you sure they are 100ths of a second? If they are 1000ths of a second, then each of your delays are only fractions of a second.
 
  • #7
DaveC426913 said:
OK, strip it down to the bare bones.
Get one servo making one move.
Get another servo making a move.
Throw away everything else until you have a maximum of two movements coordinated.
Question: the time units you are using: you sure they are 100ths of a second? If they are 1000ths of a second, then each of your delays are only fractions of a second.
Thanks for the help Dave, i can get 2 servoes to work, left foot,left hip as they
should, and the same for right foot, hip, it is only when i try to get all 4 to work
together, the delays are seconds.
this is the latest code i tried.

Sub Start_Pos()
'################################################################
'A routine to set the start position is needed otherwise the
'Sted-E-Man's feet could clash damaging the robot.
'################################################################
Right_Foot.Value = 0 'Move Right Foot outwards full
Left_Foot.value = 56 'Move Left Foot outwards full
oopic.delay = 50 'small 0.5 second delay
Left_Hip.Value = 27 'Move the Hip servos to start
Right_hip.Value = 10 'position
oopic.delay = 100 '1 second delay

'Right_Foot.Value = 30 'Move Right foot to start position
'Left_Foot.Value = 28 'Move left foot to start position

End Sub
 
  • #8
Set your delays to, like, 5 seconds. Give your eyes & brain time to watch the action and see what it's doing. (eg. Is it really going randomly haywire? Or is it just one move that's out of place? What is the first move that is not as it should be?)
 
  • #9
DaveC426913 said:
Set your delays to, like, 5 seconds. Give your eyes & brain time to watch the action and see what it's doing. (eg. Is it really going randomly haywire? Or is it just one move that's out of place? What is the first move that is not as it should be?)

It seems random, the servoes do not complete a full movement and the right
hip moves at the same time as the left, it is difficult to to fault find, as any
clashes can damage the gears in the servoes, so i have switch it off quick.
I have changed the output IO lines, thinking it could be a hardwear problem
but it is the same, i have cleared the EPROM and stated from scratch with
no joy.
 
  • #10
wolram said:
Please can anyone see an error.

'##############################################################################
'Start Position: The Sted-E-Man needs a strat sequence to set the legs in the
'correct position. Unless the servo positions are known, the feet could clash
'on first start-up or reset and cause damage to the walker.
'##############################################################################

Dim Left_Hip As New oServo 'Left hip servo set
Dim Right_Hip As New oServo 'Right hip servo set
Dim Right_Foot As New oServo 'Right foot servo set
Dim Left_Foot As New oServo 'Left foot servo set
'******************************************************************************

Sub Main()
'###############################################################
'This is the first routine that is entered on start up or reset.
'###############################################################
Left_Hip.IOLine = 14 'Left Hip servo IOLine
Left_Hip.Center = 27 'Center position
Left_Hip.Operate = CVTrue 'Servo object turns on

Right_Hip.IOLine = 12 'Right Hip servo IOLine
Right_Hip.Center = 27 'Center position
Right_Hip.Operate = CVTrue 'Servo object turns on

Right_Foot.IOLine = 10 'Right foot servo IOLine
Right_Foot.Center = 30 'Center position
Right_Foot.Operate = CVTrue 'Servo object turns on

Left_Foot.IOLine = 8 'Left foot servo IOLine
Left_Foot.Center = 28 'Center position
'Left_Foot.Operate = CVTrue 'Servo oject turns on


Call Start_Pos 'Call the start position for all servos
oopic.delay = 300 '3 second delay for Sted-E-Man positioning
End Sub
'******************************************************************************

Sub Start_Pos()
'################################################################
'A routine to set the start position is needed otherwise the
'Sted-E-Man's feet could clash damaging the robot.
'################################################################
Right_Foot.Value = 0 'Move Right Foot outwards full
oopic.delay = 200 '2 second delay
Left_Foot.Operate = CVTrue 'Servo oject turns on
Left_Foot.value = 56 'Move Left Foot outwards full
oopic.delay = 200 '2 second delay
Left_Hip.Value = 27 'Move the Hip servos to start
oopic.delay = 200 '2 second delay
Right_hip.Value = 10 'position
oopic.delay = 200 '2 second delay

'Right_Foot.Value = 30 'Move Right foot to start position
'Left_Foot.Value = 28 'Move left foot to start position

End Sub
'**************************************************************

You don't show the code for "servos" or "man positioning"

but in the last sub start_position you set Right_foot.value 2 times? you cannot set the variable more than ONE time!

Code runs a million billlion zillion lines per second, but a motor is very slow by comparison. One has 'value' with uppercase another with lowercase. in basic it should be okay? but its a dangerous habit.

Start by setting the items only one time. You may want to initialize each component one by one, checking limit switches slowly and if they don't work, throw an error which turns every motor off.

An init routine will take time to make/debug but start there
 
  • #11
Thankyou brad, i will work through it moer carefully.
 

1. What is the purpose of this code?

The purpose of this code may vary depending on the specific context. It is important to carefully analyze the code and its components to determine its intended purpose.

2. Why is this code not working as expected?

There could be several reasons why the code is not functioning correctly. Some possible reasons include syntax errors, logical errors, or incorrect implementation of the intended logic.

3. How can I fix this code?

To fix the code, it is important to carefully debug and identify the source of the issue. This may involve reviewing documentation, seeking help from others, or experimenting with different solutions.

4. Can you explain what this line of code does?

It is always helpful to provide a clear and thorough explanation of each line of code to better understand its purpose and functionality. Sometimes, a line of code may be the source of the issue and understanding it better can help with finding a solution.

5. Is this code following best practices?

It is important to evaluate the code based on best practices and coding standards. This can help improve the overall quality and readability of the code, and prevent future issues.

Similar threads

  • General Discussion
Replies
1
Views
8K
Back
Top