globalrevweek12

parent 1d673303
Pipeline #111930 passed with stage
in 37 seconds
This diff is collapsed.
int motor1=7;
int motor2=8;
int pote=A1;
int valorpote;
int pwm1;
int pwm2;
void setup()
{
pinMode(motor1,OUTPUT);
pinMode(motor2, OUTPUT);
}
void loop()
{
valorpote=analogRead(pote);
pwm1 = map(valorpote, 0, 1023, 0, 255);
pwm2 = map(valorpote, 0, 1023, 255, 0);
analogWrite(motor1,pwm1);
analogWrite(motor2,pwm2);
}
Fotos/Week12/global1.JPG

57.1 KB | W: | H:

Fotos/Week12/global1.JPG

74.1 KB | W: | H:

Fotos/Week12/global1.JPG
Fotos/Week12/global1.JPG
Fotos/Week12/global1.JPG
Fotos/Week12/global1.JPG
  • 2-up
  • Swipe
  • Onion skin
Fotos/Week12/global2.JPG

57.1 KB | W: | H:

Fotos/Week12/global2.JPG

85.6 KB | W: | H:

Fotos/Week12/global2.JPG
Fotos/Week12/global2.JPG
Fotos/Week12/global2.JPG
Fotos/Week12/global2.JPG
  • 2-up
  • Swipe
  • Onion skin
Fotos/Week12/global4.JPG

19 KB | W: | H:

Fotos/Week12/global4.JPG

19.7 KB | W: | H:

Fotos/Week12/global4.JPG
Fotos/Week12/global4.JPG
Fotos/Week12/global4.JPG
Fotos/Week12/global4.JPG
  • 2-up
  • Swipe
  • Onion skin
......@@ -176,13 +176,107 @@ else {<br>
<center><iframe width="560" height="315" src="https://www.youtube.com/embed/64qyyidJ-TY" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></center>
<br>
<h1 class="my-4" align>
<br>
<br>
<small> UPDATE</small>
<br>
<br>
</h1>
<center><p>
During the week of the assignment I had problems machining my electronic board, and after many attempts I got a board to work, but I did not cut it because I wanted to see if it worked well, besides, the jack was not SMD so I ended up using cut pinheads, which did not look very good. <br><br>So I decided to make a better plate, and that allows me to have an analog signal to use it input to control the motor with PWM, so I made a new one and added a potentiometer, in addition, I corrected the errors of the previous one, and now I know Change the mill, it seems that when I made my previous board it was worn out.<br><br>
As you can see in the schematic design, I added a potentiometer and removed the button, because I wanted to use an analog signal.</p></center>
<br>
<img class="centrado" src="Fotos/Week12/global1.JPG" width="1080" >
<br>
<center><p>
I did not find an SMD potentiometer so I used a trough hole. This time I managed to make a smaller board.</p></center>
<br>
<img class="centrado" src="Fotos/Week12/global2.JPG" width="720" >
<br>
<center><p>
This time I worked with the board on one corner, to cut it and that others can use the rest of the copper plate
</p></center>
<br>
<img class="centrado" src="Fotos/Week12/globalboardv2.png" width="720" >
<br>
<img class="centrado" src="Fotos/Week12/global4.JPG" width="720" >
<br>
<center><p>
I soldered the electronic board using the heat gun, as always. Except the potentiometer, for this I used captive or electric soldering iron, and tin in roll. This is the result.
</p></center>
<br>
<img class="centrado" src="Fotos/Week12/global5.jpg" width="720" >
<br>
<img class="centrado" src="Fotos/Week12/global6.jpg" width="720" >
<br>
<center><p>
After burning bootloader using the ISP as the previous board, I programmed using the arduino IDE, first I declare the variables and pins, the output pins will go in 7 and 8 which is the arduino equivalence of the pwm pins 5 and 6 of the attiny44, in addition the potentiometer will be in the analog input 1. I create a variable for the analog reading of the potentiometer, and in pwm1 I use the map function to find the equivalence between the input range of the potentiometer (0-1023) and the output (0 -255). And in the variable pwm2 upside down (255-0), with this I will control the direction of rotation using the potentiometer and also the speed through the pulse width modulation.
</p></center>
<br>
<img class="centrado" src="Fotos/Week12/global7.JPG" width="" >
<br>
<center><p>
basically I play with the frequency and the duty cycle to create an analog signal from of a digital. For more information about PWM <a href="https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019OkFSAU">visit this link</a>
</p></center>
<br>
<img class="centrado" src="Fotos/Week12/pwmimagen.jpg" width="480" >
<center><p>
int motor1=7;<br>
int motor2=8; <br>
int pote=A1; <br>
int valorpote; <br>
int pwm1; <br>
int pwm2; <br>
void setup()<br>
{<br>
pinMode(motor1,OUTPUT);<br>
pinMode(motor2, OUTPUT);<br>
}<br>
void loop()<br>
{<br>
valorpote=analogRead(pote);<br>
pwm1 = map(valorpote, 0, 1023, 0, 255);<br>
pwm2 = map(valorpote, 0, 1023, 255, 0); <br>
analogWrite(motor1,pwm1);<br>
analogWrite(motor2,pwm2);<br>
}<br><br><br><br>
Here a video of the result
</p></center>
<center><iframe width="560" height="315" src="https://www.youtube.com/embed/NMX2jGhVdF8" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></center>
<h1 class="my-4" align> <small> Group assignment</small>
<br>
</h1>
<center><p> The group assignment for this week was to measure the power consumption of an output device.<br><br> My personal contribution was to measure the current consumption of DC MOTOR JGA25-371. I designed and fabricated this board. The value obtained is 0.129mA, this is due to the programing and the encoder that motor has. The motor was programmed to turn on when the input button is pressed.</p></center>
<center><p> The group assignment for this week was to measure the power consumption of an output device.<br><br> My personal contribution was to measure the current consumption of DC MOTOR JGA25-371. I designed and fabricated this board. The value obtained is 0.129mA, this is due to the programing and the encoder that motor has. The motor was programmed to turn on when the input button is pressed.
To measure the consumption we needed to measure the circuit in series so what we did was connect the jumper GND of the motor to the board in its respective output, connect a loose jumper to the other output of the board, and another jumper loose in the other input of the motor, then we closed the circuit by connecting the test leads of the multitester to the jumpers, while someone pressed the button. And the value mentioned above was shown.</p></center>
<br>
<img class="centrado" src="Fotos/Week12/groupassgin.JPG" width="480" >
......@@ -209,7 +303,19 @@ else {<br>
<a href="Fotos/Week12/boardOUTPUTDC.png">PNG board</a>
<br>
<a href="Fotos/Week12/OUTPUTProgramacion.ino">Code file in Arduino </a>
<a href="Fotos/Week12/OUTPUTProgramacion.ino">ON/OFF Code file in Arduino </a>
<a href="Fotos/Week12/OUTPUTDCglobal1.sch">Schematic Boardv2</a>
<br>
<a href="Fotos/Week12/OUTPUTDCglobal1.brd">Board Designv2</a>
<br>
<a href="Fotos/Week12/globalboardv2.png">PNG boardv2</a>
<br>
<a href="Fotos/Week12/PWM/PWM.ino">PWM Code file in Arduinov </a>
</small>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment