Pages: [1]   Go Down
Author Topic: PCB Shield with various sensors and motors  (Read 604 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 0
Posts: 139
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have two questions that I was hoping someone knew a definite answer to. Thanks in advance for your help. I am trying to make a shield to drive a little cart around and collect data on it to then send back to my computer.

Is it acceptable to run 2 servos off of 1 PWM pin or am I running the risk of something going wrong?

Is it possible to interfere with an Xbee from signal noise generated by various sensors such as an Ultrasonic sensor, IR diode, compass sensor and their power supplies (9v battery converted to 5v as well as 6v for servos). The same goes for a compass sensor which will most likely be https://www.sparkfun.com/products/9757. Everything will be in close proximity (it fits on a 2.5 x 2.5 in board) I apologize if this is a silly question, I have always been warned about signal noise and wanted to be on the safe side. Thanks!
Logged

Poole, Dorset, UK
Offline Offline
Edison Member
*
Karma: 52
Posts: 2386
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Is it acceptable to run 2 servos off of 1 PWM pin or am I running the risk of something going wrong?

Are you using the servos as the drive motors for your bot?. If you are then this will make turning very difficult. If not then read the documents for the servo lib.

http://arduino.cc/en/Reference/Servo

mainly

Quote
On boards other than the Mega, use of the library disables analogWrite() (PWM) functionality on pins 9 and 10, whether or not there is a Servo on those pins.

The servo lib has problems with the standard motor shields.

Mark
Logged

0
Offline Offline
Sr. Member
****
Karma: 1
Posts: 415
MEGA_Stick_II is here
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is it acceptable to run 2 servos off of 1 PWM pin or am I running the risk of something going wrong?

As long as everything is within specs, Amp draw, voltage, etc. yes. However - you do run the risk of one motor skipping a step and the other not, and no way to correct it other than turning one by hand. But that all depends on how precise your movements are.

This is one potential problem the Printrbot has as it's Z axes is driven by two motors on the same driver. if one skips a step, the Z will no longer be parallel to the print bed. The only way to correct it is to reset the Z manually or re-level the bed. If they were driven by separate drivers, it could be corrected in the Software.
Logged

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12630
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

9v battery converted to 5v as well as 6v for servos

I hope that isn't going to be one of those little PP3 smoke alarm batteries. They have tiny charge and current capacities which renders them useless for powering just about anything.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Offline Offline
Full Member
***
Karma: 0
Posts: 139
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I was only planning to use the 9v battery to run the Atmega328 and sensors. The sensors and Xbee only use 56ma at 3.3V.

Since I cannot use pins 9 and 10, can I then have one servo on the left side controlled by an analog pin and another one on the left side with a PWM pin or will they get out of sync? To clarify can different servos on the same side of the drive train get their signal from a mix of analog and PWM pins?

Any thoughts toward signal noise? Thanks.
Logged

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12630
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Those 9v batteries are a very expensive and inefficient way to power an Arduino, but if the current requirements are low enough then it would be possible, if you insist.

Read the documentation for the Servo library for a clear explanation of what it does, but briefly:

The Servo library can control up to 12 servos (up to 48 on a Mega). The servos can be on any of the output pins (you are not limited to the pwm-capable pins). However, using the Servo library does disable some of the pwm output capabilities (which pwm-capable pins lose their pwm capability depends on how many servos you are using). Unfortunately, on all boards except the Mega using any servos disables the pwm capability of pins 9 and 10 which are the ones typically used to control the speed of a motor drive shield, so using servos and a standard motor drive shield can be problematic. If you used a Mega this wouldn't be a problem, and if you used a motor drive shield that didn't use pins 9 and 10 this wouldn't be a problem, and if you used a separate motor driver board connected by flying leads (rather than a shield) this wouldn't be a problem.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Poole, Dorset, UK
Offline Offline
Edison Member
*
Karma: 52
Posts: 2386
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Lets try and split you project up.

1. What are you thinking of as a robot body. post  a link!

How do you intened to make it move. Are you thinking of using standard servos?, motors, or continuous rotation servos. There is a great deal of difference.

2. What else do you think you want to add to the robot?

Mark
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 139
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

For the chassis I am using 4x continuous rotation servos that have wheels (not shown in photo). More photos are available at http://builtbyben.net/3d-printing/

I am planning on using rechargeable AAA NiMH batteries to power the servos.

As for the sensors I plan to have 1x Ultrasonic Sensor to measure the distance, an Xbee to communicate with my computer/another Arduino, 1x IR Reciever diode and possibly 1x compass sensor.

I have been working on a schematic in Eagle although I apologize for any errors as I am still learning Eagle and based on your suggestions I need to change some things. The ultimate plan is to make a PCB for the project.

I have made a standalone Atmega328 on a breadboard so since I have all of the parts already, I am making this through hole instead of SMD which I recognize is the better option and the future.

Right now the servos are connected to pins 17,5 and 11 which I plan to change. The plan was to have pins 17 and 5 split so that 5 went to the left 2 servos and 17 to the right 2 but I need to change that.



* img_0660.jpeg (103.07 KB, 600x448 - viewed 10 times.)

* Screen Shot 2012-12-19 at 3.55.29 PM.png (59.84 KB, 1203x815 - viewed 12 times.)
Logged

Pages: [1]   Go Up
Jump to: