Re-write Arduino UNO coding for H-Bridge?

Here you can ask general questions about sim building, not related to the various hardware sections

Re-write Arduino UNO coding for H-Bridge?

Postby xidsim1 » Fri 7. Mar 2014, 14:54

Hi can anyone help me/point me to link or something to learn how to re-write/modify the coding in Arduino UNO to a H-Bridge?

As it is a bit of a mine field in here of what to buy, where to buy it and the 'ups & downs' of this motion software and hardware.
Easily finding and buying suitable hardware is not that straight forward for a new, not so computer literate person wanting to use this, be aware newbies!

I am now needing to change the coding slightly to run my H-Bridge with Arduino UNO

Also, I have designed the motors to control individual axis. Motor 1= the x axis & Motor 2 = the y axis. both separately.

This also I think needs to be modified in the coding.

Any help, links or advice will be great! Even where to buy and the prices of H-Bridges etc. to make this work.

Thanks in advance!
xidsim1
 
Posts: 21
Joined: Mon 19. Nov 2012, 23:47
Has thanked: 0 time
Been thanked: 0 time

Re: Re-write Arduino UNO coding for H-Bridge?

Postby telfel » Fri 7. Mar 2014, 18:40

Hi
If your motors are 12volt and less than 30amps your best option is to use the Pololu 12v12 controller,
Or if your using 24 volt look at the Dimension Engineering Kangaroo Sabertooth option

Both these controllers have plugins to x-sim, both are virtually plug and play, not the cheapest option tho.

Regards Terry
User avatar
telfel
 
Posts: 108
Images: 54
Joined: Thu 22. Mar 2012, 19:05
Location: Borders Scotland UK
Has thanked: 2 times
Been thanked: 9 times

Re: Re-write Arduino UNO coding for H-Bridge?

Postby xidsim1 » Fri 7. Mar 2014, 22:12

Thanks Terry
Where can you buy these?
xidsim1
 
Posts: 21
Joined: Mon 19. Nov 2012, 23:47
Has thanked: 0 time
Been thanked: 0 time

Re: Re-write Arduino UNO coding for H-Bridge?

Postby adrianovrm » Fri 7. Mar 2014, 23:07

Have you saw this message below ?

Well, about a motor at each axis l cant Help cause l dont work this way
L think l can help you in using this H-brigde, it is excact the same h-brigde l use onto my project , it has a special to manage the pwm and CC and CCW movements. 
1. The jumpers must the close just at EA and CA . Leave EAB and CAB open, this are the jumpers near the conector bourne.
2. At conector Bourne we will have the PA and PB and EA and - . This 4 conectors must be connect to arduino like that:
PA : CC or CCW [0 or 1 logical] -> values 0 (low) and 255 (high) for arduino
PB : PWM Must be a PWM pin;
EA : ENABLE of the motor , always High for motor move 
- : Must be attached to the arduino gnd;

How the H bridge must be programmed at arduino:
Lets say that you use pin 13 for EA pin 8 for PA and 6 for PB,

So a simple code to make arduino move your motor ! 

//---- 
// the setup routine runs once when you press reset:
void setup() 

pinMode(13, OUTPUT);
pinMode(8, OUTPUT);
pinMode(6, OUTPUT); 
digitalWrite(13, HIGH); // enabling motor movement - when digitalWrite(13, LOW); motor doent move .
}

// the loop routine runs over and over again forever:
void loop() 
{
// moving CC of CCEW depending on connection of the terminal motors onto M1 and M2 point of the simple H
digitalWrite(8, HIGH);
analogWrite(6,0); 
delay(5000);
digitalWrite(8, LOW);
analogWrite(6,255); 
delay(5000);
// l dont know if xpid.ino is prepare to work with this simple H - cause each H have the way of commanding 
// is xpid.ino is not prepare to that - it will not work with the simple H . have to look the code 
// l have my own file (arduino.ino) - l just pick so fast code from xpid.ino - very few things - but logical is similar 
// but my code is much bigger cause it works with lcd - sdcards and keyboard . so it hard to you understand now - l 
// suggest a study of arduino programming - l think you will need . l have just teachers of arduino in portugueses but 
// sure you can find guys teaching arduino language and english in youtube. 
}

// obs - digitalwrite and digitalread commands are slow when compared with direct bit access, but it is advance for you // now - lets wire on things simple for now - to make you feel taste or blood heheheheh...
// ---------

adrianovrm 120 Tue 20. Nov 2012, 07:35 0 time 1 time
adrianovrm
X-Sim Supporter
 
Posts: 214
Joined: Tue 20. Nov 2012, 07:35
Has thanked: 0 time
Been thanked: 1 time

Re: Re-write Arduino UNO coding for H-Bridge?

Postby xidsim1 » Sat 8. Mar 2014, 15:03

Hi adrianovrm
Yes I saw the both messages thankyou!

Pictures so far... this is a slightly old picture but shows how the motors will be mounted. This will be fixed in base and upper chassis's when i get it running
rough set up of the motion chassis to test system


Here is the wiring of the H-Bridge, just in case you have not seen it yet.
rough set up of the motion chassis to test system


I shall search in youtube for modifying coding in english... Thankyou!
Attachments
Robot spares .co 'Simple H-Bridge' wiring option I want to use
xidsim1
 
Posts: 21
Joined: Mon 19. Nov 2012, 23:47
Has thanked: 0 time
Been thanked: 0 time

Re: Re-write Arduino UNO coding for H-Bridge?

Postby adrianovrm » Sun 9. Mar 2014, 03:43

send your email to me through PM !
L will send you my wire scherma !
that works nowdays, and a video too , how are mounted mine !
adrianovrm
X-Sim Supporter
 
Posts: 214
Joined: Tue 20. Nov 2012, 07:35
Has thanked: 0 time
Been thanked: 1 time


Return to Motion simulator building Q&A

Who is online

Users browsing this forum: No registered users and 1 guest

cron