Show Posts
Pages: [1]
1  General Category / General Discussion / Xbee communication on: November 17, 2012, 08:02:04 am
Hello,
I have a question about wireless communication using Xbee’s.  I was wondering if it is possible to load sketches on to two arduino uno’s and then communicate between the two?  I am building a robot that goes forward and reverse only (no turning) and I have been successful getting the program onto an arduino that turns the motors with a potentiometer. From center if I turn it CW the motor goes one direction accelerating and CCW the motor turns the other direction accelerating, with a null in the center.  I have the xbee’s set up and communicating with the blinking diode example but can’t get any farther than that. Are there any other tutorials out there that would help me with the Serial.print, Serial.println, Serial.read….etc. I would like to turn the potentiometer on one Arduino and have it drive the motors on the remote via Xbee.
Chris

2  Using Arduino / Motors, Mechanics, and Power / Re: Re-posting, Need some help with motor controller. on: October 05, 2012, 07:56:48 am
no luck.
I can map  Val = map(val, -511, 0, 0, 255);
and all different variations...but I can't get the dead zone in the middle and have the motor accelerate from 0 to 255 both ways.
Does anyone know of a book or instructions that would cover this?
Thanks
3  Using Arduino / Motors, Mechanics, and Power / Re: Re-posting, Need some help with motor controller. from AWOL on: October 05, 2012, 05:46:25 am
 Author Topic
AWOL 
Global Moderator
 Online
Brattain Member

Karma:
 20
Posts: 15168
I don't think you connected the grounds, Dave.
 Re: need a little more help.
« Sent to: snakeoil on: Today at 10:22:03 AM » Quote Reply Remove   

--------------------------------------------------------------------------------

It's better if you post your questions on the forum, then everyone benefits.
Think about what you're trying to do.
A pot only gives a positive reading.
You could subtract half the range (512) from the reading to give a value in the range -512 ...+511.
Use the sign of the value to set the direction, and simply divide the absolute value by two to give the speed.
However, this doesn't give you your dead-band in the middle of the pot's travel.

--------------------------------------------------------------------------------

Pete, it's a fool looks for logic in the chambers of the human heart.
 
 
4  Using Arduino / Motors, Mechanics, and Power / Re-posting, Need some help with motor controller. on: October 05, 2012, 05:44:51 am

 
Hello Arduino world,

I need some help on a PWM motor controller that I want to use for a project. Specifically it is the PWM Motor Controller 3A 12-55V from Superdroid Robots. I have the motor inputs figured out and I am testing with a 12 volt battery, using a 24v motor (it just runs slower).

In the testing phase, I hooked a potentiometer to run the motor one direction, varying the speed.

Hookup:         Arduino:
Pot center         Analog – 0
Pot lead (L)          5v
Pot lead (R)          Ground

Motor driver board
Pin G             Ground   
Pin P (PWM)         PWM – 3

Code:
 
int potpin = A0;
int val;

void setup() {}

void loop() {
  val = analogRead(potpin);
  val = map(val, 0, 1023, 0, 225);
  analogWrite(3, val);
  delay(15);
}
 

Everything worked great with no problems…but as I move forward I am having problems and my searches have me going in circles. 

There are 4  IO pins on the motor controller board.
D-direction (0V and 5V will change the direction of the motor)
P-PWM (used in test)
B-brake (0V to the brake will turn the brake off, 5V will turn it on.)
G-Ground (used in test)

I was able to put 5v on the direction pin and the motor would change direction.
I was also able to put 5v on the brake pin and the motor would stop.

Easy enough to add some switches and use the brake and direction feature of the motor controller, but both the break and direction changes are to abrupt.

In a book I have it discuses; “Bi-directional Analog control: Uses a 0-5v analog (or PWM) signal to determine the speed and direction of a motor. In this mode, the center position of 2.5v is considered Neutral. Below 2.5v spins the motor proportionally in Reverse with a0v value yielding 100% Reverse. Above 2.5v spins the motor Forward with a 5v value yielding 100% Forward—this is called “Analog.” “

So I am looking for some help ---- use a potentiometer with my motor controller, for speed control and forward/reverse, as well as using the break input as a  kill switch but have the motors slow down to 0, 

Thanks
Chris


                     
 
 
 Report to moderator    138.32.12.6 
 
 

 
 
AWOL 
Global Moderator
UK
 Online
Brattain Member

Karma:
 24
Posts: 15168
I don't think you connected the grounds, Dave.
  Re: Need help with my PWM motor controller
« Reply #1 on: October 03, 2012, 06:53:46 AM »  Bigger  Smaller  Reset Quote 

--------------------------------------------------------------------------------

First, there's a big difference between "brake" and "break".

Lot's of ways of skinning this cat.
Take an analogue reading from your pot.
It will return a value in the range 0..1023.

Half this range is 0..511 and 512..1023, but you probably want a dead-band around the middle of the range, say from 500 to 520.
So, numbers below 500 sets REVERSE for the motor, and a count of zero sets a speed of 100% (the "map" function makes things easier here) and 499 sets a speed of 0%.
Numbers above 520 sets FORWARD, and 520 is a speed of 0% and 1023 is a speed of 100%.

100% is "analogWrite(speedPin, 255)"
 
 Report to moderator    Logged 

--------------------------------------------------------------------------------

Pete, it's a fool looks for logic in the chambers of the human heart.
 

 
 
snakeoil 
 Offline
Newbie

Karma: 0
Posts: 0
  Re: Need help with my PWM motor controller
« Reply #2 on: October 03, 2012, 12:32:21 PM »  Bigger  Smaller  Reset Quote Modify Remove 

--------------------------------------------------------------------------------

OK, on the brake.
do you know if I will need to use the direction pin on the motor controller?   
 
 Report to moderator    138.32.12.6 
 
 

 
 
AWOL 
Global Moderator
UK
 Online
Brattain Member

Karma:
 24
Posts: 15168
I don't think you connected the grounds, Dave.
  Re: Need help with my PWM motor controller
« Reply #3 on: October 03, 2012, 12:38:15 PM »  Bigger  Smaller  Reset Quote 

--------------------------------------------------------------------------------

Quote
do you know if I will need to use the direction pin on the motor controller?
If you want to change the direction of rotation, yes, I think you probably do,
 
 Report to moderator    Logged 

--------------------------------------------------------------------------------

Pete, it's a fool looks for logic in the chambers of the human heart.
 

 
 
snakeoil 
 Offline
Newbie

Karma: 0
Posts: 0
  Re: Need help with my PWM motor controller
« Reply #4 on: October 03, 2012, 12:40:02 PM »  Bigger  Smaller  Reset Quote Modify Remove 

--------------------------------------------------------------------------------

Thanks 
 
 
 
 
 
5  Using Arduino / Motors, Mechanics, and Power / Re: Need help with my PWM motor controller on: October 03, 2012, 07:40:02 am
Thanks
6  Using Arduino / Motors, Mechanics, and Power / Re: Need help with my PWM motor controller on: October 03, 2012, 07:32:21 am
OK, on the brake.
do you know if I will need to use the direction pin on the motor controller?
7  Using Arduino / Motors, Mechanics, and Power / Need help with my PWM motor controller on: October 03, 2012, 01:16:34 am
Hello Arduino world,

I need some help on a PWM motor controller that I want to use for a project. Specifically it is the PWM Motor Controller 3A 12-55V from Superdroid Robots. I have the motor inputs figured out and I am testing with a 12 volt battery, using a 24v motor (it just runs slower).

In the testing phase, I hooked a potentiometer to run the motor one direction, varying the speed.

Hookup:         Arduino:
Pot center         Analog – 0
Pot lead (L)          5v
Pot lead (R)          Ground

Motor driver board
Pin G             Ground   
Pin P (PWM)         PWM – 3

Code:
 
int potpin = A0;
int val;

void setup() {}

void loop() {
  val = analogRead(potpin);
  val = map(val, 0, 1023, 0, 225);
  analogWrite(3, val);
  delay(15);
}
 

Everything worked great with no problems…but as I move forward I am having problems and my searches have me going in circles. 

There are 4  IO pins on the motor controller board.
D-direction (0V and 5V will change the direction of the motor)
P-PWM (used in test)
B-brake (0V to the brake will turn the brake off, 5V will turn it on.)
G-Ground (used in test)

I was able to put 5v on the direction pin and the motor would change direction.
I was also able to put 5v on the brake pin and the motor would stop.

Easy enough to add some switches and use the brake and direction feature of the motor controller, but both the break and direction changes are to abrupt.

In a book I have it discuses; “Bi-directional Analog control: Uses a 0-5v analog (or PWM) signal to determine the speed and direction of a motor. In this mode, the center position of 2.5v is considered Neutral. Below 2.5v spins the motor proportionally in Reverse with a0v value yielding 100% Reverse. Above 2.5v spins the motor Forward with a 5v value yielding 100% Forward—this is called “Analog.” “

So I am looking for some help ---- use a potentiometer with my motor controller, for speed control and forward/reverse, as well as using the break input as a  kill switch but have the motors slow down to 0, 

Thanks
Chris


                     
Pages: [1]