If everything works well we can develop the machine in a way that the setting of the angle can be automatized as well. Another implementation that can be done is changing the motor speed by using potentiometer. It is possible to implement the idea and have multiple bandings as well.
I got a brief information about the motors and drivers in Arduino Project Hub page
Basically, it says :
On Dronebot Workshop website (which I would highly recommend) I found more detailed information about the working principles of the DC motors. According to the information there, you can’t just connect a DC motor to one of the output pins of your Arduino and expect it to work. DC motors have current and voltage requirements that are beyond the capabilities of your microcontroller or microcomputer. It is necessary to use some external electronics to drive and control the motor, and you’ll probably need a separate power supply as well.
In a simple DC motor there are two main components, the “stator” and the “armature”. The stator is a permanent magnet and provides a constant magnetic field. The armature, which is the rotating part, is a simple coil.
The armature is connected to a DC power source using a 2-piece ring installed around the motor shaft, these ring sections are called “commutator rings”. The two pieces of the commutator rings are connected to each end of the armature coil. Direct Current of a suitable voltage is applied to the commutator rings via two “brushes” that rub against the rings.
When DC is applied to the commutator rings it flows through the armature coil, producing a magnetic field. This field is attracted to the stator magnet (remember, opposite magnetic polarities attract, similar ones repel) and the motor shaft begins to spin.
The motor shaft rotates until it arrives at the junction between the two halves of the commutator. At that point the brushes come into contact with the other half of the commutator rings, reversing the polarity of the armature coil (or coils, most modern DC motors have several). This is great because at this point the motor shaft has rotated 180 degrees and the magnetic field polarities need to be reversed for the motor to continue rotating. This process repeats itself indefinitely until the current is removed from the armature coils. (image credits https://dronebotworkshop.com/dc-motors-l298n-h-bridge/)
Better quality DC motors are the brushless variety. Brushless motors use a more complex arrangement of coils and do not require a commutator. The moving part of the motor is connected to the permanent magnet. Because they do not contain brushes these brushless motors will last longer and are also much quieter than brushed DC motors. Most quadcopter Motors are brushless motors.
To reverse the direction in which the DC motor rotates you simply reverse the polarity of the DC current that you apply to it.
Now that we know how DC motors work, how you can reverse their direction by changing polarity. There is an easy way to do this using a very common circuit configuration called an “H-Bridge”. An “H-Bridge” is simply an arrangement of switching the polarity of the voltage applied to a DC motor, thus controlling its direction of rotation using transistors. Using transistors also allows you to control the motor speed with PWM.
In the first diagram we can see four switches which are all in the open or “off” position. In the center of the circuit is a DC motor. If you look at the circuit as it is drawn here you can distinctly see a letter “H”, with the motor attached in the center or “bridge” section – thus the term “H-Bridge”. If we close (i.e. turn on) two of the switches you can see how the voltage is applied to the motor, causing it to turn clockwise. If you open those switches and close the other two, this causes the polarity of the voltage applied to the motor to be reversed, resulting in our motor spinning counterclockwise. (image credits https://dronebotworkshop.com/dc-motors-l298n-h-bridge/)
Luckily, I didn’t have to use an H-bridge, because the Arduino motor shield has built-in H bridges, which can drive several motors. You have to connect the DC motor to one of the channels (A or B) and by addressing special pins you can select a motor channel to initiate, specify the motor direction (polarity), set motor speed (PWM), stop and start the motor, and monitor the current absorption of each channel. Here are the assigned pins and their functions
Function | Channel A | Channel B |
---|---|---|
Direction | Digital 12 | Digital 13 |
Speed (PWM) | Digital 3 | Digital 11 |
Brake | Digital 9 | Digital 8 |
Current Sensing | Analog 0 | Analog 1 |
Limit Switch
The next component, which was new for me, is the limit switch or microswitch. The video below is explaining how it works.
I have used an LCD and a piezo transducer during the output devices week. This time I will use a buzzer instead of the piezo transducer, but the working principles are very similar for both of them. Here you can find the information about their similarities and differences.
We decided to add our names on the board as well, so using the
Text
“Dilijan Fablab”
And here is the trial video of the electronics with the Arduino shield
February 3, 2022