Build Your Own BB-8

build-your-own-bb-8

** บทความนี้เป็นส่วนหนึ่งของบทความชุด Build Your Own Bot แนะนำการสร้างหุ่นยนต์ด้วยตัวเอง **

BB-8 หุ่นยนต์กลมกลิ้งจาก Star Wars : The Force Awakens เป็นหุ่นยนต์ที่ใครเห็นก็ชมว่าน่ารัก ในงานเปิดตัวบนเวทีก็มีผู้คนตื่นตาตื่นใจมากมาย นักพัฒนาหุ่นยนต์ทั้งหลายก็ต่างคาดเดากันว่า BB-8 นั้นทำงานอย่างไร thairobotics ก็เคยคาดเดาไปเช่นกัน (อาจจะไม่ใช่วิธีที่มีคุณสมบัติดีที่สุด แต่อยากให้เป็นวิธีที่ง่าย ใคร ๆ ก็ทำตามได้) แต่เพียงการคาดเดาคงไม่มีน้ำหนักเท่าใดหากไม่สร้างขึ้นมาดูว่าทำได้จริงหรือไม่ มาดูกันเลยดีกว่าว่าเราจะสามารถสร้าง BB-8 ขึ้นมาได้จริงหรือไม่ อย่างไร

BB-8, a rolling robot from Star Wars : The Force Awakens, is adorable and captures heart of people who see it. When a real BB-8 rolls nn the Celebration stage, roboticists try to figure out how BB-8 works. ThaiRobotics has proposed the way to build your own BB-8 too. (Probably not the best way, but the easiest way that people can try to build on their own). However, just a theory on a paper doesn’t sound. Let’s build the real BB-8 to see if it works as we expect.

จากแนวคิดที่เราคาดเดากันว่าเจ้า BB-8 จะทำงานอย่างไร เราจึงวางแผนการสร้างเจ้า BB-8 ดังนี้ การเคลื่อนที่ทำโดยล้อ 2 ล้อ ขับเคลื่อนแบบ differential drive อยู่ภายในลูกบอล เมื่อล้อหมุนก็จะไปหมุนลูกบอลให้กลิ้ง คล้ายหนูแฮมสเตอร์วิ่งในลูกบอล หากต้องการเลี้ยวก็ควบคุมให้ล้อ 2 ข้างหมุนเร็วไม่เท่ากัน ลูกบอลก็จะเลี้ยว ส่วนหัวนั้นติดอยู่กับลูกบอลลำตัวด้วยแม่เหล็กและมีกลไกสำหรับเคลื่อนไหวหัว ซึ่งประกอบด้วย 2 ส่วน คือ ส่วนก้ม-เงยหัว และส่วนหันซ้าย-ขวา เดิมทีเราตั้งใจว่าจะให้หัวโยกก้ม-เงยไปมาตามการกลิ้ง คือ ทำแกนขึ้นไปที่หัวแล้วถ่วงด้านล่างให้มีน้ำหนัก เมื่อ BB-8 กลิ้งไป มวลถ่วงแกนหัวมีความเฉื่อยจะพยายามอยู่กับที่ ทำให้มวลถ่วงเอนไปด้านหลังแล้วหัวเอนไปด้านหน้า (นึกถึงเวลาเราหิ้วของหนัก ๆ แล้ววิ่งไปข้างหน้า แขนเราจะเอนไปด้านหลัง) แต่จากการคำนวณคร่าว ๆ (ตามหลักฟิสิกส์ที่เราเรียนกันตอนมัธยมปลาย) จะพบว่า หากต้องการให้หัวเอนลงมาได้ 45 องศา เจ้า BB-8 ต้องกลิ้งไปข้างหน้าด้วยความเร่งถึง 1g (ความเร่งโน้มถ่วง g = 9.81 เมตรต่อวินาทีกำลังสอง) นั่นเป็นความเร่งที่สูงเอาการเลย คงยากไปหน่อย

We are building BB-8 based on differential drive robot running inside the ball, just like a hamster ball. If we want BB-8 to roll forward, we control 2 wheels at the same speed. If we want BB-8 to steer, we control 2 wheels at different speed. BB-8 head is attached to the body by magnet. Inside the ball, there is a mechanism to tilt the head. Previously, we plan to tilt the head passively according to body roll motion. By putting a ballast on the head mast lower than the pivot point, when running forward, the ballast try to stay still due to the inertia and thus tilt the head forward. (Imagine holding a bucket of water and run forward, your arm holding the bucket will lean backward.) However, from a calculation, if we want BB-8 to tilt 45 degrees forward, we need BB-8 to accelerate forward at 1g. That is quite high acceleration.

swing-head-concept

เราจึงเปลี่ยนแผนเป็นก้ม-เงยหัวด้วยมอเตอร์อีก 1 ตัว สำหรับกลไกการหันหัวซ้าย-ขวานั้นใช้มอเตอร์อีก 1 ตัวในการหมุน ติดตั้งอยู่บริเวณหัว นอกลูกบอลลำตัว ซึ่งถ้าหากให้มอเตอร์ติดตั้งอยู่ด้านในลูกบอลแล้ว ขณะที่ไม่ได้บังคับการหันหัว หัวก็จะหันตามกลไกด้านในลูกบอลลำตัว แต่หากติดตั้งมอเตอร์ไว้ที่หัวเลย ขณะที่ไม่ได้ทำการบังคับการหันหัว หัวจะหมุนตามลูกบอลลำตัวซึ่งน่าจะดูดีกว่า (ในวิดีโอที่ BB-8 มาแสดงตัวบนเวที จะเห็นว่ามีจังหวะที่หัวหันไปพร้อมกับตัวด้วย) เพื่อความง่ายเราจึงจะใช้ Arduino เป็นตัวประมวลผล และใช้รีโมท R/C ในการสั่งงานควบคุม แนวคิดของระบบโดยรวมจึงเป็นตามภาพ

So we change the plan and add another motor inside the ball for tilting the head. For panning the head, we’ll use another motor installed inside the head. The reason we put panning motor outside the ball, not inside is that, when we’re not panning the head, it will follow the body. (Like what we saw on the stage) For easiness, we’ll use Arduino and R/C remote to control BB-8.

bb-8-concept

เป้าหมายในการสร้าง BB-8 ขึ้นมาครั้งนี้คือ พยายามเลียนแบบ BB-8 ที่มาแสดงตัวบนเวทีให้ได้มากที่สุดเท่าที่จะทำได้ กลไกการเคลื่อนที่เราได้คาดเดาไปแล้วว่าเป็นอย่างไร เดี๋ยวเรามาลองสร้างดู แต่ก่อนอื่นเราต้องรู้ก่อนว่าเจ้า BB-8 ในภาพยนต์ตัวใหญ่ขนาดไหน จากการเปรียบเทียบขนาดกับคนและสิ่งของรอบข้างพบว่า BB-8 มีขนาดเส้นผ่านศูนย์กลางประมาณความกว้างเก้าอี้ หรือกว้างกว่าไหล่คนนิดหน่อย เราประมาณว่าเจ้า BB-8 น่าจะมีขนาดเส้นผ่านศูนย์กลางประมาณ 40 – 50 เซนติเมตร

The goal is to replicate BB-8 on the stage. We have a concept for the mechanism. Now we need to know how big BB-8 is. Comparing to people and object around BB-8, we estimate that BB-8 diameter is around a width of shoulder or about a width of a chair, which is around 40 – 50 centimeters.

bb-8-size

ภารกิจแรกของเรา (ซึ่งน่าจะเป็นภารกิจที่ยากที่สุด เพราะกลไกดูไม่น่าจะยาก) คือ การตามหาลูกบอลขนาดเส้นผ่านศูนย์กลางดังกล่าว ที่ต้องมีความกลม เปิด-ปิดเป็น 2 ซีกเพื่อเปิดใส่กลไกและแบตเตอรี่ได้ มีความแข็งแรงพอรับน้ำหนักกลไกข้างในได้ ว่าแล้วเราก็ไปพบลูกบอลชายหาดที่โฆษณาหน้าบรรจุภัณฑ์ว่าเส้นผ่านศูนย์กลาง 41 เซนติเมตร แต่เมื่อเป่าลมเข้าไปเราก็อึ้ง! เมื่อพบว่า 41 เซนติเมตรเป็นขนาดตอนมันแบนอยู่ พอมันป่องออกก็เหลือเส้นผ่านศูนย์กลางประมาณ 30 เซนติเมตรเท่านั้่น … T_T

First mission (and probably the most difficult one) is to build the ball. The ball need to be round, able to be separated into 2 halves for accessing internal mechanism, and strong enough to support BB-8 weight. First we get a beach ball which labeled as 41 centimeters diameter. However, when inflated, it is just 30 centimeters diameter.

beach-ball

เมื่อค้นหาต่อไปก็พบว่ามีลูกบอลโยคะขนาด 45 เซนติเมตร … แต่! หาร้านขายไม่ได้เลย ร้านในไทยขายแต่ขนาด 60 เซนติเมตร … สุดท้ายเลยต้องสั่งจาก AliExpress ได้ลูกบอลขนาด 45 เซนติเมตรมาแล้ว

Next, we find out that there is a 45 centimeters diameter pilates ball, but there is no local shop in Thailand that sell that size. All of them sold 60 centimeters one. Finally, we get the ball from AliExpress.

IMAG0404_1

แต่มันเปิดออกไม่ได้ และไม่แข็งแรง เราจึงทำเปเปอร์มาเช่โดยมีลูกบอลโยคะเป็นแบบ แปะกระดาษหนังสือพิมพ์ไป 10 ชั้น แล้วผ่าซีก ทำสันตรงกลางเพื่อติดเวลโครสำหรับยึดลูกบอล 2 ซีกเข้าด้วยกัน … แล้วเราก็ได้ลูกบอลสำหรับเจ้า BB-8 มาแล้ว เย่!

Pilates ball is not strong and cannot split into 2 halves, so we make a paper mache over the ball. After 10 layers of newspaper, we split the paper mache ball into 2 halves, make lips and put velcros on the lips for attaching 2 halves together. Now we have a body for BB-8.

bb-8-ball

ส่วนหัวนั้น เมื่อคำนวณขนาดเทียบกับลูกบอลลำตัวได้ว่ามีขนาดเส้นผ่านศูนย์กลางประมาณ 11 นิ้ว แต่เนื่องจากไม่สามารถหาโฟมทรงกลมขนาด 11 นิ้วได้ จึงใช้โฟมทรงกลมขนาด 10 นิ้วมาทำแทนโดยการตัดผ่าออกให้ได้รูปร่างที่ต้องการ คว้านด้านในสำหรับไว้ติดตั้งกลไก และแปะเปเปอร์มาเช่เล็กน้อยเพื่อให้สามารถทาสีได้ง่าย

For the head, we estimate that the size is around 11 inches diameter, but we can’t find 11 inches foam ball. The nearest one is 10 inches. We cut the foam ball into BB-8 head shape and make it hollow for the head mechanism. Then we put paper mache on the foam ball.

bb-8-head

ต่อไปเราก็จะสร้างกลไก โดยเริ่มจากกลไกการเคลื่อนที่ก่อน จากการเดินหาซื้อล้อพบว่าล้อที่มีขายทั่วไปมีขนาดเส้นผ่านศูนย์กลางประมาณ 10 เซนติเมตร จากขนาดล้อและขนาดลูกบอล เรามาทำการคำนวณว่ามอเตอร์ที่จะต้องมีความเร็วเท่าใด สมมติให้ความเร็วในการกลิ้งของลูกบอล 1 เมตรต่อวินาที (ประมาณคนเดิน) เราทำการคำนวณความเร็วมอเตอร์ได้ประมาณ 80 รอบต่อนาที

Next, we’ll build the mechanism for BB-8, starting with hamster ball rolling. First, we find wheels and we get 10 centimeters diameter wheels. From the size of the ball and the wheels, we can calculate how fast the wheels need to spin. Let’s the ball rolls at 1 meter per second (around the speed of human walking), we can calculate the wheel speed of 80 RPM.

wheel-speed-calc

เมื่อได้มอเตอร์แล้วก็ต้องสร้างโครงสร้างมาเพื่อติดตั้งมอเตอร์ วงจรไฟฟ้าและอุปกรณ์อื่น ๆ เพื่อให้ง่ายเราจึงใช้กล่องพลาสติกสำเร็จรูปเจาะรูยึดมอเตอร์เอา ต่อไปก็สร้างและติดตั้งวงจรไฟฟ้าลงในกล่อง วงจรไฟฟ้าที่ใช้ประกอบด้วยแผงเทอร์มินอลสำหรับกระจายไฟจากแบตเตอรี่เข้าอุปกรณ์ต่าง ๆ Arduino Uno เป็นตัวประมวลผลควบคุม รับสัญญาณควบคุมจาก R/C receiver และส่งคำสั่งควบคุมมอเตอร์ไปยังวงจรขับมอเตอร์ (สนับสนุนโดย Smile Robotics) ซึ่งต่อเข้ากับมอเตอร์อีกที เมื่อประกอบเสร็จ ก็เขียนโปรแกรมบน Arduino เล็กน้อย

Then, we build the structure for motors and all electronics. For easiness, we use a plastic box and drill holes for attaching motors. For the electronics stuff, we need terminals for distribute power to each components, Arduino Uno for processing, R/C receiver for receiving command from remote and motor drivers (sponsored by Smile Robotics).

BB-8_Fritzing

motion-box

motion-box-in-ball

การควบคุมการกลิ้งของ BB-8 เราจะใช้ก้านควบคุมด้านขวามือของรีโมท โดยใช้ channel 2 ดันขึ้น-ลงในการบังคับเดินหน้า-ถอยหลัง และใช้ channel 1 ดันซ้าย-ขวาในการบังคับเลี้ยวซ้าย-ขวา ดังนั้นแนวคิดของโปรแกรมที่ต้องเขียนคืออ่านค่าความกว้าง pulse ที่ R/C receiver ส่งออกมา จากนั้นก็แปลงคำสั่งการเคลื่อนที่หน้า-หลังและซ้าย-ขวาให้เป็นความเร็วมอเตอร์ซ้ายและขวา

We use channel 2 (right vertical stick on the remote) to control forward – backward rolling. Channel 1 (right horizontal stick) to control left – right steering. So we need a program that read pulses from R/C receiver and convert forward – backward and left – right motion into motors speed.

เมื่อโปรแกรมเสร็จก็ได้เวลาใส่เข้าไปในลูกบอลแล้วไปกลิ้ง พบว่ากลไกแกว่งหน้า-หลังเวลาออกตัวและหยุด ทำให้ลูกบอลแกว่งหน้า-หลังด้วย จึงทำการปรับปรุงโดยติดตั้งโครงสร้างค้ำยันที่ด้านหน้าและหลังเพื่อกันไม่กลไกล้มหน้า-หลัง (เดิมทีใช้ลูกกลิ้งติดตั้งบนโครงสร้างยื่นออกไปที่ทำด้วยฟีเจอร์บอร์ด แต่ทดสอบไปมาแล้วโครงสร้างฟีเจอร์บอร์ดเสียหาย ด้วยความขี้เกียจและพบว่าทัพพีมีขนาดและรูปร่างที่เหมาะสม แถมยังมีผิวลื่น จึงนำมาใช้แทนลูกกลิ้ง ฮ่าฮ่าฮ่า) ถ่วงน้ำหนักข้างใต้กลไก และโปรแกรมให้ขณะออกตัวและหยุดค่อย ๆ เพิ่ม-ลดความเร็ว แทนที่จะสั่งความเร็วเต็มที่ พบว่าเจ้าลูกกลมกลิ้งของเรากลิ้งได้ดีขึ้น

Once the program is download to Arduino, we test the rolling. We found that the ball wobble when start and stop rolling. To improve this, we add front and rear supporter to the electronics box. (First we plan to use ball rollers, but we need to have some kind of structure for attaching the roller. With laziness, we use Teflon soup ladles since they have a perfect size to attach to the box and they have smooth surface, perfect for sliding on another surface) Also, add more mass underneath the electronics box and add velocity profile to the program to make it gently accelerate and decelerate. These result in better rolling.

แต่!! … อุปสรรคเรื่องลูกบอลก็กลับมา เปเปอร์มาเช่ 10 ชั้นที่ดูเหมือนจะแข็งแรงพอ เมื่อทดสอบหลายครั้งเข้า เริ่มบุบบี้ จึงต้องหาทางเสริมความแข็งแรง เลยทดลองทาเรซิน R-200 ดู แต่เนื่องจากเป็นมือใหม่ ฝีมือยังไม่ถึง จึงสามารถทาเรซิ่นที่ผิวด้านในได้ แข็งแรงพอควร แต่ไม่เรียบเลย ขรุขระมาก และเนื่องจากทาบนพื้นผิวทรงกลม ขณะที่เรซิ่นยังไม่แห้งดีจึงลงไปกองที่ก้นลูกบอล ทำให้ผิวลูกบอลด้านในจะออกรี ๆ หน่อย … เอาเถอะ ทำอย่างอื่นต่อไปก่อน …

