collapse

Welcome!



Welcome to Robot Rebels, an online robot maker community.

Register today to post your projects, ask questions, share knowledge and meet like-minded people from around the world.


The RobotRebel.org Community

Author Topic: Meowth Abandoned  (Read 513 times)

BaldwinK

  • Member
  • ****
  • B
  • Posts: 20
Meowth Abandoned
« on: April 10, 2019, 06:35:48 AM »
As we are supposed to learn from our mistakes I have written up one of my failures.

The project was to build a bot, as cat like as possible, to sit and wave a paw, stand up and walk around.

Meowth LP.jpg
*Meowth LP.jpg (83.9 kB . 796x442 - viewed 87 times)

The activity started more than three years ago with an attempt to copy Boston Dynamics’ quadruped - Spot.  Believing the quoted torque values was the first mistake as the 55g servos could barely lift their own weight. The leg modules were later re-used for HybridTrotter and Scooter Boy where they provided the drive but the weight was carried on wheels.

Using a Picaxe micro, Hybrid Trotter was posted on their forum and the video shows a disinterested Meowth idly watching. A spirited American Ragdoll, he didn't live to see his namesake in action.


Much of my learning progress is posted in the Tutorial section. Firstly improving on the MG 995/996R servo performance and squeezing it into the legs. The fixing lugs were cut off and the electronics replaced by an Arduino Nano plus drive circuitry allowing all the motors to run directly from a 3S Li-Po supply.

Distributing the processing between a master and four slaves using an I2C bus required fast routines and short data packets. All processes had to be sync’d to a 15mS cycle time for the sixteen PIDs. Once again the MPU-6050 showed a disregard for protocol and had to be driven separately.

Three modes allowed for setpoint angles to be sent for direct action, or indirectly reached after delta time cycles. Inverse Kinematic values were converted into setpoint angles by sending x,y & w coords of the toes.

Sitting postures were held in lookup tables in the master and sent for indirect action. This proved harder than expected because of balance issues. Try standing up from a chair without moving your weight forward first.

Later development became too complicated and a PLX-DAQ mimic display was a great help.

It sometimes can happen that all four legs step correctly but, not wishing to scratch the table, the clip shows only two legs in action. This is stalking mode for a cat - a creep forward with only one leg lifted at a time.


Balance

This is always the main challenge when working with limited motor torque, thicker than real life limbs and limited sensors. Working with 2mm 4-ply is not the only reason the result can appear ‘wooden’.

Once you start using IK values and forget about individual angles, other techniques become simpler. If the bot were to step down onto a hump or into a depression, the riding height at hip or shoulder would need to change for the rest of the gait cycle. Just add a few milimeters to IKy to lower it, or subtract a bit to raise it.

On a flat table surely that won’t be necessary? Consider the leg construction: four motors are joined in line so that the bot is narrow at the hips. Like elephants hanging onto the output shaft of the one in front. Output shafts with end play and gearbox slop. Calculating trig functions to a fraction of a degree and millimetre is fine in theory but in practice the IK coords will end up somewhere near a centimeter circle on a good day.

So balance can’t be predicted because the feet will land in different positions each cycle. The MPU will report Pitch and Roll but the bot has four legs. You might spot in the video the bot straightening up just before lifting a leg. But the MPU cannot indicate where the centre of mass is before it moves. If we’re lucky the error might be recoverable by changing leg lengths on the fly. Or the bot might have been level on three legs and suddenly the most important one is too short and the bot must fall.

So the next creation must have a load cell for each leg to determine CoM before committing to stepping. Moving the balance point still requires flexibilty, mostly to move to the side. The design (which makes for a narrow body that can sit) has the lateral motors set a 40 degrees to the horizontal. Very tricky 3D IK and producing a non-linear roll/rotation. In practice the square foot profile provides more lateral stability than an active motor.


The MPU can derive a ‘falling vector’, different for each leg, that is sensitive enough to trigger an emergency foot down process. Here the motors can step wide quickly and stop a crash. A couple of retries are permitted where the leg straightens and lifts to the last postion before continuing. Each time the bot is tilted further over  to help. Again this is only guesswork without load cells.

Software is now working like a cars suspension to allow IKy coords to drift, within limits, from the theoretical. Placing a foot down is problematical anyway. Too heavily and the shock can tip the bot and upset the next cycle, too softly and the weight distribution may be wrong. Experimenting with a simple microswitch foot sensor did not obviously help. The slave loses a cycle to get the info to the master leaving little time to act. The next creation will need a shock absorbing toe and well designed sensor directly connected to the master.

Tilt Plane

We can derive from Pitch and Roll the amount by which each leg needs to change. This can be referenced to the next leg to lift. These corrections can be applied immediately as a feedback signal but the result is too lively. With four legs grounded the bot bucks and rears much like an animal but will eventually overshoot and topple. With the support body being nearly four times longer than the width, Pitch is dominant.

However, if a snapshot of Pitch and Roll is applied slowly, then the bot will settle into a level pose. Pitch is -1 degree and Roll is +1 degree in the graph referenced to HL.

