Update January 6

Hello there!

In Christmas I had a little more time to improve DIMER, improvements have been mainly two; motor drivers and two potentiometers to know their position and power programming.

Drivers:

In Bilbao maker fair another maker told me he had just found a few drivers with high power and could be controlled from the aruino directly.

Turns out they were the IBT-2, these drivers can be find on many websites and can get it for about $ 9.

According to the sheet the maximun intesity is 30 amps and 27 volts, also making the change of direction of motor, all directly from PWM.

20160106_011612_Richtone(HDR)

So I bought it and searched for some code to move. it is very easy, just send 0-255 values ​​for PWM channel while the other put it to 0. So I replaced the old drivers quickly, they were much worse, and besides saving me from the servos moving potentiometer of the driver and relays for changing direction. So now the base is clearer.

20151115_235210

(before and after driver changes)

20160106_011624

Potentiometers:

Obviously I need DIMER can be programmed to do repetitive tasks or certain actions, so I needed to know their position at all times. For this I put a few potentiometers in the shoulder and elbow angles, I use potentiometers because they are very easy to use and also none of my angles is greater than 180 degrees.

So put the two he needed, the elbow is much more accessible than the shoulder, since you can tie directly to the shaft as shown in the image.

20160106_011643The shoulder was a little more complicated, finally had to put an aluminum foil and hot glue to secure it to the shaft, this is because they did not have any parts on hand to hook, but I will make a 3D part.

20160106_011635Here you have the first video I made with the code, it moves from one angle to another of the shoulder.

The code is very simple, you you indicate that joint angles and want to move, with a couple of simple loops DIMER knows how much has to move and in which direction. Part I found it online and then adapted it to my needs.

I leave here, I probably another way to do it more efficiently to happen, but for now it works and part of debugging code and the will to finish it all.

With this development is DIMER updated.

See you soon!

// Only  share Void loop, the setup is simply declare variables and start the Serial 9600.

//lectura posicion codo
posicion2 = map(analogRead(A4), 0, 1023, 180, 0);
posicion3 = map(analogRead(A7), 0, 1023, 0, 180);
Serial.print(” H “);
Serial.print(posicion3, DEC);
Serial.print(” C “);
Serial.println(posicion2, DEC);

//programacion movimientos:
if(Serial.available() >= 1)
{
/*
1- Leer un numero entero por serial
2- Calculamos su modulo por 10 (sera el numero del motor)
3- Dividir el entero inicial por 10
4- Lo que quede, sera la posicion del motor
*/
enviado = Serial.parseInt();
num = enviado%10;
enviado = enviado/10;
posicion = enviado;

//aqui bajamos el codo hasta que llega al angulo correcto

if(num == 1) //quiere decir que queremos mover el codo
{
if(posicion>posicion2){
do{
analogWrite(LPWM_Output, 0);
analogWrite(RPWM_Output, 50);
posicion2 = map(analogRead(A4), 0, 1023, 180, 0);
Serial.print(“bajando hombro “);
Serial.println(posicion2, DEC);
}
while(posicion2 < posicion);
}

//aqui subimos el codo hasta que llega al angulo correcto
if(posicion<posicion2){
do{
analogWrite(LPWM_Output, 50);
analogWrite(RPWM_Output, 0);
posicion2 = map(analogRead(A4), 0, 1023, 180, 0);
Serial.print(“subiendo codo “);
Serial.println(posicion2, DEC);
}
while(posicion2 > posicion);
}

//aqui paramos los motores al llegar al angulo correcto
analogWrite(LPWM_Output, 0);
analogWrite(RPWM_Output, 0);
}

if(num == 2)//quiere decir que qeuremos mover el hombro
{

//aqui bajamos el hombro hasta que llega al angulo correcto
if(posicion>posicion3){
do{
analogWrite(LPWM_Output2, 0);
analogWrite(RPWM_Output2, 50);
posicion3 = map(analogRead(A7), 0, 1023, 180, 0);
Serial.print(“bajando hombro “);
Serial.println(posicion3, DEC);
}
while(posicion3-5 < posicion);
}

//aqui subimos el hombro hasta que llega al angulo correcto
if(posicion<posicion3){
do{
analogWrite(LPWM_Output2, 50);
analogWrite(RPWM_Output2, 0);
posicion3 = map(analogRead(A7), 0, 1023, 180, 0);
Serial.print(“subiendo hombro “);
Serial.println(posicion3, DEC);
}
while(posicion3-5 > posicion);
}
//aqui paramos los motores al llegar al angulo correcto
analogWrite(LPWM_Output2, 0);
analogWrite(RPWM_Output2, 0);
}

//aqui paramos en caso de emergencia
if(num == 3) // parar todo
{
analogWrite(LPWM_Output, 0);
analogWrite(RPWM_Output, 0);
analogWrite(LPWM_Output2, 0);
analogWrite(RPWM_Output2, 0);
}

}

Anuncios