Electronics > Beginners

Arduino Uno will be enough to compute sliding mode controller algorithm ?

(1/3) > >>

ammjy:
Hello, EEVBlog Users ! Always thanks you for your help.
Thanks you for your time.

Now, I am thinking Arduino Uno for my quadcopter control board.

and I want implement sliding mode controller for my quadcopter.

But, I am not sure that compute ability of Arduino Uno (exactly ATmega328P) can perform the compute of sliding mode control algorithm.

most easy way to know is test by my self but, still I am building my own quadcopter so, I need a some advise to consider it.

Might be, ATmega328P has not enough performance to implement nonlinear control algorithm include processing sensor's data ?

Please, let me know !

brucehoult:
It would help if you can specify

1) how much data storage is needed. (328 has 2 KB)

2) does it involve integer or fixed point or floating point calculations?

3) how many calculations per second?

paulca:
Just remember the Arduino eco-system now extends beyond the arduino.  There are other semi-compatible MCUs available with the same ease of use through the IDE.

Consider the ESP8266 runs at at least 60Mhz and has 1Mb of flash, plus much more memory, more PWM, more serial, more GPIO and Wifi.

brucehoult:
I just made a really really quick micro-survey of flight controller literature and a few projects on github.

Seems SMC is only very marginally more complex than PID. The programs I looked at had something like 15 floating point values in the state and just a few dozen FP ops in each control cycle -- let's call it 100. Seems as if control cycles are run at 100 - 200 Hz. So you need on the order of 20,000 FLOPs, maximum.

A 16 MHz AVR with the standard Arduino FP libraries does around 100,000 FLOPs.

A lot of people seem to have moved on to ARM based boards. And then they write the software in freaking interpreted Python. Lol.

An Uno would seem to be a silly board to put on a quad. It's pretty big and heavy. You can get AVRs on much smaller boards. You can get *ARM* on much smaller boards.

Here's a photo I found on google of an Arduino Uno vs an older Teensy (looks like Teensy LC 48 MHz ARM Cortex M0)



The first Teensy's were AVR also. The latest Teensy 4.0 has a 600 MHz ARM with FPU and 1 MB RAM and it costs $20. It's really hard to see why you *wouldn't* use one if you need any kind of processing power at all. Even if you don't need speed, 1024 KB of RAM let's you run much more complex software than 2 KB of RAM.

paulca:
Also, don't forget you'll need sensor, control and possibly telemetry interfaces as well.  Whatever ADCs, PWMs or buses they use will have interrupts to serve which have timing considerations.

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod