Hello,

I am having troubles understanding how the Sequencer works for controlling 
a couple of ESCs. 
The ESCs are Afro ESC from HobbyKing. Their manual can be 
here: http://www.hobbyking.com/hobbyking/store/uploads/745353836X1335174X28.pdf
According to their specs: For PWM input, motor stop / arm below 1060µs, 
full power at 1860µs.
That would be the pulse width for controllig the speed of the motor, right?

The code we have in our Android app to initiate the sequencer:
final ChannelConfigPwmPosition motorESC = new 
Sequencer.ChannelConfigPwmPosition(
Sequencer.Clock.CLK_2M, 6120, 0, new DigitalOutput.Spec(2));

the cue value is set to 10: sequencer_.push(cue_, 10);

and the value that we send for the pulse width are generated as follows:
uno_varValue = (int) (1060 + (motorsPowers.nw * 8));

The motor is running with these values but I just can't understand why.
Some of the questions we have:
- why only values around 6100 work for the period. The ESC should have an 
input freq of 1 Khz (according to this: 
http://www.hobbyking.com/hobbyking/store/__52338__Afro_ESC_30Amp_Multi_rotor_Motor_Speed_Controller_SimonK_Firmware_US_Warehouse_.html)
 
though the manual says this:  The default PWM frequency is 18kHz with 800 
distinct steps, but may be adjusted to any frequency.
- why only 2Mhz clock values worked. I was not able to make it work with 
other values
- if the documentation says that 1860µs is the value for full power, why I 
don't get full power when I send 1860(I can send up to 2500 and there is a 
clear change in the motor speed)

The whole code can be found 
here: 
https://github.com/cllaudiu/vespi/tree/master/vespidrone/src/ioio/rd/vespidrone

We are trying to build a drone based on Android and we have some stability 
issues at this stage. It flies but we find it hard to control it. Before 
getting into PID tuning and other elements we want to make sure that the 
Android - IOIO part works perfectly and that we understand what happens 
there. Thank you for your time.

-- 
You received this message because you are subscribed to the Google Groups 
"ioio-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/ioio-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to