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

  • Thread starter Thread starter wolram
  • Start date Start date
  • Tags Tags
    Code
AI Thread Summary
The discussion centers on troubleshooting a code issue for controlling servos in a robotic walker, the Sted-E-Man. The primary concern is that the servos do not operate correctly during startup, leading to potential damage from foot clashes. Key points include the need for a proper startup sequence to ensure servos are positioned correctly before activation. Participants suggest simplifying the code to isolate issues, emphasizing the importance of testing one servo at a time to confirm functionality. There is also a focus on ensuring that delay times are appropriate, as incorrect timing could lead to erratic movements. Additionally, there are concerns about the correct initialization of servo values and the potential for conflicting commands within the code. Overall, the conversation highlights the necessity of careful debugging and systematic testing to resolve the issues faced.
wolram
Gold Member
Dearly Missed
Messages
4,410
Reaction score
555
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
wolram said:
Please can anyone see an error.
I see an error, but not in the code.:rolleyes:
Perhaps you could tell us where it's going awry. Any error messages you'd care to share?
 
I see an error... but I will bite my toung, it has nothing to do with the code.
 
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.
 
DaveC426913 said:
I see an error, but not in the code.:rolleyes:
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.
 
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.
 
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
 
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?)
 
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.
 

Similar threads

Replies
1
Views
10K
Back
Top