Unfortunately, 10 layers of paper mache is not strong enough. After a couple roll test, the paper mache ball starts to dented and loose its shape. We need to reinforce the ball. We try by coating internal surface with R-200 resin. As a newbie in resin work, the resin surface is quite rough and not spread equally on the surface. But the show must goes on.

IMG_2625

ต่อไปเรามาจัดการกับกลไกการก้ม-เงยหัวกัน เพื่อให้หัวค้างอยู่ที่ตำแหน่งก้ม-เงยใด ๆ ได้โดยมอเตอร์ไม่ต้องออกแรงค้างไว้ จึงใช้มอเตอร์ที่มีเฟืองทดแบบเฟืองหนอน ที่มีความเร็วประมาณ 15 รอบต่อนาที เพื่อให้ก้ม-เงยได้ด้วยความเร็วประมาณ 90 องศาต่อวินาที ที่แกนมอเตอร์ต่อกับท่อ PVC สำหรับเป็นก้านก้ม-เงยหัว ที่ปลายท่อ PVC ทำโครงสร้างไว้ติดแม่เหล็กและลูกกลิ้งเพื่อลดแรงเสียดทานเวลาเคลื่อนที่ไปมาที่ผิวลูกบอลด้านใน สิ่งที่ทำคู่กันคือทำโครงสร้างหัวโดยใช้แผ่นอะคริลิกวงกลม (เหลือจากงานอื่น ฮ่า ฮ่า หากทำใหม่เองอาจตัดจากแผ่นไม้อัดก็ได้) ติดแม่เหล็กและลูกกลิ้งเพื่อให้เคลื่อนที่บนผิวลูกบอลได้ง่าย จากนั้นก็ปิดฝาลูกบอล เอาหัวมาดูดกับกลไกก้ม-เงยหัว แล้วลองโยกดู … ปรากฎว่า เนื่องจากผิวลูกบอลด้านในไม่ค่อยกลม และแกนเพลามอเตอร์ที่เอนหัวอาจไม่ได้อยู่กลางทรงกลมลูกบอลเป๊ะ ทำให้เมื่อเอียงหัวไปมา เกิดการเบียดบ้างที่บางมุม ในขณะที่บางมุม ก้านหัวสั้นไป ไม่สัมผัสกับผิวบอลด้านใน ทำให้แม่เหล็กอยู่ห่างออกมา วิธีการแก้ไขคือต้องติดกลไกสปริงเข้าไปเพื่อให้สามารถขยับเข้าออกได้บ้างตามผิวที่สัมผัส เพื่อให้ง่ายจึงใช้แกนสำหรับใส่กระดาษทิชชู่ในห้องน้ำมาติดกับชิ้นส่วนที่ขึ้นรูปด้วยเครื่องพิมพ์สามมิติและแผ่นอะคริลิกวงกลม (ที่เหลือมาจากงานอื่นอีกแหละ ฮ่า ฮ่า) ซึ่งให้ผลที่ดีขึ้น แกนหัวด้านในสามารถเคลื่อนที่ไปมาได้และมีแรงดูดหัวอย่างสม่ำเสมอมากขึ้น

Next, we work on head tilt mechanism. To maintain head tilt position without having motor actives all the time, a worm-geared motor is used. With 15 RPM speed, the head will tilt around 90 degrees per second. PVC pipe is used for head mast. A magnet is attached at the top of the mast. Rollers are also attached to reduce friction when move along internal of the ball. The head itself also has magnet and rollers attached to an acrylic disc. Now it’s time to put the mechanism inside the ball and test. Due to imperfection geometry of the ball and head mast center of rotation, the head mechanism doesn’t touch the internal of the ball all the time. To fix this, a spring toilet roll holder is added to the mast as a suspension.

tilt-mechanism

เมื่อทำให้หัวก้ม-เงยได้แล้ว ต่อไปก็ปรับปรุงเพิ่มเติมให้ควบคุมง่ายขึ้นอีกหน่อย แทนที่จะใช้วิธีโยกก้านควบคุมไปด้านหน้าแล้วมอเตอร์หมุนเพื่อก้มหน้า โยกไปด้านหลังแล้วมอเตอร์หมุนเพื่อเงยหน้า เราจะไม่ทราบว่าขณะนั้นกลไกก้ม-เงยหัวอยู่ที่ตำแหน่งใด เราจึงทำการติดตัวต้านทานปรับค่าได้เข้าไปที่เพลามอเตอร์ เพื่อให้ทราบว่าขณะนี้หัวก้ม-เงยอยู่เท่าใด และใช้รีโมท channel 3 ซึ่งปกติใช้กับการควบคุม thruster ในเครื่องบิน ก้าน channel นี้จึงจะค้างที่ตำแหน่งใด ๆ ที่เราปล่อย ไม่กลับเข้าสู่ศูนย์ แล้วเราก็โปรแกรมให้เมื่อก้านควบคุมอยู่ตำแหน่งใด ก็ให้มอเตอร์หมุนให้หัวเอียงตำแหน่งนั้น ๆ

Now that the head can tilt, next we add position control of the head. Instead of pushing the stick forward to tilt down, pushing stick backward to tilt up, we add a potentiometer to the head mast, to sense the tilt position and use Channel 3 (left vertical stick) position to control tilt position.

ส่วนกลไกหัวด้านนอกนั้นเนื่องจากมันแค่หมุนซ้าย-ขวาเท่านั้น ไม่ต้องมีการคำนวณหรือควบคุมอะไรซับซ้อน เพื่อให้ง่ายเราจึงใช้อุปกรณ์ R/C ล้วน ๆ โดยการต่อ R/C servo เข้ากับ R/C receiver โดยตรง แต่ต้องมีการดัดแปลง R/C servo เล็กน้อย โดยปกติ R/C servo จะหมุนได้ไม่ครบรอบ จะเคลื่อนที่อยู่ในช่วงประมาณ -45 องศา ถึง +45 องศาตามสัญญาณควบคุมจากรีโมท แต่เราต้องการให้หัว BB-8 หมุนได้รอบ เราจึงทำการตัดตัวจำกัดการหมุนทิ้ง เท่านี้เมื่อโยกก้าน channel 4 ไปซ้าย-ขวา R/C servo ก็จะหมุนไปทางนั้น ๆ (แต่จะไม่หยุดตามตำแหน่งของก้านรีโมทแล้ว)

For the panning mechanism, we only need it to pan left or right without positioning feedback. Thus, we use a modified R/C servo connect to R/C receiver directly. General R/C servo only rotate -45 to + 45 degrees. Since we need BB-8 head to pan 360 degrees continuous, we cut the position limit from the R/C servo and use Channel 4 (left horizontal stick) to control head panning.

servo-mod

pan-mechanism

bb-8-head-mechanism

ลองขยับดู

Moving…

เท่านี้ก็ดูเหมือนว่าภารกิจการสร้างเจ้า BB-8 จะเสร็จแล้ว แต่เพื่อความสมจริง เราจึงทำให้เจ้า BB-8 ส่งเสียงได้ด้วย เพื่อความง่าย (อีกแล้ว) เราจึงใช้ MP3 Player Shield สำเร็จรูปต่อเข้ากับ Arduino เลย เจ้า MP3 Player Shield นี้จะอ่านไฟล์ MP3 จาก SD card และแปลงเป็นสัญญาณเสียง เพื่อให้เสียงดังชัดเจน เราจึงหาตัวขยายสัญญาณเสียงและลำโพงมาติดตั้งด้วย (สำเร็จรูปอีกเช่นเคย) จากนั้นก็ดัดแปลงโปรแกรมจากตัวอย่างให้สุ่มเล่นเสียงเมื่อเราดันสวิทช์ channel 5 บนรีโมท แล้วจะหาไฟล์ MP3 ที่เป็นเสียง BB-8 จากไหนล่ะ ในงานเปิดตัวบนเวทีเสียงเจ้า BB-8 มักจะถูกกลบด้วยเสียงการพูดคุยกันบนเวที จึงได้เสียงของเจ้า BB-8 มาเป็นเวลาเพียงสั้น ๆ เพื่อให้มีเสียงที่หลากหลาย เราจึงใช้เสียงของ R2D2 แทน ฮ่า ฮ่า ฮ่า ญาติกันเสียงคล้ายกัน แล้วก็ไปเจอเว็บ R2D2 Translator เป็นเว็บสร้างเสียง R2D2 จากคำที่เราพิมพ์เข้าไป

We almost finish BB-8. To make BB-8 become BB-8, we need it to speak. For easiness, we use MP3 Player Shield connect to Arduino. MP3 Player Shield will read MP3 file from SD card and send a sound signal to speakers. To amplify the sound, a sound amplifier circuit is used. Then, we make a modification to MP3 Player Shield example code to make it play sound once Channel 5 (landing gear toggle switch) is toggled. Since on Celebration stage, there is not much clear BB-8 voice, mostly we hear people speaking. Thus we use R2D2’s, BB-8 cousin. There is a R2D2 Translator web site that translate a sentence we input to R2D2 voice.

จากนั้นก็ลงสี วาดลวดลายให้สมจริง 😀 (เนื่องจากไม่ได้ถ่ายรูปและวิดีโอไว้เยอะระหว่างทำ เพิ่งมาถ่ายตอนเขียนบทความนี้ รูปที่แสดงเลยมีลวดลายตั้งแต่ขั้นแรก ๆ เลย แหะ ๆ)

Now it’s time to paint BB-8.

painting

กลิ้ง ๆ

Rolling…

ผลจากการสร้างเจ้า BB-8 ขึ้นมาเองพบว่า ตัวกลไกนั้นค่อนข้างทำงานได้ตามที่คาดไว้ แต่สิ่งที่ติดขัดมากคือตัวลูกบอลที่ไม่ค่อยแข็งแรง ไม่กลม และขรุขระ ทำให้ตอนกลิ้งนั้นลูกบอลเสียรูปทรง บานออกบ้าง และจากการที่ผิวด้านในลูกบอลไม่เรียบ ทำให้ก้านกลไกหัวมีการสะดุด จังหวะที่สะดุดมีผลให้หัวหลุดออกจากลำตัว T_T นอกจากนี้น้ำหนักที่ถ่วงก็ยังเบาเกินไป ไม่สามารถถ่วงให้กลไกตั้งตรงตลอดเวลาได้ (แต่หนักกว่านี้ลูกบอลก็ไม่ไหวแล้ว) ถ้าปรับปรุงตัวลูกบอลได้น่าจะทำให้การเคลื่อนไหวราบรื่นขึ้น

The result of building BB-8 is that, the mechanism works as expected. However, the ball isn’t strong enough, doesn’t round enough and doesn’t enough. The ball loose it’s shape. Also, the tilt mechanism hiccup on the rough internal surface, which make the head pop off. Moreover, the ballast isn’t heavy enough to maintain upright position. However, the ball couldn’t stands for heavier ballast. If we improve a manufacturing process of the ball, it would allow better motion.

สำหรับ code Arduino สามารถดาว์นโหลดไปดูกันได้ตามนี้ครับ code ส่วนควบุคมกลไก, code ส่วนเล่นเสียง

Arduino code for controlling mechanism can be downloaded from here and the code for MP3 player can be download from here.

รายการซื้อของที่ใช้ทำเจ้า BB-8 ตัวนี้ (อาจจะดูใช้งบประมาณเยอะ แต่หลายอย่างใช้ของถูกลงกว่านี้ได้ เช่น รีโมทและตัวรับสัญญาณ R/C และอุปกรณ์หลายอย่างสามารถนำไปใช้งานอื่นต่อได้)

Below is buying list.

ทำเสร็จก็เอาไปออกงาน Bangkok Mini Maker Faire มีน้อง ๆ ให้ความสนใจเป็นจำนวนมาก

BB-8 at Bangkok Mini Maker Faire.

Image00002_resized

Image00003_resized

Image00001_resized

ใครสนใจก็ลองทำดูแล้วมาแลกเปลี่ยนเทคนิคและประสบการณ์กันได้นะครับ 😀

Let’s try building your own BB-8 and share what you made 😀

** บทความนี้เป็นส่วนหนึ่งของบทความชุด Build Your Own Bot แนะนำการสร้างหุ่นยนต์ด้วยตัวเอง **

LINE it!