As part of this blog post my idea was to post the final steps to build the Bluetooth maze, that is putting the 3D printing and laser cutting components together and have the servo mechanism moving, but I ran into a couple of problems. Basically I have found the the MDF top sheet that I have laser cut which would have the marble roll around is too heavy for the 3D printed servo mechanism, and it snaps the blue printed parts , and the one you see in the picture below are the 3rd version and are much more beefy. This meant I had to rethink my design and try a bunch of things this week to get it working, with little success. So finally after watching a couple or motivational video on the youtube’s , I mustered up the courage and took the mechanism to my local maker space to get some suggestion, and spoke to folks who work on CNC and machining parts, and they had a bunch of suggestion. And the one suggestion, I think I am going to try over the weekend is to have the top plate set on a circular metallic ball , with some 3D printed parts and simplify my 3D printed servo mechanism.
As of now I have got the servo mechanism working and moving when I tilt the MicroBit on the pitch and roll axis and sending data via Bluetooth-UART as you see in the picture above. Here is the code that I used on the Beaglebone black wireless to move the servos on the pitch and roll values axis...
#07142018 testing Beaglebone Wireless with servo import Adafruit_B import Adafruit_BBIO.ADC as ADC import time servo_pinL = "P8_13" servo_pinS = "P8_19" sensor_pinHOR = 'P9_36' sensor_pinVER = 'P9_38' ADC.setup() duty_min = 3 duty_max = 11 duty_span = duty_max - duty_min PWM.start(servo_pinL, (100-duty_min), 50.0) PWM.start(servo_pinS, (100-duty_min), 50.0) whileTrue: readingHOR = ADC.read(sensor_pinHOR) readingVER = ADC.read(sensor_pinVER) print("ADC HOR: "+ str(readingHOR) + " ADC VER: "+ str(readingVER)) angleHOR = readingHOR * 180 angleVER = readingVER * 180 if angleHOR > 180: PWM.stop(servo_pinL) PWM.cleanup() break if angleVER > 180: PWM.stop(servo_pinS) PWM.cleanup() break angleflHOR = float(angleHOR) angleflVER = float(angleVER) dutyHOR = (angleflHOR / 180) * duty_span + duty_min dutyVER = (angleflVER / 180) * duty_span + duty_min print("duty servo HOR: "+ str(dutyHOR) + " duty servo VER: " + str(dutyVER)) PWM.set_duty_cycle(servo_pinL, dutyHOR) PWM.set_duty_cycle(servo_pinS, dutyVER) time.sleep(1)
Now based on the suggestion I mentioned above, my idea over the next couple of days is to find a metallic ball/ bigger marble to be placed just above the barcode price sticker on the bottom plate in the picture below, and have two 3D printed parts hold the ball between the top plate and the bottom plate, and I am hoping this takes the weight of the servo mechanism .