Export to GitHub

ardupirates - issue #18

APM_RC_Class::Init sets timer to 1.5ms, should be 1ms


Posted on Jan 30, 2011 by Swift Giraffe

The ICRx register are set to 3000, should be 2000 to set all PWM outputs to 1ms, so the ESCs are off.

Comment #1

Posted on Jan 30, 2011 by Swift Giraffe

Sorry, ment the OCRxy registers, of course.

Comment #2

Posted on Feb 1, 2011 by Quick Bird

Agreed, seems like at least OCR5B and OCR5C are not even set (channels 0 and 1) ?

This might explain why I have two engines on my hex that stop much earlier than others at low throttle ?

//OCR5B = 3000; //PL4, OUT0 //OCR5C = 3000; //PL5, OUT1

Comment #3

Posted on Feb 1, 2011 by Swift Giraffe

Channel 0+1 run on OCR5B+OCR5C, so they also have to be initialized to 1ms. The bad initialisation caused a major problem in the AeroQuad code. ESCs were not initialized correctly and behaving mad.

Comment #4

Posted on Feb 1, 2011 by Quick Bird

I just finished checking the PWM outputs with an old oscilloscope, and indeed you're right. The PWMs on my hexa run at around 730Hz (not an exact science and not an exact scope). 730Hz is 730 times per second, so 1000ms/730 = 1.34ms. Sounds about right, but really wrong :) I believe the margin there is way too high to expect ESCs to behave reliably. I set to 2000, and uncommented the values for OCR1B,OCR1C,OCR3B,OCR3C,OCR5B,OCR5C,OCR4B,OCR4C. That's all the output channels, 8 of them. I do believe I see a difference with at least one of my ESCs that would sometimes flutter somewhat - the flutter is now gone.

Comment #5

Posted on Feb 1, 2011 by Swift Giraffe

No matter how old the scope is, it can handle 730 Hz, but no standard ESC can, and the source code allows only 200 Hz if the Force_Out* functions are called. Are you mixing up signal high time with Hz by mistake ?

Comment #6

Posted on Feb 1, 2011 by Quick Bird

Errr yes... my fault ;) Sorry about that... it's been a long while since I used anything like a scope. Had to go up to the attic and crawl for a while before I found it :D

Status: Accepted

Labels:
Type-Defect Priority-Medium