Decentralized Control of a Hexapod Robot Using a Wireless ...

5
Decentralized Control of a Hexapod Robot Using a Wireless Time Synchronized Network James Fang, Dinesh Parimi, Arjun Dhindsa, Craig B. Schindler, and Kristofer S. J. Pister Berkeley Sensor & Actuator Center Department of Electrical Engineering and Computer Sciences University of California, Berkeley Berkeley, California, USA Email: {jamesfang, dineshp, arjun.dhindsa, craig.schindler, ksjp}@berkeley.edu Abstract—Robots and control systems rely upon precise timing of sensors and actuators in order to operate intelligently. We present a functioning hexapod robot that walks with a dual tripod gait; each tripod is actuated using its own local controller running on a separate wireless node. We compare and report the results of operating the robot using two different decentralized control schemes. With the first scheme, each controller relies on its own local clock to generate control signals for the tripod it controls. With the second scheme, each controller relies on a variable that is local to itself but that is necessarily the same across controllers as a by-product of their host nodes being part of a time synchronized IEEE802.15.4e network. The gait synchronization error (time difference between what both controllers believe is the start of the gait period) grows linearly when the controllers use their local clocks, but remains bounded to within 112 microseconds when the controllers use their nodes’ time synchronized local variable. I. I NTRODUCTION Control systems can be fully centralized, fully decen- tralized, or a combination of both. In a centralized control system, all of the information about the system as well as the calculations based on that information take place at a single location. In a decentralized system, the information about the system as well as the calculations about that information take place at multiple locations [1]. Decentralized control is desirable for a multitude of rea- sons. Firstly, by modularizing a robotic system, lengthy control wires running from the central controller to various different parts can be cut down, leaving just the power wires needed to supply current. Wiring is one of the most vulnerable points on any robot and is thus one of the most common sources of faults and breaks [2]. By reducing the wiring required, the robustness of the entire system is improved. Additionally for microrobots, having lots of wires is far too costly in size and weight and can easily make micro-scale systems infeasible [3]. Secondly, decentralized control allows for more flexible and responsive robotic systems [2]. This becomes especially apparent in robot swarms [4] and self-assembling robots [5] where the components of the system may not be physically connected in any way. One of the biggest challenges to decentralized control is time synchronization of the various distributed components. In this paper, we demonstrate the viability of implement- ing the low-power wireless protocol stack OpenWSN [6] on Fig. 1. Larry the hexapod with two on-bot OpenMotes sitting on his frame patiently awaits commands from the central controller or ”DAGroot” mote (not shown), which is connected via OpenUSB to a computer and controlled by a human driver using a python GUI. OpenMotes [7] for the time synchronization of decentralized robotic movement on Larry (Fig. 1), a hexapod robot that uses two independent but wirelessly connected OpenMotes as controllers for its legs. II. TIME SYNCHRONIZED PROTOCOL OpenWSN [6] and Contiki [8] provide open-source im- plementations of a low-power, high-reliability communica- tion stack based on the IEEE 802.15.4e [9] protocol and the IETF 6LoWPAN [10] and 6TiSCH [11] protocols. IEEE802.15.4e added Timeslotted Channel Hopping (TSCH) to the IEEE802.15.4 standard, allowing for ultra low power communication with very high reliability. 6LoWPAN allows IPv6 packets to be sent over lossy and low-power wireless sensor networks, allowing them to interface directly with the Internet, and 6TiSCH provides standard ways of implementing and managing a TSCH schedule. CoAP [12] is a web transfer protocol specifically designed for constrained and low-power networks. Using IEEE 802.15.4e TSCH with centralized feed- back control has been demonstrated [13]; however, the work in this paper uses IEEE802.15.4e TSCH for decentralized con- arXiv:1808.07961v1 [cs.RO] 23 Aug 2018

Transcript of Decentralized Control of a Hexapod Robot Using a Wireless ...

Decentralized Control of a Hexapod Robot Using aWireless Time Synchronized Network

