Comments (2)
Hello! The protocol is pretty simple, and is implemented to be compatible with MikroKopter brushless ESCs ("BL-Ctrl") version 1 and 2. You can see host-side implementation here: http://svn.mikrokopter.de/filedetails.php?repname=FlightCtrl&path=%2Ftags%2FV0.74d%2Ftwimaster.c
Basically, the input follows the same path as PWM and UART inputs. You need to arm the ESC by sending 0 at power-up at a rate high enough to satisfy the pulse timeout (at least ~20Hz). Then, the simplest control is simply a byte from 0 (off) to 247 (full power). Search for "evaluate_rc_i2c:" to see the bottom half of the i2c interrupt, where the input is processed to form a PWM duty. The protocol version 2 adds a few more bits, three usable, in the second byte, giving you a resolution of about 11 bits, assuming there is enough bandwidth to do so.
Finally, there is some more advanced configuration structure stuff that allows various things to be read and set. The only thing implemented at the moment is reversing the direction of rotation (through MikroKopter Tool).
from tgy.
Thank you for the links!
With the help of those, I'm able to use the i2c interface to drive motors in one direction. However, I don't quite understand how to send in the second byte to reverse direction..
Currently, I'm using this function from i2c-dev.h
static inline __s32 i2c_smbus_write_byte(int file, __u8 value)
My control loop is structured roughly as follows
while(1) {
i2c_smbus_write_byte(i2c_dev_fd, cur_speed);
usleep(1000);
}
Should this 'second byte' just be another i2c_smbus_write_byte() call inside the loop?
from tgy.
Related Issues (20)
- Bootloader incompatible with recent versions of avrdude HOT 1
- Issue with HVSK-40A (OPTO)
- BlueSeries_12A_cod modifying for Nfet driver IC IR 2101 HOT 1
- Disable all beeps? Possible? HOT 1
- Can I replace Emax BlHeli 12A ESC fets with AO4407A p-fets and AO4430 n-fets ? HOT 1
- Using SimonK with the Attiny84 HOT 1
- e-skateboard brakes HOT 3
- modular ESC
- Constant rpm ("governor") mode? Control over number of turns? HOT 1
- hobbyking hk-b125a
- Red Brick 70A Motor stocks at 50% throttle HOT 1
- Disable the arming
- Yellow ESC HOT 3
- How to write tgy. Inc apfet bpfet cpfet inversion
- How does Simonk modify the stop time after start-up stall failure? It needs to stop after 1 second
- Firmware not running on selfmade esc. but blink asm test code works
- Firmware for this yellow generic cheap ESC HOT 2
- Redbrick 200a adding a 4th mosfet sandwich
- Using SimonK with the Atmega 168P or Atmega328P HOT 1
- Enabling RC_PULS_REVERSE or disabling RC_CALIBRATION breaks firmware
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tgy.