I have the above setup and I have created the inverse kinematics function to turn x,y,z into the proper angles and pulses for the servos for each leg and have a basic alternating tripod gait going.
What I’d like to do is put a sensor on at least the front 2 legs (preferably all legs) and program a reflex so that as it is stepping down, the servos will stop when the sensor is triggered. It will probably be a simple switch to act as a ground sensor.
I am using the timer function in my SSC32 commands to sync the movement of the leg servos and keep movements smooth and I’d like to keep using the SSC’s built-in timing/sync. The problem is there is no command I can find that says, “Stop servo X at its current position.” So there doesn’t appear to be any way to stop the servos in a leg when the ground switch is triggered. Having this function on all 6 legs would allow the 'pod to walk over uneven ground without having legs flailing around. Any ideas?
There’s a clunky way to do this, and…well, I guess clunky is the only way right now.
To stop a servo at its current position, you can read the current position using the QP command, then send that position using a move command. Keep in mind that the QP command returns a binary value with 10us resolution and the move command expects an ASCII value with 1us resolution, so you will need to multiply by 10. Like I said, clunky.
This sounds like a good feature to add. Something like
"#1STOP#2STOP "
to stop servos 1 & 2 in place. I’ll look into what it would take to add this.
Yep it could be great Miked !
not only for reflex…but for ‘emergency stop’ feature too.
For now an emergency stop is sending “#0P0” for example, it stop to generate pulse and it disable torque with ‘standard’ servos
but it doesn’t work with digital servos !..because there’s no way to disable torque with them…so stoping 'em could be nice
When a leg hits an obstacle below and stops until the gait generation algo says it should be raised above that position again will result in it dragging if you have continuous forward motion of the chassis.
You need to change the gait position generation so that the foot moves at a constant depth but changing position relative to the chassis for the duration that it’s seated atop the obstacle.
Another thing to consider is that the floor will always look like an obstacle. Assuming that the timing on the trigger to the motion stopping is instantaneous the terrain you can cover has to stay within the height of the gait. An incline would have the bot trying to stay level and crashing the chassis into the ground once it’s climbed higher than it’s own stride height.
Not that I can speak from any authority other than having failed at trying to solve this problem without it, I think uneven terrain navigation requires a orientation sensor like an accelerometer in addition to ground sensors or some other way of approximating the orientation to gravity if only because of the culumative errors of the foot switches.
Ahh. I thought the QP command would tell me where the servo is set to go, not where it actually is at this moment. I’ll try that.
I realize there are problems with trying to cross uneven terrain, including plowing into a hill because you’re keeping the same absolute height while the ground is changing, but after watching video of a hex trying to walk across uneven terrain I thought this might at least help with letting the hex know when its feet are planted. Watching other pods flopping around and having feet waving in the air just looked bad.
Actually, the QP command does just tell you the last commanded position. There is no feedback from the servo to tell you where it is at any moment. You could calculate the position using the old position, speed commanded and time since the new position was commanded. I think knowing where the ground is would be more useful for determining how far to move the other legs. If you encounter a 2 inch ledge, like a step, you could tell the following legs to expect it and perhaps rise higher than normal to clear on the forward sweep. If you just stepped on a rock under 1 leg…but how would you know?
No the QP command tells you what pulse value the SSC-32 is sending to a servo at the time of the query. If the controller is moving a servo slowly you will get the exact position of the servo at the time (assuming the servo is not being prevented from reaching the commanded position by an obsticle.) It’s the old “local closed loop” thing.
We are working on legs with pressure and switch sensors built in. It’s coming…
If I send a QP command, I will get the pulse value at the time of query. AND if I want to stop the servo at that position, can I send a new servo position command with the new pulse value even before the previous command is completed?
** I’m having switches on each foot, so I want the foot to maintain it’s hold (keeping the body somewhat level) if there is an obstacle, while the gait continues.
When are the legs w/ pressure and switch sensor coming!??!