Tilt.jpg
*Tilt.jpg (3.37 kB . 295x223 - viewed 86 times)

  Poff = 220 * sin(degpos[1]/57.296);
  Roff = 60 * sin(degpos[0]/57.296);

  //snapshot tilt plane values to make level 
  FLbal = -Poff;
  HRbal = Roff + 2;           //then add extra tilt
  FRbal = -Poff + Roff + 2; 
  HLbal = HLbase;     
  balTest ();                 //keep bases within limits

Stiction

Another issue causing intermittent toppling was my use of the classic PID code to control the motors.

We deal with static friction, or stiction, when driving a vehicle from rest. An extra touch on the gas pedal will ensure a smooth start and once rolling it will need less to run onwards. When controlling a wheeled bot we know that there will be a minimum voltage below which the motor will not turn.

Surely this must also affect a servo motor system. Tim Wescott in his blog puts the tricky maths around the problem. Since Tim has offered consultancy on this for 20 years it is unlikely there will be an easy answer.

Brett Beauregard wrote the library PID code and explains it well. However, it does assume a linear system - and a brushed electric motor with high ratio gearbox can be spectacularly non-linear.

MG996 with PID and PWM control can fail to move sometimes, like a joint with arthritis. Similarly Iterm makes no difference to performance.

I spent forever coding a State Machine form of PID controller. It failed the KISS test but clearly showed the problem. This bot still uses the classic PD code but the output is monitored and ‘kicked’ when it fails to move for a few cycles despite an error signal. Even stiction has a breaking point! The problem comes if it is pulsed too strongly as it has to be brought back under control by the next reversal. Iterm is now more a ‘nudge’ to move closer to the setpoint.

Conclusion

It is very hard to pull the plug on a long running project. So much time and effort invested, hopefully not all wasted. The next project is still to be decided but load cells must certainly be investigated.

Nemesis

  • Member
  • *
  • Posts: 44
    • Anim4bot
Re: Meowth Abandoned
« Reply #1 on: April 11, 2019, 11:08:00 AM »
Very good summary of your work and what you have been through... This reminded me as well some issue I have/had with Animabot.
I'm sure you learned a lot with this project and you will continue to do so.

But I'm sure this robot is not finished, in few weeks/months you will start designing a new one ! Look at me, the last 3 versions of Animabot were supposed to be the last :D

Keep up the good work !
« Last Edit: April 14, 2019, 03:06:05 AM by Nemesis »

 

* Search


* Recent Topics

Servo Calibrator by Bajdi
[May 24, 2019, 04:01:10 AM]


MKS Gen L 1.0 by Bappi
[May 21, 2019, 07:22:54 PM]


ESP32 "Life is Life" 64x32 flexible P4 RGB LED by jinx
[May 18, 2019, 11:19:44 AM]


Warco HV-4" Rotary Table by jinx
[May 08, 2019, 03:12:58 PM]


Warco WM14 milling machine by jinx
[April 28, 2019, 09:41:40 AM]


MKS GEN L Servo Issue by Reywas
[April 22, 2019, 09:10:08 PM]


Meowth Abandoned by Nemesis
[April 11, 2019, 11:08:00 AM]


Bench Power: Help a rebel out by jinx
[April 03, 2019, 04:20:10 AM]


Just a short intro... by MEgg
[March 18, 2019, 05:49:28 PM]


Yes I am alive! by jinx
[March 10, 2019, 04:38:53 AM]


CZ-1 2.0: problems, calibration and printing, part2 by MEgg
[February 26, 2019, 03:35:15 PM]


Hi, Mushroom glue here. by nschreiber0813
[February 25, 2019, 02:09:13 PM]


Arduino IK by BaldwinK
[February 25, 2019, 05:54:44 AM]


Raspberry Pi / Python eBook - free for the next 11 hours! by MEgg
[February 24, 2019, 09:49:43 AM]


Fun Fact by Impala
[February 13, 2019, 11:05:01 PM]

* Recent Posts

Re: Servo Calibrator by Bajdi
[May 24, 2019, 04:01:10 AM]


Re: Servo Calibrator by jinx
[May 22, 2019, 02:28:13 AM]


Re: MKS Gen L 1.0 by Bappi
[May 21, 2019, 07:22:54 PM]


Re: MKS Gen L 1.0 by jinx
[May 21, 2019, 03:27:08 PM]


Re: MKS Gen L 1.0 by Bappi
[May 21, 2019, 03:11:45 PM]


Servo Calibrator by BaldwinK
[May 21, 2019, 10:20:42 AM]


Re: MKS Gen L 1.0 by jinx
[May 21, 2019, 05:09:27 AM]


Re: MKS Gen L 1.0 by Bappi
[May 21, 2019, 03:34:54 AM]


Re: MKS Gen L 1.0 by jinx
[May 21, 2019, 02:28:17 AM]


Re: MKS Gen L 1.0 by Bappi
[May 20, 2019, 07:11:31 PM]


Re: MKS Gen L 1.0 by jinx
[May 20, 2019, 03:16:02 PM]


Re: MKS Gen L 1.0 by Bappi
[May 20, 2019, 02:53:00 PM]


Re: MKS Gen L 1.0 by jinx
[May 20, 2019, 03:31:49 AM]


Re: MKS Gen L 1.0 by Bappi
[May 19, 2019, 07:16:21 PM]


Re: MKS Gen L 1.0 by Bappi
[May 19, 2019, 04:04:47 PM]