Pages: 1 2 [3]   Go Down
Author Topic: sending of spoofing FM signals to a RC car ?  (Read 2306 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hey guys its me again smiley i removed the receiver and connected my arduino(uno) to the speed controller and gave the arduino 5v on the vin pin, common ground and then i connected the signal to PMW pin 3, the motor is working and im able to drive it for aslong as i would like to, but the problem i am facing is that i can't controll the speed :S i am connected to a PWM pin(3) and if im giving it 255 in value it goes just as fast as if im giving it 1 in value :/

do you know what could be causing this ? btw my code:

Code:
int signal = 3;
int workingLed = 11;
int force = 1;

void setup() {
  pinMode(workingLed, OUTPUT);
  pinMode(signal, OUTPUT);
}

void loop() {
  analogWrite(signal, force);
  delay(3000);
  analogWrite(signal, force);
  delay(10000);
}
Logged

Queens, New York
Online Online
Faraday Member
**
Karma: 65
Posts: 2926
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Try this, wire in the CH1 signal wire from the receiver to the ARD and do an analogRead of the signal that is being put out when the throttle is at is minimum and maximum. That way you can see what values your Speed control responds to. Also you are using the servo library right?
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Dubai, UAE
Offline Offline
Edison Member
*
Karma: 21
Posts: 1670
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Stop !

From the code you posted, you are not using the servo library, stop now before you damage something and read up on the servo library, then start using it.

The servo library generates the correct type of signal for you RC Equipment, its PWM but not the type of PWM you get from analogWrite, this should explain the type of signal that your RC Equipment expects and that the servo library generates -

http://rcarduino.blogspot.com/2012/01/how-to-read-rc-receiver-with.html

Duane B

Logged


Queens, New York
Online Online
Faraday Member
**
Karma: 65
Posts: 2926
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@DuaneB
I wanted him to test the signal aside from his actual code. It was my mistake for not making that clear, Thank you for catching that.
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hmm yea ill look into the servo library smiley-razz allthought i am not controlling a servo :S

and yes i did actually read the analog input earlier in this project and found the following values:

full throttle: 1500+
still throttle: 1450
backwards: 1450-

Logged

Queens, New York
Online Online
Faraday Member
**
Karma: 65
Posts: 2926
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
full throttle: 1500+
still throttle: 1450
backwards: 1450-

Ok so it holds the value when it is still, I'm guessing center is 0, and your limits are +1500 and -1500.
And you said before
Quote
and if im giving it 255 in value it goes just as fast as if im giving it 1 in value :/
, so now im not sure why you cant control that motor.

If you want, you can use a H-Bridge driver. I used a SN754410NE IC for my robot and it worked just fine, but there are MANY others to choose from. I dont see why your speed controller is giving the same speed at 1 and 255, that should not be, even for PWM.

Go with an H-bridge, I guess.
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

UK
Offline Offline
Shannon Member
****
Karma: 184
Posts: 11159
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hmm yea ill look into the servo library smiley-razz allthought i am not controlling a servo :S

You're controlling something which is designed to be controlled by the same signal as a servo - from the Arduino's point of view, you are controlling a servo. The usual analogWrite() PWM output does not produce the signal you need for this and would result in exactly the symptoms you're describing; it is no use in this situation - you need to use the Servo library.
Logged

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

Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

okay i tried using the servo library without luck :/ i attached the motor pin(3) and tried with both write and writeMicroseconds and both just starts my engine at full power for 1 sec then shuts it off :/ i ended up with this code in the end(not working):

Code:
#include <Servo.h>

int motor = 3;
int workingLed = 11;
int force = 1;

Servo servo;

void setup() {
  servo.attach(motor);
}

void loop() {
  for(int x = 0; x < 179; x++) {
    servo.writeMicroseconds(x);
    delay(100);
  }
}

i have no idea what could be wrong :L
Logged

Queens, New York
Online Online
Faraday Member
**
Karma: 65
Posts: 2926
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Please post a picture of your motor with everything attached. Something is wrong here.
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

okay time for a little explanation :p i am going to post pictures with a little detailed information about how its all hooked up smiley-razz

first of all the almighty arduino:

regular arduino UNO, i have a signal pin coming in on PWM 3, V+ containing 5v going to the vin and GND going to "GND" :L here is a picture of the arduino's hook up:




then we have the motor:



as u can see its a DC brushless motor from kyosho smiley-razz and it has something called HI-torque ? well thats all the information i have on it smiley

next we have the speed controller connected to the arduino using a 3 wires smiley-razz supposedly V+ (i used a multimeter, its 5v) connected to vin on the arduino, ground(connected to arduino's GND) and the signal wire connected to PMW pin 3 on the arduino. image of the speed controller:



basicly its just a cooling block, a chip that controlls the motor and speed of it etc... i checked the IC and it is a M51660L chip smiley uhm the engine is connected to the speed controller using 2 wires that is red and black(+ and -) xD jupp thats it for the speed controller

next up is the receiver smiley-razz it has 4 different sets of pins, these are batt, CH1, CH2 and CH3 each of them have 3 pins(V+, ground, signal) its a Hitec HFS-03MT extra narrow band, single conversion xD anyways here it is(btw it is not connected to the circuit anymore):



nothing to say for the receiver smiley-razz

then we have the battery, its from "RC System" it outputs 8,4 Volts 3000 mAh at it says "ref. SA10048N" on it smiley-razz picture below:



connected to the speed controller using one of thoose regular RC battery cables smiley-razz


and at last we have my code being used, notice that i have already tried different syntaxes like servo.write etc... this is just the code i ended up with smiley-razz

Code:
#include <Servo.h>

int motor = 3;
int workingLed = 11;
int force = 1;

Servo servo;

void setup() {
  servo.attach(motor);
}

void loop() {
  for(int x = 0; x < 179; x++) {
    servo.writeMicroseconds(x);
    delay(100);
  }
}
[/color]
Logged

Queens, New York
Online Online
Faraday Member
**
Karma: 65
Posts: 2926
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Regular PWM dont work, Servo Library dont work, does it work with the receiver as of NOW. If it does then i'm stumped, there is no reason why this motor should not work properly.

try the example again and this time dont change anything just plug in the servoS, yes both! If the regular servo works with the code then the motor should work too.

If not then I can no longer help you im sorry.
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

UK
Offline Offline
Shannon Member
****
Karma: 184
Posts: 11159
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you're powering the Arduino through Vin you need to provide at least 7V. If the V+ from the speed controller supplies a regulated 5V then you could connect it directly to the Arduino 5V line and power it like that.

Using the Servo library, I suggest you use write(angle) rather than writeMicroseconds(microseconds).

I didn't realise that the forum's alignment codes would affect stuff in [ code ] blocks too but it seems to, so it would probably be best to make sure any code you post is left aligned in future - the center alignment doesn't work at all well for code.
Logged

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

Offline Offline
Full Member
***
Karma: 1
Posts: 154
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There probably is an "arming" sequence to allow the control of the motor. You don't want the car to take off as soon as you plug the power in.
Logged

Pages: 1 2 [3]   Go Up
Jump to: