Can my arduino mimic the pulses of a radio control? Through servo codes?
Note: send a 1 - 2ms pulse every 20ms. If it gets a 1.5ms pulse, it will not move. Anything from 1.5 - 2ms will cause it to move in a direction. And opposite for 1.5 - 1ms.
This is a most standard request you have. Please search a little bit in this Forum and in the Playground: the Keywords are: RC, PPM, servo.
You will find 20 very instructive articles and 200 interesting discussions...
Did you try using the Arduino servo example sketche (knob.pde) to see if that works with your motor contoller?
Once you get that working then you can modify the sketch to use microseconds instead of degrees
#include <Servo.h>
Servo myservo; // create servo object to control a servo
int potpin = 0; // analog pin used to connect the potentiometer
int val; // variable to read the value from the analog pin
void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop()
{
val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023)
val = map(val, 0, 1023, 1000, 2000); // scale it to use it with the servo (value between 1ms and 2ms)
myservo.writeMicroseconds(val); // sets the servo position according to the scaled value
delay(15); // waits for the servo to get there
}
I haven't tried the sketche (knob.pde), do I need to? Can't I just send pulses and see what happens?
Somebody recommended: analog write command i have had success ,
as i said use a 50% signal, then centre the motor[turn the VR1 & VR2 are only to adjustment the 1-2mS (Radio Control) input if used] , now u can control the speed
ie if u use a 25% signal the motor will go at half speed one way, and if u use 75% signal it will go at half speed the other way
The Arduino servo library is designed to produce pulses between 1ms and 2ms. The sketch I posted above is based on the knob example and lets you set the pulse width using a variable resistor but you can change the code to write any valid value. The writeMicroseconds function accepts values in microseconds so you would use a value of 1000 for 1ms up to 2000 for 2ms.
Is there a way to simmulate the shorting of the terminals through servo coding?
No.
If you need extra control then you will have to wire in the extra electronics to do it. Flywheel breaking is what this is called and is mentioned in this article - http://www.thebox.myzen.co.uk/Workshop/Motors_1.html
Although that is referring to motors you could treat the whole servo as if it were a motor for the breaking part.
The motor controller has no braking function. And when you put to neutral the motor is floatting.
placing it on reverse while going forward is not advisable for my motor controller.
Why? It is just EMF vs back-EMF. Of course you should not go from all forward to all backward. But if you slow down the motor and then put a little reverse I think this will brake the motor.