James Fang, Dinesh Parimi, Arjun Dhindsa, Craig B. Schindler, and Kristofer S. J. PisterBerkeley Sensor & Actuator Center

Department of Electrical Engineering and Computer SciencesUniversity of California, Berkeley

Berkeley, California, USAEmail: {jamesfang, dineshp, arjun.dhindsa, craig.schindler, ksjp}@berkeley.edu

Abstract—Robots and control systems rely upon precise timingof sensors and actuators in order to operate intelligently. Wepresent a functioning hexapod robot that walks with a dual tripodgait; each tripod is actuated using its own local controller runningon a separate wireless node. We compare and report the resultsof operating the robot using two different decentralized controlschemes. With the first scheme, each controller relies on its ownlocal clock to generate control signals for the tripod it controls.With the second scheme, each controller relies on a variable that islocal to itself but that is necessarily the same across controllers asa by-product of their host nodes being part of a time synchronizedIEEE802.15.4e network. The gait synchronization error (timedifference between what both controllers believe is the start of thegait period) grows linearly when the controllers use their localclocks, but remains bounded to within 112 microseconds whenthe controllers use their nodes’ time synchronized local variable.

I. INTRODUCTION

Control systems can be fully centralized, fully decen-tralized, or a combination of both. In a centralized controlsystem, all of the information about the system as well as thecalculations based on that information take place at a singlelocation. In a decentralized system, the information about thesystem as well as the calculations about that information takeplace at multiple locations [1].

Decentralized control is desirable for a multitude of rea-sons. Firstly, by modularizing a robotic system, lengthy controlwires running from the central controller to various differentparts can be cut down, leaving just the power wires neededto supply current. Wiring is one of the most vulnerable pointson any robot and is thus one of the most common sourcesof faults and breaks [2]. By reducing the wiring required, therobustness of the entire system is improved. Additionally formicrorobots, having lots of wires is far too costly in size andweight and can easily make micro-scale systems infeasible [3].

Secondly, decentralized control allows for more flexibleand responsive robotic systems [2]. This becomes especiallyapparent in robot swarms [4] and self-assembling robots [5]where the components of the system may not be physicallyconnected in any way.

One of the biggest challenges to decentralized control istime synchronization of the various distributed components.In this paper, we demonstrate the viability of implement-ing the low-power wireless protocol stack OpenWSN [6] on

Fig. 1. Larry the hexapod with two on-bot OpenMotes sitting on his framepatiently awaits commands from the central controller or ”DAGroot” mote(not shown), which is connected via OpenUSB to a computer and controlledby a human driver using a python GUI.

OpenMotes [7] for the time synchronization of decentralizedrobotic movement on Larry (Fig. 1), a hexapod robot thatuses two independent but wirelessly connected OpenMotes ascontrollers for its legs.

II. TIME SYNCHRONIZED PROTOCOL

OpenWSN [6] and Contiki [8] provide open-source im-plementations of a low-power, high-reliability communica-tion stack based on the IEEE 802.15.4e [9] protocol andthe IETF 6LoWPAN [10] and 6TiSCH [11] protocols.IEEE802.15.4e added Timeslotted Channel Hopping (TSCH)to the IEEE802.15.4 standard, allowing for ultra low powercommunication with very high reliability. 6LoWPAN allowsIPv6 packets to be sent over lossy and low-power wirelesssensor networks, allowing them to interface directly with theInternet, and 6TiSCH provides standard ways of implementingand managing a TSCH schedule. CoAP [12] is a web transferprotocol specifically designed for constrained and low-powernetworks. Using IEEE 802.15.4e TSCH with centralized feed-back control has been demonstrated [13]; however, the workin this paper uses IEEE802.15.4e TSCH for decentralized con-

arX

iv:1

808.

0796

1v1

[cs

.RO

] 2

3 A

ug 2

018

Fig. 2. The dual tripod gait in action (side view, walking to the right).(i) The right tripod lowers and the left tripod lifts at the hip. (ii) The righttripod propels Larry forward by rotating back at the knee while the left tripodrotates forward at the knee to reset. (iii) The right tripod lifts, and the lefttripod lowers at the hip. (iv) The left tripod propels Larry forward by rotatingback at the knee while the right tripod rotates forward at the knee to reset.These four actions loop to produce the forward-moving dual tripod gait.

trol by exploiting the extremely tight time-synchronization ofnodes. Very small synchronization errors between 3-hop deepnodes in TSCH networks have been demonstrated using Con-tiki (2 microseconds) [14], OpenWSN (76 microseconds) [15],and Dust Networks’ SmartMesh software and LTC5800 chip(5 microseconds) [16].

III. LARRY, AN EXAMPLE PLATFORM

A. Design and Construction

Larry, being a hexapod, has six legs, each with two pointsof rotation (i.e. joints), which are referred to as the “hip” and“knee”. These joints are each actuated by a servo motor for atotal of twelve servos.

The hip-and-knee design allows for two rotational degreesof movement: the servo actuating the hip translates its rota-tional motion into linear vertical motion, allowing Larry to lifthimself, while the servo actuating the knee translates to linearhorizontal movement, allowing Larry to pull himself forwards

Fig. 3. An image panel of Larry walking and being controlled by M1 and M2

using scheme S2 : decentralized synchronized control (ASN synchronization).Larry’s approximate velocity is around 2 cm/s.

or backwards. The advantage of this design is simplicity: thereare only three moving parts on the leg. Legs also allow Larry toengage in step-like motions, which can be adapted to traverseover obstacles in the human world (i.e. stairs, gaps, etc.).

The hexapod frame and legs are fabricated by laser cutting18 inch plywood. The parts are assembled using small nails. Sixservos are mounted directly on a 30 × 6 cm sideboard. Twomirrored sideboards are then attached to a 30 × 12.5 cm topframe. The legs are attached to the servos at the appropriatejoints. The wiring is done using a breadboard, which sits onthe top frame with two OpenMotes.

B. Gait

Larry walks using a dual tripod gait. As the name suggests,there are two tripods, each one consisting of the front and backleg from one side of the robot and the middle leg from the otherside. At any point in time, at least one tripod will be in contactwith the ground while the other tripod resets in midair. Thegait has four main positions which when executed in a loopresults in step-like motion (Fig. 2).

A single tripod goes through the following four events:

1) The tripod actuates the hip downwards, lifting Larry.2) The tripod actuates the knee backwards, propelling

Larry forward.3) The tripod actuates the hip back upwards.

Fig. 4. Circuit diagram of the servos being controlled by two motes. M1

(top mote) is controlling the hip servos (green control lines), and M2 (bottommote) is controlling the knee servos (yellow control lines). The servos arepowered by an external supply drawing 2A at 5V.

4) The tripod actuates the knee forwards to reset for thenext iteration.

Larry can be seen walking in Fig. 3. The tripods are offset byexactly 180 degrees, meaning that in our four-step gait, tripod1 should be exactly two steps ahead of tripod 2 at all times.Since the gait motion is periodic with a period of one second,tripod 1 should be half a second ahead of tripod 2 at all times.This is where time synchronization becomes crucial for properexecution of the robotic gait. If the gait offset of the tripodsis out-of-sync, Larry would not be able to walk properly. Inthe worse case, if tripod 1 and tripod 2 are 180 degrees out-of-sync (i.e. they are performing the same gait actions at thesame time), Larry will not be walking at all but instead besquatting in place over and over.

The gait events are controlled using two OpenMote-cc2538boards or “motes”. Let the two motes be M1 and M2. M1

controls all six hip servos, and M2 controls all six knee servos.A circuit diagram of the two motes connected to the servosthat they each control can be seen in Fig. 4.

IV. FIRMWARE AND NETWORKING IMPLEMENTATION

Hexapod control is implemented with a modified versionof the OpenWSN wireless protocol stack firmware, running onOpenMote-cc2538 Rev. A1 boards. OpenWSN designates onemote as a “DAGroot” that can send and receive messages fromall motes connected in the network.

The firmware is flashed to M1, M2 and the DAGroot motes.A human driver can interact using a CoAP application (Fig. 5),usable through either a Python GUI interface or the commandline (e.g. the driver can send a CoAP message from theDAGroot to M1 and M2 telling them to start running theirgait events). Three separate methods for gait control wereexplored: centralized control, decentralized open loop control,and decentralized synchronized control.

In centralized control, the DAGroot was responsible fortiming the gait events and sending information over the net-work about the angle of each servo motor (i.e. turning it) to the

Fig. 5. A human driver can operate Larry using a Python GUI interface, whichis processed by a Python application that then sends a constrained applicationprotocol (CoAP) message, via the connected DAGroot, telling the child motescarried on Larry’s back to start running their respective gait events which drivethe servos on Larry’s legs. Top: physical system of a laptop with DAGrootconnected communicating with the two child motes on Larry. Bottom: blockdiagram of the control logic occurring within the physical systems.

two child motes, whose only task was actually implementingthe pulse width modulation (PWM) signals to drive the motors.However, in this implementation, the DAGroot was constantlytransmitting messages to the other motes, typically severaltimes per second, and this caused latency issues since themessages to both motes cannot be sent at exactly the sametime and the transmission itself introduces some delay.

To work around this issue, we tried decentralized openloop control. The DAGroot was now only responsible forsending high-level commands to the child motes such as “goforward”, “turn left”, or “stop”, and the child motes usedtheir independent, internal timing schemes to control the gaitevents driving the servo motors. In practice, this worked wellwhile driving Larry for short amounts of time (on the order ofminutes). However, the on-board timers of the motes have adrift of at most 10 ppm, so for longer runs, the two motes willeventually grow out-of-sync. Thus, we need to periodicallyresynchronize the two child motes in order to mitigate timingdrift between the gait events.

We addressed this issue in decentralized synchronizedcontrol by synchronizing the motes’ timing schemes usingthe network’s absolute slot number (ASN), a local variableon each mote that is incremented every 15 millisecondsaccording to the mote’s local clock. Anytime a message issent between the child motes and the DAGroot, the child moteswill resynchronize their clocks to the DAGroot’s clock - thismakes the ASN a reliable timing reference across all motes.As per the default OpenWSN timing requirements, motes mustbe synchronized within 1 millisecond. Our implementation hasthe child motes communicating with the DAGroot every 30seconds in a worst case scenario, allowing the child motes tobe synchronized within 120 microseconds (see results below).This implementation allows Larry to walk for any duration oftime without squatting (i.e. desynchronizing).

V. RESULTS

With decentralized control, M1 and M2 are executing theirrespective gait events independently, yet the events must betime synchronized for proper gait performance. Our results

Fig. 6. Gait synchronization error between the two motes starting from aninitial state of zero error. Top: the motes are running on decentralized openloop control using independent on-board timers and are experiencing a driftof around 5 µs/s (5 ppm) for a total of slighlty more than 2 ms over the400 second experiment. This drift continues indefinitely. Bottom: the motesare running on decentralized synchronized control using the network’s ASNand are experiencing a drift of around 3 µs/s (3 ppm). The motes resynchronizeevery 30 seconds, so the offset between them never exceeds 112 µs.

compare the gait synchronization error using two gait controlschemes: S1 : decentralized open loop control and S2 :decentralized synchronized control. Decentralized open loopcontrol uses the free-running onboard clocks of M1 and M2

as independent references for time. Decentralized synchronizedcontrol relies on the ASN as a global time reference for makingcontrol decisions. If M1 and M2 have the same reference forthe start of each gait period, their gait events will be performedin sync. The quality of the control will then be measured bythe difference between the starts of M1 and M2’s gait period.

S1 lets M1 and M2’s clocks run independently of eachother, but they may have an error up to 10 ppm (as specifiedby the 32.768kHz crystal the OpenMote-cc2538 uses). Thisimplies that one of the clocks will be running slightly fasterthan the other (less than 10 microseconds faster per second).As expected, this error is causing a drift between M1 and

M2’s gait period starts, causing them to gradually fall out ofsync over time (Fig. 6, top). For the 400-second sample run,the gait synchronization offset increases linearly to slightlyover 2 milliseconds with a slope of -5 µs/s. For a gait periodof 1 second, a 2 millisecond difference does not have muchnoticeable effect on gait performance (i.e. M2, controlling theknees, is pulling the hexapod forwards 2 milliseconds laterthan it should). However, after slightly less than 28 hours ofoperation, the drift would cause M1 and M2 to be 180 degreesout of phase, causing Larry to squat instead of walk. He wouldthen be in an uncontrollable state.

S2 uses the ASN variable on M1 and M2 as a timereference to make control decisions. M1 and M2 will resyn-chronize their clocks anytime communication happens withthe DAGroot (their time-source parent). For the 400-secondsample run (Fig. 6, bottom), the offset between the two motesis never more than 112 microseconds, i.e. the two motes willnever be out of sync by more than 112 microseconds. The slopeof the line is around -3 microseconds per second, showing anerror of 3 ppm between these two motes. The bounded gaitsynchronization error means that Larry can walk indefinitelywithout getting into an uncontrollable state.

The synchronization bound can be further reduced from112 microseconds to 30 microseconds by having the childmotes communicate with the DAGroot more often. The abovedata was collected using a worst case communication pe-riod of 30 seconds, resulting in a bound of 112 microsec-onds. Using the 32.768 kHz clock on the motes, in thebest case we are limited to the clock period of 1/(32.768kHz) ≈ 30 microseconds. By simply reducing the worsecase communication period to 10 seconds, we were able toachieve a synchronization bound of around 30 microseconds(the 112 microsecond-bounded data is used here for ease ofvisual analysis). And with more sophisticated techniques suchas adaptive synchronization this bound could be reduced evenfurther [15]. Microsecond time synchronization using TSCHhas been demonstrated by Elsts et al. [14].

The results show that for gait synchronization between M1

and M2, the scheme S2, taking advantage of the TSCH modeof IEEE802.15.4 with the usage of the ASN implementedby OpenWSN, has the objectively better decentralized controlperformance.

VI. CONCLUSION

Decentralized control can be used to successfully coor-dinate actions in robotic systems. However, as the resultsshow, success depends on keeping the various controllers time-synchronized. The controllers themselves cannot be relied onto stay time-synchronized due to their clock error of 10 ppm.Thus, the controllers need to be connected via a networkto share a common time reference. The OpenWSN networkpresented here uses the TSCH mode of IEEE802.15.4 to ensureeach controller’s time reference remains synchronized withrespect to the DAGroot’s clock by usage of the ASN variableimplemented by OpenWSN.

The application of a network-synchronized robotic systemextends beyond the single-robot gait presented in this paper.Precisely coordinated decentralized control can be used in awide range of robotic systems: for example, self-reconfiguring

robots or intelligent robot swarms. Furthermore, the use of syn-chronized nodes implementing the OpenWSN protocol stackcan be extended beyond just the three-node topology presentedin this paper. There have been projects such as SensLab whichuses 1024 synchronized nodes at once [17] and FIT IoT-LAB,a testbed for IoT technologies which is composed of 2728synchronized wireless nodes and 117 mobile robots [18].

ACKNOWLEDGMENT

The authors would like to thank the Berkeley Sensor & Ac-tuator Center and the UC Berkeley Swarm Lab for supportingthis project.

REFERENCES

[1] N. Sandell, P. Varaiya, M. Athans, and M. Safonov, “Survey of decen-tralized control methods for large scale systems,” IEEE Transactionson automatic Control, vol. 23, no. 2, pp. 108–128, 1978.

[2] A. M. Flynn and R. A. Brooks, “Building robots: Expectations andexperiences,” in Intelligent Robots and Systems’ 89. The AutonomousMobile Robots and Its Applications. IROS’89. Proceedings., IEEE/RSJInternational Workshop on. IEEE, 1989, pp. 236–243.

[3] D. S. Contreras and K. S. Pister, “Durability of silicon pin-joints formicrorobotics,” in Manipulation, Automation and Robotics at SmallScales (MARSS), International Conference on. IEEE, 2016, pp. 1–6.

[4] S. Bergbreiter and K. S. Pister, “Cotsbots: An off-the-shelf platformfor distributed robotics,” in Intelligent Robots and Systems, 2003.(IROS2003). Proceedings. 2003 IEEE/RSJ International Conference on,vol. 2. IEEE, 2003, pp. 1632–1637.

[5] M. Rubenstein, A. Cornejo, and R. Nagpal, “Programmable self-assembly in a thousand-robot swarm,” Science, vol. 345, no. 6198, pp.795–799, 2014.

[6] T. Watteyne, X. Vilajosana, B. Kerkez, F. Chraim, K. Weekly, Q. Wang,S. Glaser, and K. Pister, “Openwsn: a standards-based low-power wire-less development environment,” Transactions on Emerging Telecommu-nications Technologies, vol. 23, no. 5, pp. 480–493, 2012.

[7] X. Vilajosana, P. Tuset, T. Watteyne, and K. Pister, “Openmote: open-source prototyping platform for the industrial iot,” in InternationalConference on Ad Hoc Networks. Springer, 2015, pp. 211–222.

[8] A. Dunkels, B. Gronvall, and T. Voigt, “Contiki-a lightweight and flex-ible operating system for tiny networked sensors,” in Local ComputerNetworks, 2004. 29th Annual IEEE International Conference on. IEEE,2004, pp. 455–462.

[9] IEEE Std 802.15.4e-2012.[10] IPv6 over Low power WPAN (6lowpan), IETF.[11] IPv6 over the TSCH mode of IEEE 802.15.4e (6tisch), IETF.[12] Z. Shelby, K. Hartke, and C. Bormann, “The constrained application

protocol (coap),” IETF, 2014.[13] C. B. Schindler, T. Watteyne, X. Vilajosana, and K. S. J. Pister,

“Implementation and characterization of a multi-hop 6tisch network forexperimental feedback control of an inverted pendulum,” in Modelingand Optimization in Mobile, Ad Hoc, and Wireless Networks (WiOpt),2017 15th International Symposium on. IEEE, 2017, pp. 1–8.

[14] A. Elsts, S. Duquennoy, X. Fafoutis, G. Oikonomou, R. Piechocki,and I. Craddock, “Microsecond-accuracy time synchronization using theieee 802.15. 4 tsch protocol,” in Local Computer Networks Workshops(LCN Workshops), 2016 IEEE 41st Conference on. IEEE, 2016, pp.156–164.

[15] T. Chang, T. Watteyne, K. Pister, and Q. Wang, “Adaptive synchro-nization in multi-hop tsch networks,” Computer Networks, vol. 76, pp.165–176, 2015.

[16] LTC5800-IPM SmartMesh IP Node 2.4GHz 802.15.4e Wireless Mote-on-Chip, http://cds.linear.com/docs/en/datasheet/5800ipmfa.pdf, DustNetworks, 2013.

[17] C. B. des Roziers, G. Chelius, T. Ducrocq, E. Fleury, A. Fraboulet,A. Gallais, N. Mitton, T. Noel, E. Valentin, and J. Vandaele, “Twodemos using senslab: Very large scale open wsn testbed,” in DistributedComputing in Sensor Systems and Workshops (DCOSS), 2011 Interna-tional Conference on. IEEE, 2011, pp. 1–2.

[18] C. Adjih, E. Baccelli, E. Fleury, G. Harter, N. Mitton, T. Noel,R. Pissard-Gibollet, F. Saint-Marcel, G. Schreiner, J. Vandaele et al.,“Fit iot-lab: A large scale open experimental iot testbed,” in Internet ofThings (WF-IoT), 2015 IEEE 2nd World Forum on. IEEE, 2015, pp.459–464.