- EXTERNAL COMPONENTS: The hardware needed to complete this project can be bought as a PROJECT SET by clicking HERE…
- NOTE: You will also need to purchase the Microbit (K2-MB) and a Driver Board (K2-5620) as these items can be employed in more than one project and therefore are sold independently. Click on the respective links to buy.
- NOTE: For this project you require a mobile device using Android version 4.4 or higher (no Apple /iOS version yet available…). Before printing, make sure to check compatibility and the successful installation of the Microbit Blue App on your device (see Instructions)
- Requires 4x AAA batteries
The operation of WHEELER is formed by the combination of four small systems: TRACTION, STEERING, POWER and CONTROL. This Diagram is an overall representation of how these connect with each other. The specific functions of each system are explained below:
TRACTION: responsible for the motion of the vehicle, the traction is formed by connecting the main motor to the traction wheel through a series of gears. The gears help to achieve enough force at the back wheel by increasing the torque that is delivered by the motor at the expense of reducing the rotational speed (gear reduction). The traction wheel has 74 teeth and is 3D-Printed, making the overall gear ratio 1:266.4 (…yes, don’t expect high velocities with WHEELER). In order to account for a variation in 3D-Printing accuracy, the traction wheel position is made adjustable by the use of two plugs (shaft caps) and screws at the back of the arrangement. This guarantees meshing with the gear on the shaft despite the stacking up of tolerances.
STEERING: in this system, a motor rotates forward and backward to adjust the angle of the front wheels and hence the direction of the vehicle. A gearbox with a total reduction ratio of 1:36 is used to slow down the turning rate of the wheels and make WHEELER more controllable (… and though that is the case, the steering rate is still too fast!). The front wheels are attached to forks each having a turning axis. The axis of the left fork is connected to the steering gearbox (a.k.a. “GBX2”) by the meshing of two conical gears that allow transmission of motion from a horizontal axis to a vertical one. Because the motor connects (indirectly) only to the left fork, extensions are employed to plug a steering rod from the left fork on to the right so that movements at the left wheel are mimicked by the right wheel.
POWER: The power of WHEELER comes from the connection in series of four AAA batteries with a supply voltage of 6v. It is very important to understand how power flows. The batteries are connected directly to the Drive Board (K2-5620) which manages and feeds the right power to each system. The board supplies the Microbit (K2-MB) with 3v and both motors at the TRACTION and STEERING systems with 6v. The operation of the board requires a supply voltage ranging from 4.5v to 6v but given the weight of WHEELER we are required to operate at the highest limit. Notice that this power is strictly used for the onboard components. Although minimum, the control from the mobile device requires of its own source of power to produce the communication signal.
PLEASE NOTE: when not in use, NEVER LEAVE the Microbit (K2-MB) inside the board as these will deplete the batteries (you will see why in the next section).
The TRACTION motor is connected to pins “P8” and “P12” of the board, which correspond to the same pin numbers of the Microbit. At command, one pin is supplied with a voltage and the other left at zero to cause motor rotation. The opposite is done to cause the motor to turn in the opposite direction.
The STEERING motor is connected to pins “P0” and “P16” of the board which are of the analog type. The pins are supplied with a voltage signal (see PWM on “LEARN”) to produce motor rotation at a controlled rate.
CONTROL: The controlling of WHEELER happens in two different stages: i) the commands produced at the mobile device and ii) the reception and processing of these commands by the Microbit onboard.
– MICROBIT: In the LEARN section, we explain the difference between ANALOG and DIGITAL pin outputs. In basic terms, the Microbit acts as a brain by processing the commands received from the mobile device and transforming them into “switching” actions at the pins. The final objective is turn on and off the motors at the TRACTION and STEERING systems with the difference that for the STEERING motor, we also want to control the amount of power that flows into it (faster or slower turning).
This FILE (.jpeg) is a representation of the script to be loaded onto the Microbit and used for the controlling of WHEELER. It’s coded using PTX block editor with each of the blocks performing the following actions:
A. Displays the text “WHEELER” at the microbit LED grid when the Microbit is first turned on
B. When a Bluetooth connection is stablished, the letter “C” (for connected) is displayed and the variables “drive”, “DC” and “INCR” are initialized. The variable “Drive” is used to catch an event when the buttons controlling the STEERING are pressed. “DC” represents the pulse width value of the analog signal to go into the steering motor. “INCR” is the amount by which this value is increased or decreased at the given command to vary the turning rate of the STEERING system.
C. In case of Bluetooth connection loss, all outputs to the motors are set to zero voltage so that the vehicle stops where the disconnection occurs. Also the letter “D” is displayed on the Microbit LED board.
D. If button 1 is pressed, the value of DC is increased by 50 ( = INCR)
E. If button 2 is pressed, the value of DC is decreased by 50 ( = INCR)
F. Through I. If buttons A or B are pressed, voltage is supplied to pin 8 or pin 12 respectively, making the TRACTION motor to rotate in one direction or in the opposite. If any button is “lifted”, the supply of any voltage to the motor terminates.
J Through L. If buttons 3 or 4 are pressed an action to send a voltage signal to the STEERING motor is recorded in the variable “drive” as a “1” or a “2” respectively. If any of these buttons is lifted, “drive” is set to zero
M. This block represents a loop done permanently (“Forever”). It constantly assesses the value of the variable “drive” and acts accordingly: it sends an analog signal to pin 0 if drive =1 (button 3 pressed) with a duty cycle value as the value stored at the variable “DC”. This causes the STEERING motor to rotate in one direction. If drive=2 (button 4 pressed) then the signal is sent to pin 16 triggering opposite rotation. Due to the “permanent” cycle, if the Microbit is left connected to the board (K2-5620) the energy of the batteries will be depleted even when WHEELER has not been moving.
BEFORE YOU BEGIN: you should be comfortable executing the following:
-Loading scripts (.hex) files onto your Microbit via USB
-Coding or editing coding scripts (.hex) at the Microbit “Let’s code website”
-Following the pairing sequence to connect your mobile device to your Microbit via Bluetooth (see Component Datasheet)
-Making sure your mobile device runs on Android 4.4 or higher
-Testing and using your Motor Driver Board (K2-5620, see Component Datasheet)
1. Download and install the open source APP “Microbit:blue” by Martin Wooley from Google Play Store (free).
2. Download the “Microbit-WHEELER_vX9.hex” for your Microbit HERE (Downloads as .zip file)
3. Using your USB cable, load the .hex file onto your microbit.
3D PRINTING AND POST-PROCESSING
1. Before Printing any other part, make sure that you can accurately print the traction wheel (01-WHEELER). The teeth on it must be able to mesh without obstruction with gear K1-G30. Use PLA for good results.
2. Print the rest of the components and post-process accordingly by following the print settings suggestions.
3. For each part, run the list of features below to make sure they fit to its corresponding counter-part/component. Use a metal file to open-up slightly until a satisfactory fit is achieved:
a. Has Dovetails?
b. Has Holes for metal shafts (K1-S2, K1-S3)?
c. Uses Self-Threading Holes for Screws K1-F8,F12?
POWER: (Refer to sheet 1 of the Drawing)
1. Cut and crimp the wires to the length shown in the Picture
2. Prepare the bare end of each wire to successfully fit the Driver Board (k1-5620) screw-terminals by cutting a few strands and twisting the remaining ones together. The wire is too thick for the board terminals.
3. Insert 4x Battery Holders (06-WHEELER) into the slots of the Body (05-WHEELER) in the orientation shown by sheet 1 of the Drawing and in this picture.
4. Attach securely the terminal of Wire W1 to the tab of negative contact (K3-NCON) and fit the contact into the corresponding slot at the back of the Body (05-WHEELER) shared by the Battery Holder (06-WHEELER). See this picture.
5. Insert the rest of the contacts in the sequence shown in sheet 1 of the Drawing
6. WARNING: Insert all four AAA batteries into corresponding battery holders by following the indicated polarity FAILURE to do so can result in Driver Board (K2-5620) damage due to reverse polarity.
7. Insert Left (08-WHEELER) and Right (09-WHEELER) ARMS into the body front dovetails and use K1-F12 to screw on both sides.
TRACTION (refer to sheet 2 of the Drawing)
1. Assemble gears onto shafts and motor at the axial positions indicated on sheet 2 of the drawing.
2. At the back of both motors K1-M1 and K1-M2, locate the positive sign terminal and mark as shown in the picture
3. Fit the Ring Lock (20-WHEELER) onto motor K1-M2 at the axial location indicated by the drawing.
4. Insert shafts and motor into A-Frame (02-WHEELER) in the following sequence: SHAFT2, SHAFT1, MOTOR. Both Shafts and Motor fit the A-Frame by means of a snap fit which is achieved by pressing hard the shaft/motor until it falls into position. After completing, make sure that the ring tab on the motor points upwards as shown in the picture.
5. Fit screw K1-F8 and Nut K1-NT into the corresponding locations of the traction wheel (01-WHEELER) and use the tool slot to slightly (NOT FULLY) tighten-up.
6. Insert shaft K1-S3 onto the wheel (01-WHELLER) and use shaft Caps (03-WHEELER, 04-WHEELER) at both ends of the shaft.
7. Slide two nuts K1-NT at the slots on both ends of the A-Frame and plug the shaft caps into the hexagonal holes at the end of the frame.
8. Use a long screw K1-F12 at each end to attach the shaft caps to the A-Frame. Tighten until a good meshing occurs between the traction wheel teeth (01-WHEELER) and gear K1-G30 of Shaft2. DO NOT OVERTIGHTEN as this will put too much load on the motor. Notice that the arched springs featuring at the sides of the Shaft Caps (03,04-WHEELER) get deformed. This is intentionally done by design to keep the screws loaded against their corresponding nuts and avoid loosening due to vibration.
9. Adjust the axial position of the wheel with respect its own axis to leave enough clearance for the gear to the left of it. Then tighten the wheel screw through the nut slot.
Finally make sure everything works by performing a hand rotation to the wheel and making sure meshing is neither tight nor loose.
STEERING (see Sheet 3 of the Drawing)
1) Insert a pair of screw K1-F8 and Nut K1-NT into each shaft tab on the following printed parts: Wheel (11-WHEEL), Conical Gear 2MM (16-WHEELER), Conical Gear 3MM (18-WHEELER) and Lock (17-WHEELER). Tighten enough to prevent the nut from falling off the screw but still allowing the corresponding shafts to go through.
2) Assemble the gears on to the Shafts and Motor as shown in Sheet 3 of the Drawing.
3) Assemble the Gearbox 2 as shown in the Drawing. Give a free spin to any shaft and make sure gear meshing is neither tight nor loose. If too tight, disassemble and open-up slightly shaft bearing holes with a metal file.
4) Insert the motor K1-M1 into the gear box and secure using screw and nut K1-F8 and K1-NT.
5) Insert a shaft K1-S3 into each front wheel core and roughly locate the wheel at equal distance from each shaft end.
6) Snap fit the wheels (11-WHEELER) into their corresponding Fork (09-WHEELER) location. NOTE: do this by pressing only the shaft end into the fork as shown. If done by pushing the wheel, the core of it will break. Once in position, secure the Wheel to the shaft by tightening the screw. Leave enough clearance at both sides of the fork to prevent rubbing.
7) Insert a shaft K1-S3 into the top of each fork (09-WHEELER). Then insert an extension (10-WHEELER) into each fork and lock by using a long screw K1-F12 and a nut K1-NT on the back tabs of the extension. This will tighten the fork grip around the shaft.
BRINGING IT ALL TOGETHER (sheet 4 in Drawing)
NOTE: before carrying on, make sure that the battery polarity is correct. Inverse polarity connection will damage your driver board K2-5620. The negative terminal faces the back of the body and the positive the front.
1. Insert the TRACTION assembly by mating the A-Frame (02-WHEELER) onto the back of the Body (05-WHEELER) from the bottom to the top (will not fit the other way around). Secure by attaching screws K1-F12 at right hand side tab and at the motor ring lock (bring tab in touch with the body).
2. Open up all terminal connecting blocks of the Driver Board K2-5620 by unscrewing the set screws it them (bring up, do not unscrew fully).
3. Screw wire 2 to the power block of the board (K2-5620) next to the label “Black –“.
4. Screw wire 1 to the positive terminal on the same block of K2-5620 right next to label “Red +”.
5. Plug wire 1 spade terminal to the positive tab at the front of the Body (05-WHEELER)
6. Attach the board K2-5620 together with Wire Lid (19-WHEELER) in the Body (05-WHEELER) in the shown position. Bend wires 1 and 2 as needed.
7. Insert wires 3,4 through the front window of the wire Lid (19-WHEELER) by crossing them transversally through the body. The bare terminals must end at the right side of body and the spade terminals at the left. Repeat for wires 5,6 at the back window.
9. Insert GBX2 at the dovetail slot on the front of the body and attach the set screw into the hole without tightening fully (see pic)
10. Connect all motors by following the polarity in the diagram and the guidance of the marked positive terminal in the motors.
11. With the script already loaded into the Microbit (K2-MB), plug the Microbit into the board slot connector with the LED array facing the terminal blocks of the board. The legend “WHEELER” should display on the microbit.
12. Place cart on a surface to function as a test-bed and run the test sequence in the section below:
1. Connect the Microbit and your mobile device through Bluetooth
2. Start the “Microbit blue” APP and click on “look for paired devices”. Choose your microbit. If effectively connected, this will change the display on the LED array to the letter “C”.
3. Test buttons A,B by seeing the traction wheel spin forward or backward. Test buttons 3 and 4 by verifying the rotation of the Gear Box motor back and forth.
4. TROUBLESHOOT: if any of the motors fails to move check that:
-Bluetooth connection was established properly (“C” letter on LED’s)
-Script was properly loaded to Microbit (“WHEELER” legend at start)
-Gear meshing being too tight. Remove motor from position and check for rotation without gear meshing.
-Wires and electrical connections properly fixed
– Battery polarity
1. Insert the left hand side fork into the hole of the left Arm (07-WHEELER) by passing the shaft through the Conical Gear 3MM (18-WHEELER). Tighten the screw in the shown position (important).
2. Repeat for the right fork and Arm (08-WHEELER) by passing through Lock ( 17-WHEELER).
3. Attach the Steering Rod (12-WHEELER) to each Extension (10-WHEELER) with screws K1-F12.
4. Tighten Lock (17-WHEELER) around the right fork’s shaft by setting the steering angle on both wheels to be about equal. Move the rod towards one end and towards the other until both angles are the same.
5. Loosen the the Conical Gear 2MM (16-WHEELER) in GBX2. Make the screw head to face upwards and slide the gearbox close to the left arm until meshing of the conical gears occurs. Fiddle a bit with the Conical Gear 2MM to guarantee good meshing. Meshing must not be tight. Note that the location of both screw heads must be timed as shown in the picture so that these heads do not clash at any given angle of steering. Tighten the gear screw on to the shaft.
6. Secure the axial location of GBX2 by tightening the set screw at the base of the dovetail (see pic)
7. Test: repeat the sequence in the above section. If everything worked in the previous test but not anymore, troubleshoot by doing the following:
-Make sure that the steering system is free and not too tight to rotate. If that is the case, open up the holes in both arms so that the fork axis can rotate freely.
-Check that the Steering rod has not been clamped to the extensions by loosening the connecting screws.
– Make sure that the conical gears are meshing correctly without any obstacles that prevent their free rotation.
– Make sure that the batteries have not been drained overnight by the action of the Microbit left connected to the board.
By now you should be familiar with the pin arrangement of the Microbit. The idea is to use these pins as some form of switches that, at our command, turn on or off the motors at the TRACTION or STEERING system. Pins however can act in more useful ways than simple on/off connections. These can produce a signal (periodic voltage variation over time). Pins with such capability are referred to as “ANALOG” (pins acting just as on/off are called “DIGITAL”). In the STEERING system, this signal capability is exploited to vary the amount of power given to the motor making the steering of the wheels to be faster or slower (adjustable control). The principle is the following:
It all begins with the supply of a voltage “signal” rather than a continuous voltage to the STEERING motor. A voltage signal is a voltage that varies with time periodically (pretty much like turning a switch on and off at fixed time intervals). In our application, the voltage signal received by the motor looks like this plot. The motor receives a “pulse” of voltage every period “T”. For these signals to work, the periods are extremely short and measured in milliseconds (20 ms is a common period duration in modern electronics). The ratio of the pulse duration to the total period duration is a parameter known as “Duty Cycle – k” and can be expressed as a percentage (100% for a fully continuous voltage and 50% for a pulse that is on half the period).
k = Duty Cycle [%], PW = Pulse Width Duration [ms], T = Period [ms]
Although we won’t prove it here, it can be shown that if we were to average the value of the voltage seen by the motor through a time period, this would be strictly proportional to the duty cycle.
Vave = Average Voltage received by the motor [v ], k=Duty Cycle [%], Vs = Voltage of the source [v]
Because the speed of the DC motor is proportional to the supplied voltage, we can control how fast the motor spins by simply changing the duty cycle. For a signal in which the period does not change, this represents changing the duration of the pulse (hence the name Pulse Width Modulation -PWM). This is what Microbit does, it outputs an “analog” signal with a given Duty Cycle that can range from 0% to 100%. In our script, we command Microbit to perform an “Analog Write” with a value that goes from 0 to 1023 (the reason for this number is because 100% in 8-bit coding equates to the number 1023).
Following on from the idea of average supplied voltage, we can think of the motor being a highly inductive load (ie, the current through it is maintained more or less continuous through the on and off switching process). If this current is I, the equivalent Power seen by the motor is equal to the equivalent voltage times the current.
P = power [w],Vave = Average Voltage received by the motor [v ], I = current through the motor [A], k=Duty Cycle [%], Vs = Voltage of the source [v]
Power is hence also controlled by changing the width of the pulse.
You have partial access to this project. To get full access signup as a member