Go Down

Topic: Newbie |Howto - Controlling a model (Read 915 times) previous topic - next topic

Macguyver

Jul 07, 2011, 11:14 am Last Edit: Jul 07, 2011, 04:48 pm by Macguyver Reason: 1
Where to begin...

How can i get a modelcrane (4 motor) attached to a  'uno' board,
to work by another 'uno' board with two arcade-joysticks linked over APC220

-  what i have:
2  x uno boards
2  x motorshields L298P(cant figure how to stack these btw ! as they bith listen to E1-M1-E2-M2) ---> Arduino Motor Shield 2A see attached picture
1  x L298N 2Amps motorcontroller
1  x set APC220 (already managed to get PC to link to MCU)

Can someone help me with this?
what do i need more?
is there a sketch for this, guess i'm not the first who would want this?

# problems i ran into sofar are that:
while trying to steer a servo, to also start an engine that does a predefined run (slowstart-fullrun-slowstop) it cuts off the servo-routine and i have to wait for the motor to stop ?!?!



see attached sketch (with tab) below:












PaulS

Quote
2  x motorshields (cant figure how to stack these btw ! as they bith listen to E1-M1-E2-M2)

Which ones? Post a link.

Macguyver


Simpson_Jr

#3
Jul 07, 2011, 06:17 pm Last Edit: Jul 07, 2011, 06:23 pm by Simpson_Jr Reason: 1
If it's a shield like http://droboticsonline.com/ebaydownloads/L298_Motor_Shield_Manual.pdf,
it looks the same, stacking on top of each other and using the same pins will indeed cause problems.

You could connect the E1-M1-E2-M2 pins of one shield to different pins on the arduino though.
In your sketch you'll need use those new pin numbers and name variables like E3-M3-E4-M4 to talk to the second shield. Don't forget to connect ground, +5 for the circuitry and of course power supply.


The problem of servos not responding can be found in one of the delays you're using.
After doing something with motor-shield you programmed a delay(4000).
During that delay Arduino does nothing but waiting for 4 seconds. It doesn't update the readings of the pots attached.

You should check http://arduino.cc/en/Tutorial/BlinkWithoutDelay (you can also find it in the digital part of examples). It gives you the possibility to perform tasks at a certain moment instead of
just waiting till it's time. That gives you the possibility to do loads of things in the meanwhile.

By the way, Lol, I'll check my girlfriend this evening to see whether she can knipper her kut that fast ;)


PaulS

Quote
updated my post as requested !

Adding a picture is not the same as adding a link. With a link, we can go find the data sheet of the product, and see if there is a way to help you. With a picture, we can say "Oh, how cute!". Your choice.

Macguyver

well it is indeed the shield as mentioned in the reply from Simpson_Jr

http://droboticsonline.com/ebaydownloads/L298_Motor_Shield_Manual.pdf


Go Up