sim- / tgy

tgy -- Open Source Firmware for ATmega-based Brushless ESCs
http://0x.ca/tgy/
688 stars 387 forks source link

Constant rpm ("governor") mode? Control over number of turns? #136

Open se-pi opened 6 years ago

se-pi commented 6 years ago

Hey! New to this project, I have actually an application that needs a significant modification. Hope you can help me figuring out if it is feasible with this FW. This is not going to be a R/C model application.

Ideally, I want to have fine control over the actual rpm of a motor that the ESC should hold at a certain value under changing load, in a broad range of speeds, and with good control over the number of turns. I can imagine this being controlled either via PWM, as usual, or via speed proportional to the frequency of the control signal, so that I can count pulses and thereby revolutions.

In the end, I want to have three or four motors running synchronously and turning all the same number of turns, under probably dramatically differing load, so the motors need to be able to provide some torque while turning slowly or even standing still. I'd like to avoid mounting a hall sensor to every motor and feeding that into an external feedback loop, as every ESC has that information already.

The final application is supposed to be a rope machine, if that helps understanding the scenario. As the strands are wound, the counter torque on every motor will increase with every turn. All the strands need to be twisted the same number of turns (that might turn out to need tweaking, but it is my first assumption).

Recap of requirements:

I have this set of four ESCs and brushless motors, which is advertised as running this firmware, and the three beeps they make on power-up give reason to believe that it is the case. I haven't seen it in the compatibility sheet, nor any photos of the ESCs. They are not as easily programmable, as the testpoints are scattered around the PCB, which is covered in shrinkwrap. I'll see if I can reach the manufacturer and get their source.

I have programmed AVRs with assembler over 10 years ago, so I'm a bit rusty. Are there resources that help understanding the sourcecode, like flow graphs or the like, and the motor control principle in general?

Looking forward to any hints! Sebastian

ossilator commented 5 years ago

i'd also be interested in a speed governor. i'm currently evaluating whether it would be easier to hack one into tgy, or to make blheli (which does have various governors) run with the shitty crystal-less (and thus limited to 8 mhz, unless hacking OSCCAL) ESC. or just buying a better ESC. for a really interesting governor algo, i found https://hal.laas.fr/hal-01476812/document.

the high-torque/low-speed operation thing is a wholly different beast. dissertations have been written about this topic. you can probably forget making that work with the hardware tgy runs on.