Loading...
Pages: [1]   Go Down
Author Topic: SoftwareServo  (Read 191 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi guys,

I'm using an Arduino Uni and an ETC to drive servo motors on an RC car, this worked fine using the servo library, however I needed to use timer1 for a 100ms interrupt and so resorted to using SoftwareServo to drive my servos. My steering servo works just fine, (it doesn't connect to the ETC) however the ETC I'm using to drive the rear wheels is just beeping, indicating it's not receiving any useful signal. I've checked all the wiring multiple times, the ETC is powered by a separate 7.4V LiPo, I've tried the ETC with the radio receiver and it is working fine. The code I'm currently testing is as follows:
Code:
#include <SoftwareServo.h>

SoftwareServo myservo;

int val;

void setup()
{
  myservo.attach(10); 
}

void loop()
{
  val = 95;
  myservo.write(val);               
  delay(15);

  SoftwareServo::refresh();
}
 

Can anybody help me please?

ETC Manual: http://www.zonacrawling.com/ManualTamiyaTEU-101BK.pdf
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 138
Posts: 19067
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ETC is an acronym I haven't heard before - what makes it different to an ESC?
Logged

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

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

I believe it's the same thing, I must have misread somewhere.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 138
Posts: 19067
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What happens if you substitute a servo for the ESC?
Is 95 your programmed neutral point?
Logged

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

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

95 is the neutral point yes, With just a servo it works correctly.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 138
Posts: 19067
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

And the grounds are connected?
Can you confirm that the ESC behaves the same as if you turn the transmitter off?
Logged

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

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

Yeah, It's wired fine, If I change the code to use the regular servo library it works. However I can't use the regular servo library because it uses the 16bit timer1, which I need for reading time critical ultrasound sensors.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 138
Posts: 19067
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I haven't used the software servo library for a very long time.
You could try checking that its "95" corresponds to the standard library's "95" "angle" timing, by marking the position of a servo and checking it with a couple of simple sketches, if you haven't got access to a scope (preferred).
Logged

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

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

How critical is the 100ms interrupt ? If you can tolerate tiny errors in the signal I would go back to using the standard servo library and use the blink without delay approach to generate the 100ms interrupt.

Duane B

rcarduino.blogspot.com
Logged


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

I just resorted to buying a Leonardo. Has 2 16bit timers.
Logged

Pages: [1]   Go Up
Print
 
Jump to: