2 a motor shield with arduino board

Hi,
I am doing some FYP, I look and learn the code programming for Arduino, and I am wonder can I program Arduino using this shield to perform speed and different direction? I know that the shield can perform PWM and PLL but i can only choose one of it to perform. if there any suggestion?

secondly, is the any way i can know the duration time when the current is supply to the motor for programming? i know that is a millis() function. but it cannot be use to detect when i start supply current for the motor.

Please reply as soon as possible. thank you very much and very appreciate for answering the question.

regards

zheng koon

I am doing some FYP

Five Year Plan?
Festival of Young Performers?
Fixed Yearly Premium?

using this shield

Which shield?

is the any way i can know the duration time when the current is supply to the motor

Yes.

Post some more information. Post any code that you've got.

Thanks dxw00d for reply.

My FYP mean one year project. I am university student. It is my project to do the programing so that i can control RC servo motor (360 degree) to move forward, backward, turn left and turn right.

I am using the 2 Amp motor driver shield which can found in here
http://cytron.com.my/viewProduct.php?pcode=ARDUINO-2AMOTOR&name=Arduino-2%20Amp%20Motor%20Driver%20Shield

I am planning to use the timing for the current supply from the driver shield out to the motor to do the speed calculate so that i can send back my comment back to the computer and to calculate the distance move. i plan to use millis() but it cannot work for it. Thus, I am wondering is there any other way to do it.

Regards zheng koon

If you are using continuous-rotation servos, you don't need a motor shield. You just connect the signal and ground leads to the Arduino and the power and ground leads to an external power source, and use the Servo library.

I don't understand why you think you can't use millis().

I need the motor driver shield to do the reverse direction. besides, i need to control the speed of the motor.

I still not familiar with the millis() function. I want to use it to detect the time of the motor is moving. but it keeps giving me zero. and i wonder there is a sample that can guide me with this

thanks and regards
zheng koon

Not if you are using continuous-rotation servos. Can you post a link to the servos you have.

If you are using continuous-rotation servos, then they are stopped when you set them to 90 degrees, and move in either direction, depending on whether you set them higher or lower than 90 degrees. The further away from 90 degrees, the faster they go.

millis() will almost never return zero (only when it rolls over). Post the sketch you are using.

I need the motor driver shield to do the reverse direction. besides, i need to control the speed of the motor.

If you are using a continuous rotation servo, you do NOT need the shield. Using the servo library, you write different values to the one servo pin to control speed and direction.

I want to use it to detect the time of the motor is moving. but it keeps giving me zero.

Using what code? Just timing how long the motor has had power applied will not tell you how far the propelled device has moved. What speed was the motor turning at? What amount of slippage occurred at the wheel/floor/table/rug interface?

I am university student.

Making a robot move is hardly a novel project. There are tons of sites to google.

Hi Pauls
Thanks for the reply and suggestions.

I am new to arduino. I only attend the beginning class of arduino and so reading on the arduino website.
Thus, at the beginning of my project i did not come with the idea of using the servo.h. that why i bought a shield thought that i need dual h bridge to do it. I will try the servo library without the shield and see is it work.

I planning to use the time to calibrate the time of my motor to move one complete circle and to formula the equation to calculate how far the motor has move. maybe for the time i might not able to do it.

it is tons of website on moving the motor. but there is limited website that use the motor shield.

thanks and regards

zheng koon

t is tons of website on moving the motor. but there is limited website that use the motor shield.

But if you're using a servo, you don't need the shield.

I planning to use the time to calibrate the time of my motor to move one complete circle and to formula the equation to calculate how far the motor has move. maybe for the time i might not able to do it.

You can do that, but the time vs. distance traveled is not a linear relationship. The speed that the motor is turning at will have a big influence, as will the amount of slippage that occurs. The speed is easy to account for. The amount of slippage is not.

You need some other way to determine how far you have moved.

Hi AWOL,

My servo motor is a hack servo motor, it only has 2 wires and no feedback wire. Maybe I will tired without using motor driver to see it work or not. Thanks

Hi Pauls,
thanks for your feedback and suggest. I will consider it and think about it. if you have any method to do it please suggest to me and i will be very appreciate it. thanks

Thanks and regards

zheng koon

My servo motor is a hack servo motor, it only has 2 wires and no feedback wire. Maybe I will tired without using motor driver to see it work or not. Thanks

If it has only two wires, it is not a servo. It is not even a continuous rotation "servo". It is simply an electric motor, and you WILL need the shield.

Yup, thanks Pauls, I managed to let it work d. Thank you