Hi all,
I am using the C# code sample that colin has listed on this site. I am using it in the SSC mode and wish to control a motor with it. The ESC was just a cheap one from ebay i figured go cheap while trying to figure this out in case if smoke it. here are some specs on the ESC:
BDU 50A Brushed Speed Controller W/Reverse (6-12V,2-3CELLS LIPO.)
PARTS For R/C CARS ,BOATS Trucks and Vehicle …
Description :
Size : 72mm (L) x 26mm (W) x 23mm (H)
Weight : 50.9g (without wires, 59g with wires)
Current Limit : 50A
Input : 6-12V(2-3CELLS LIPO.)
Cut-off : Auto
Continuous Load Current : Forward 50 / Backward 30
BEC : 2cells 4servos, 3cells 3servos
Brake setting OK
With Reverse
Suitable for JR/Futaba/Hitec/GWS receiver
I have seen videos with the serial servo controller and a banebot ESC move a motor forward and reverse, but it did not go into how he did it, and from what i can find on the net the PWM is a standard for talking to a ESC. So i would think that most servo controllers can talk to most ESC, is that true?
I thought Jan had made a post in the forums about using the servo controller to talk to the ESC, but now that i am looking for it i can not find it.
in colin’s code he write to the serail port the following snipped of code:
SerialPort port = new SerialPort(ComPort, BaudRate, Parity.None, 8, StopBits.One);
// Open the port for communications
port.Open();
//convert position into hex string
string ServoPosHex = ServoPos.ToString("X");
//convert position into single byte
byte PositionByte = byte.Parse(ServoPosHex, System.Globalization.NumberStyles.HexNumber);
//convert servo number into hex string
string ServoNumberHex = ServoNumber.ToString("X");
//convert servo number into single byte
byte ServoNumberByte = byte.Parse(ServoNumberHex, System.Globalization.NumberStyles.HexNumber);
//write 3 bytes, start byte, servo number, position
port.Write(new byte[] { 0xFF, ServoNumberByte, PositionByte }, 0, 3);
// Close the port
port.Close();
I have used his code for every project i have done with servos, this is the first for controling motors. from what little i understand, i need to send a 2 ms pulse for forward and 1.5ms to reverse, but i am not totally sure what that means. does the controller do that or do i need to keep sending a command to the controller from a loop.
Can someone point me in a direction or tell me how off base i am?
thanks tim