Slide 1

Slide 1 text

Rollicking)Ruby) Robot)Rules)the) World) Chang)Sau)Sheong) Xu)Shipeng) June)2015)

Slide 2

Slide 2 text

About)Sau)Sheong)

Slide 3

Slide 3 text

About)Shipeng)

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

eBay)to)the)rescue)

Slide 6

Slide 6 text

torobot)

Slide 7

Slide 7 text

LynxmoCon)Pheonix)

Slide 8

Slide 8 text

Compare) ~US$173.00* US$793.00* Body)+)servos)(no)electronics))

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

TowerPro)MG)995)metal)gear)servo) US$6.00)x)18)

Slide 11

Slide 11 text

MG995 High Speed Metal Gear Dual Ball Bearing Servo The unit comes complete with 30cm wire and 3 pin 'S' type female header connector that fits most receivers, including Futaba, JR, GWS, Cirrus, Blue Bird, Blue Arrow, Corona, Berg, Spektrum and Hitec. This high-speed standard servo can rotate approximately 120 degrees (60 in each direction). You can use any servo code, hardware or library to control these servos, so it's great for beginners who want to make stuff move without building a motor controller with feedback & gear box, especially since it will fit in small places. The MG995 Metal Gear Servo also OperaCng)temperature)range:)U20)to)60)deg)C) Stall)torque:)11)kgcm) Current)drain:)450mA)(no)load),)1)–)2A)(normal)load)) )

Slide 12

Slide 12 text

32Uchannel)servo)controller) US$28.00) Power)for) servo) controller) Power)for) servos) TX)and)RX) Output) to)servos)

Slide 13

Slide 13 text

USB)powerpack)(5V,)~800mAh))) to)power)the)servo)controller) freebie)

Slide 14

Slide 14 text

4)x)AA)alkaline)ba^eries)) to)power)the)servos) ~US$2.00)

Slide 15

Slide 15 text

4)x)1.5v)=)6v) 1500mAh)

Slide 16

Slide 16 text

3)x)1500mAh)=)4500mAh)

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

3)degrees)of) freedom)(DOF))=)3) servos)per)leg)

Slide 19

Slide 19 text

Insect)leg)segment)

Slide 20

Slide 20 text

Coxa)(and)femur))

Slide 21

Slide 21 text

Femur)

Slide 22

Slide 22 text

Tibia)

Slide 23

Slide 23 text

Assembling)the)legs) Cbia) coxa) femur)

Slide 24

Slide 24 text

Servo)connector)

Slide 25

Slide 25 text

Leg)+)servo)controller)

Slide 26

Slide 26 text

Raspberry)Pi)v2) US$35.00)

Slide 27

Slide 27 text

Raspberry)PI)GPIO)

Slide 28

Slide 28 text

Edimax)ewU7811un)USB)WiFi)adapter) US$9.00)

Slide 29

Slide 29 text

Rpi)+)leg)+)servo)controller)

Slide 30

Slide 30 text

Pueng)things)together)

Slide 31

Slide 31 text

Almost)there!)

Slide 32

Slide 32 text

Fully)assembled)hexapod)v1)

Slide 33

Slide 33 text

A)bot)is)born) h^ps://youtu.be/Xabg9inUGb8) )

Slide 34

Slide 34 text

Baby)steps) h^ps://youtu.be/eADasWsgM5s) )

Slide 35

Slide 35 text

Not)enough) power!)

Slide 36

Slide 36 text

450mA)when)no)load) )1)–)2A)under)normal)load) 12)servos)x)1.5A)=)18)A) 6)servos)x)0.45A)=)2.7)A) Total)=)~21A)

Slide 37

Slide 37 text

450mA)when)no)load) )1)–)2A)under)normal)load) Power)required)=)6V)x)21A)) )))))))))))))))))))))))=)126W)

Slide 38

Slide 38 text

Power)in)4)x)AA)ba^ery)pack) Current) Voltage)

Slide 39

Slide 39 text

3.83A)x)1.83V)=)~7W) ✗) Power)in)3)packs)) =)3)x)7W) =)21W)

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

3Ucell)LiPo)7.4V)1600mAh)ba^ery)

Slide 42

Slide 42 text

1600mAh)x)20C)=)32A) Power)=)32A)x)7.4v) =)~237W)✔)

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

Some))fancy)soldering)

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

11.1v)>)7.2v)max) operaCng)range)) (of)servo))

Slide 48

Slide 48 text

8)servos)burnt)to) crisp)

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

Voltage)regulator)and)switch) More) fancy) soldering)

Slide 51

Slide 51 text

Raspberry)Pi)v2)

Slide 52

Slide 52 text

No content

Slide 53

Slide 53 text

JYUMCU)Bluetooth)Adapter)

Slide 54

Slide 54 text

Bluetooth)serial)communicaCons)to) servo)controller)

Slide 55

Slide 55 text

No content

Slide 56

Slide 56 text

Hexapod)v2)marching)to)success!) h^ps://youtu.be/7fVUS1tMKM8) )

Slide 57

Slide 57 text

Hexapod)v3)tweaking)

Slide 58

Slide 58 text

Padded)feet)

Slide 59

Slide 59 text

Building)a)case)

Slide 60

Slide 60 text

v3)at)rest)

Slide 61

Slide 61 text

v3)stretching)its)legs)

Slide 62

Slide 62 text

v3)ready)to)go!)

Slide 63

Slide 63 text

Hello)world!) h^ps://youtu.be/xJRx2cjrmSY) )

Slide 64

Slide 64 text

No content

Slide 65

Slide 65 text

Controlling)the)hexapod) Bluetooth)serial) port)commands)

Slide 66

Slide 66 text

#1P1500T100\r\n) Servo)channel) RotaCon)(500)–)2500)) Speed)(100)–)9999)) Controlling)1)servo)

Slide 67

Slide 67 text

#1P1500#2P800#3P1950T100\r\n) Controlling)1)leg)(3)servos)) Servo)1) Servo)3) Servo)2)

Slide 68

Slide 68 text

Bots) A)simple)library)for) controlling)robots)) h^ps://github.com/sausheong/bots)

Slide 69

Slide 69 text

Models)the)servo) class Servo def initialize(n) @number = n end def rotate(deg) points = (2000 * deg.to_f/180) + 500 "##{@number}P#{points.to_i}" end end

Slide 70

Slide 70 text

Models)a)3DOF)leg) class Leg3DOF def initialize(side, coxa, femur, tibia) @side = side @coxa = Servo.new coxa @femur = Servo.new femur @tibia = Servo.new tibia end # rotate the servos accordingly def actuate(c, f, t) c, f, t = *convert(c, f, t) return @coxa.rotate(c) + @femur.rotate(f) + @tibia.rotate(t) end

Slide 71

Slide 71 text

Models)a)3DOF)leg) # if the leg is on the left side of body, flip def convert(c, f, t) if @side == :right return [c, f, t] elsif @side == :left return [c, f, t].map {|deg| 180 - deg} end end end

Slide 72

Slide 72 text

No content

Slide 73

Slide 73 text

hexapodUsim) A))physics)simulator)for) hexapods) h^ps://github.com/billhsu/hexapodUsim)

Slide 74

Slide 74 text

How)to)build)hexapodUsim) #1P1500#2P800T100\r\n) Servo) controller) commands) TCP)port))5555) Update)

Slide 75

Slide 75 text

Hexapod)class) class HexapodRig { btDynamicsWorld* world; btCollisionShape* shapes[BODYPART_COUNT]; btRigidBody* bodies[BODYPART_COUNT]; btTypedConstraint* joints[JOINT_COUNT]; }

Slide 76

Slide 76 text

Create)the)shapes) // Body shapes[0] = new btBoxShape(btVector3(0.4,0.1,0.6)); for (int i=0; i

Slide 77

Slide 77 text

Create)the)rigid)bodies) btVector3 vBoneOrigin; // rigid body position vBoneOrigin = btVector3(-0.5 - fLegLength / 2, fHeight, (i-1)*0.6); transform.setIdentity(); transform.setOrigin(vBoneOrigin); // rotation transform.setRotation(btQuaternion(btVector3(0,0,1), M_PI_2)); bodies[1+3*i] = localCreateRigidBody( btScalar(0.01), // mass offset*transform, // transform matrix shapes[1+3*i]); // bind a shape

Slide 78

Slide 78 text

Add)constraints) Image)from)h^p://www.societyofrobots.com/roboporum/index.php?topic=10469.0)

Slide 79

Slide 79 text

Hinge)constraint) Image)from)h^p://ode.org/odeUlatestUuserguide.html)

Slide 80

Slide 80 text

Add)hinge)constraints) localA = btTransform(vQ, vBoneOrigin); localB = bodies[3+3*i]->getWorldTransform().inverse() * bodies[0]->getWorldTransform() * localA; hingeC = new btHingeConstraint(*bodies[0], *bodies[3+3*i], localA, localB); joints[2+3*i] = hingeC; hingeC->enableMotor(true); hingeC->setLimit(-M_PI_6,M_PI_6); hingeC->setMaxMotorImpulse(1000); world->addConstraint(joints[2+3*i], true);

Slide 81

Slide 81 text

All)together)now)

Slide 82

Slide 82 text

Ant)walking)with)tripod)gait) h^ps://youtu.be/ysCow9Wc4cs) )

Slide 83

Slide 83 text

6Ulegged)tripod)gait)

Slide 84

Slide 84 text

) h^ps://github.com/sausheong/bots/blob/master/hex.rb)

Slide 85

Slide 85 text

Simulator)demo) h^ps://youtu.be/nNom1KyaSGU) )

Slide 86

Slide 86 text

We’ve)only) just)begun)

Slide 87

Slide 87 text

Not)giving)up)

Slide 88

Slide 88 text

Be^er)servos) HS-645MG* HS-485HB*

Slide 89

Slide 89 text

Sensors)

Slide 90

Slide 90 text

Bipeds)

Slide 91

Slide 91 text

Strider)) the)Cardboard) Quadraped)

Slide 92

Slide 92 text

No content

Slide 93

Slide 93 text

CardBob) the)Biped)Robot)

Slide 94

Slide 94 text

Recycled)cardboard)

Slide 95

Slide 95 text

Legs)structure)

Slide 96

Slide 96 text

Foot)servo)

Slide 97

Slide 97 text

Foot)and)thigh)servos)

Slide 98

Slide 98 text

Legs)

Slide 99

Slide 99 text

Legs)a^ached)to)the)body)

Slide 100

Slide 100 text

Lower)body)

Slide 101

Slide 101 text

CardBob)the)Biped)Robot)

Slide 102

Slide 102 text

CardBob)first)steps!) h^ps://youtu.be/9f3bm3mFsYA) )

Slide 103

Slide 103 text

Other)Ruby)robot)libraries) •  Argus)U)h^ps://github.com/jimweirich/argus) •  Artoo)U)h^p://artoo.io/)

Slide 104

Slide 104 text

Thank)you!) [email protected]) [email protected])) @sausheong) @1991bill)