system
September 10, 2012, 2:02pm
1
Hello,
i am trying to get a treadmill motor working with an arduino board.
i know that i will have to modulate the pulse width so that the motor controller ( MC 2100 ) will receive a valid signal.
how can i find out at which pulse length the motor controller operates?
Greetings colocolo
MarkT
September 10, 2012, 3:26pm
2
Is this datasheet relevant (does the picture of the board match yours)? If so it explains the controller signals.
system
September 10, 2012, 3:34pm
3
yes i have that sheet. but i need to know how long pulses are.
however, i tried this sketch:
int pin = 7;
unsigned long duration;
void setup()
{
pinMode(pin, INPUT);
Serial.begin(9600);
}
void loop()
{
duration = pulseIn(pin, HIGH);
Serial.println(duration);
}
it gave me values around 9300. does that mean that the motor controller pulses are 9,3 millisec long?
MarkT
September 10, 2012, 7:24pm
4
system
September 10, 2012, 7:51pm
5
i tried this . doesnt work.
but i managed to find out some data. with this code: lordvon's stuff: Getting PWM frequency and duty cycle with Arduino
the serial port gave me 47.23 and 50.64 out. the values vary.
so the frequency is 50 Hz and duty cycle 47 %. that would correspond because i already received a 9,3 ms signal. so the period would be 20 ms.
Could this be correct?
MarkT
September 13, 2012, 12:41pm
6
Well you've got the motor driver - try it out? The various threads say different things, one is likely to be right I suspect.