Automatic Gearbox
An automatic gearbox made from lasercut wood and driven by a steppermotor. A hall sensor measures the RPM rate and than sents a signal to a second stepper motor, which drives the linear actuator to change gears.
Supplies
DMF
Item
Ball bearings
2x stepper motor
Hall sensor
Magnet
3D fillament
Tooth belt
Spring
PVC
Potentiometer
2x arduino
Screw rod + bolt
2x SBC motodriver 2
Lasercutting the Gears
The following files were lasercut in such a way that they can be inserted onto an item schaft. The other half of the gears can be connected onto a second shaft (the output shaft). On the bottom shaft (input shaft) you also have to connect the tooth gear together with two stoppers. Put screws in between the gears so they won't slip off.
Constructing the Frame
Once you have the shafts with the gears connected, you can start making the frame. For the basis of the frame you connect four item rods, with four vertical rods. These rods will allow to connect the input and output shaft through the ball bearings.
Connecting the First Stepper
In order to connect the first stepper motor, you need to connect the first stepper motor to the item frame. The stepper motor has a 3D printed connector (see file). This way the connector and tooth gear are connected with a tooth belt. The stoppers will prevent the tooth belt from slipping off.
Downloads
Making the Linear Actuator and Output Shaft
Output shaft
With the input shaft put into place it is now time to construct the output shaft. The matching gears cut during step 1 can be assebled in the correct order. When placing the gears, ensure that there is enough spacing, so the gears will not jam when trying to move gears (since two gears might be connected at the same time). Tip: try to keep the distance on one shaft fixed (output shaft) and try to match the other shaft in an appropriate way.
In the middle of these gears a PVC tube that fits tight around the item is placed (diameter of 28 cm), with over this a PVC tube that is able to freely rotate (diameter of 32 cm). This second PVC tube is placed inside a laser cut connector (see file). Between the PVC centre and the first two gears, springs are connected. This way the gears have time to 'wait' for the teeth to match so it can shift gears. In the centre of the output shaft is a non rotating thin metal rod, which allows for a free rotation along the correct direction, while constraining rotational margins.
Linear actuator
Now the linear actuator needs to be constructed. In order to make this, the bolt needs to be screwed in the top hole of the connector. Through this the screw rod will be inserted, which in turn will be connected to a second stepper.
Downloads
Hall Sensor
The final piece of hardware is the Hall sensor, which will allow for the measurement of the rotational speed of the input shaft. Not everything needs to be complicated and the tachometer just consists of a magnet connected to the bottom (input shaft) and a Hall sensor taped close to this magnet.
Wiring and Coding the Arduino's
As explained before, we are using two arduino's. One arduino will only power the input shaft engine. The other arduino will actually do the measuring and shift gears appropriately.
Input arduino
This arduino is connected to the first (bottom) stepper, through port 8, 9, 10 and 11 with one SBC MotoDriver 2. An external source connected to the first breadboard (12V) will be connected to the 12V input of this MotoDriver. The ground will be connected to the ground of this source and the Vin connection on the arduino will be connected to the 5V input of the MotoDriver. Then a potentiometer to regulate the speed will have its + and - connected to the source and its output to the A0 pin on the arduino. Finally the MotoDriver will be connected to the four cables of the stepper.
Tip: Check the correct pairs of the cables, by checking between which cables there is a resistance using a multimeter these cables are the correct pair and should be connected on the same side.
Tip: If the stepper isn't working correctly try switching two cables of the same pair so the polarization is switched, otherwise the motor might try to make one step forward, followed by a step backwards, rather than in the same direction.
Linear actuator arduino
The MotoDriver of the second arduino will be connected in the same way with the MotoDriver. This breadboard is in turn connected to a second 12 V source. This arduino will however be connected to a hall sensor. This sensor is connected to the + and - and through a resistor into port 5 into the arduino.
Warning: allways be carefull when using a power source, check your circuit and don't touch any exposed electronics.
Code
Using code_Ins onto the linear actuator arduino and stepper_speedControl* code onto the input shaft code, you are now set to start it up.
Launch
Before launching the code, put the output shaft in the position closest to the linear actuator stepper engine. Now launch the code after a few rotations it should automatically go into first gear. Now you can change the speed through the potentiometer and the gearbox should automatically shift into the correct gear.
Tip: The distances in the code might not completely match with your distances, try changing the values in the matrix of code_Ins, so the gearbox shifts into the correct gear.
*Disclaimer: The stepper_speedControl.ino code is not my own code, but the example code of Arduino IDE. This same code can also be found through File -> Examples -> Stepper -> stepper_speedControl
Enjoy Your Gearbox!
You can now change the speed of the input shaft, through the potentiometer. The hall sensor will measure this and change the gears automatically!! Have fun.