Author Topic: What high level language for user defined maths in controller device?  (Read 2965 times)

0 Members and 1 Guest are viewing this topic.

Offline JayDee

  • Contributor
  • Posts: 23
Hi Guys,  I'm after general thoughts on the following...
Looking at developing an embedded controller device (so micro controller based, not desktop or rack mount pc) , usual stuff, Analog inputs, digital inputs, switched power outputs.  The intention is to have several built in features. The main control I expect to be written directly in C.
 
However, I would also like to provide a user defined 'maths' section, such that the user has access to quite a few of the variables and do there own maths on these, outputting a result and being able to link this other parts of the system, i.e. turning an output On/Off.   An extension of this idea, would be to go beyond basic math operators / logic and allow the user to write more complex control sequences of their own. If/else, Wait, advanced maths like Diff, Int etc..
Is anyone aware of a good high level language that would be suitable?   
A scripted language would be OK,
rather optimistically a graphic interface would be much friendlier for many of the users, as they will not have code writing experience but are capable engineers.

I've looked at lots ofthe big boys like MatLab, LabView...and the small guys like eLua, Squirrel, TCL...with every thing inbetween like Python.

So..open question...if you had to design an embedded device that allowed the end user to add there own maths/control...what would you use?
Thanks for input!
J.
 

alm

  • Guest
Re: What high level language for user defined maths in controller device?
« Reply #1 on: September 27, 2013, 07:31:12 pm »
It would of course depend on the customer, but I would probably use a small scripting language like Lua. You can always add a GUI on the PC side to generate it. It also depends on the type of micro-controller: are we talking 8-bit PIC or Beagle board?
 

Offline JayDee

  • Contributor
  • Posts: 23
Re: What high level language for user defined maths in controller device?
« Reply #2 on: September 27, 2013, 07:43:01 pm »
Due to some other other functions we are going to include..we'll be probably using something 32bit,
Lua or eLua has cropped up before...will be looking at it again.   
 

Offline Rick Law

  • Super Contributor
  • ***
  • Posts: 2817
  • Country: us
Re: What high level language for user defined maths in controller device?
« Reply #3 on: September 28, 2013, 12:55:40 am »
Hi Guys,  I'm after general thoughts on the following...
.....
So..open question...if you had to design an embedded device that allowed the end user to add there own maths/control...what would you use?
Thanks for input!
J.

If space/resource is a premium, how about simple RPN?
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 19658
  • Country: nl
    • NCT Developments
Re: What high level language for user defined maths in controller device?
« Reply #4 on: September 28, 2013, 07:36:00 pm »
IMHO eLUA (embedded LUA) definitely fits the bill.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline Electro Fan

  • Super Contributor
  • ***
  • Posts: 2122
Re: What high level language for user defined maths in controller device?
« Reply #5 on: September 28, 2013, 10:04:38 pm »
Hi Guys,  I'm after general thoughts on the following...
Looking at developing an embedded controller device (so micro controller based, not desktop or rack mount pc) , usual stuff, Analog inputs, digital inputs, switched power outputs.  The intention is to have several built in features. The main control I expect to be written directly in C.
 
However, I would also like to provide a user defined 'maths' section, such that the user has access to quite a few of the variables and do there own maths on these, outputting a result and being able to link this other parts of the system, i.e. turning an output On/Off.   An extension of this idea, would be to go beyond basic math operators / logic and allow the user to write more complex control sequences of their own. If/else, Wait, advanced maths like Diff, Int etc..
Is anyone aware of a good high level language that would be suitable?   
A scripted language would be OK,
rather optimistically a graphic interface would be much friendlier for many of the users, as they will not have code writing experience but are capable engineers.

I've looked at lots ofthe big boys like MatLab, LabView...and the small guys like eLua, Squirrel, TCL...with every thing inbetween like Python.

So..open question...if you had to design an embedded device that allowed the end user to add there own maths/control...what would you use?
Thanks for input!
J.

Off topic but your math idea stimulated another idea - although probably simpler than the advanced math functions you have in mind.

Not sure exactly where you are headed with your projects but I think it would be handy to find a relatively easy way to write (or just use/configure) programs that could instruct an embedded device to manage non-programmable power supplies.

If someone had code - maybe that could be used either with a command line and/or a GUI that would interface to something (an Arduino or raw Atmega) that could be programmed to turn on and off voltage to specified levels and specified intervals, etc. and the device could be interfaced to a RS232, TTL, or USB interface on a power supply there might be a community of users for such a capability.

Or maybe the embedded device might not even need to be in the loop?  Maybe the code could run from a PC?  Might depend on the particular power supply?
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: What high level language for user defined maths in controller device?
« Reply #6 on: September 28, 2013, 11:41:51 pm »
Quote
What high level language for user defined maths in controller device?

The same high level language that you would use on a Cray super computer to control your toaster.
================================
https://dannyelectronics.wordpress.com/
 

Offline JayDee

  • Contributor
  • Posts: 23
Re: What high level language for user defined maths in controller device?
« Reply #7 on: September 29, 2013, 04:54:57 pm »
Thanks guys, always worth asking and the consensus does seem to be leaning towards eLua.
The project is aimed at a fairly niche market, in very simple term its power control/distribution and current monitoring. There is no need for Voltage control but some outputs might be PWM'd. Existing units are good and provide most of the basic math previously discussed, however at the top end of the market there is demand for writing more involved control loops. Might seem overkill to some but special markets call for specialist solutions, happy days!  ;D
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf