Realtime data from motor controller

3 visualizaciones (últimos 30 días)
Chris
Chris el 28 de Dic. de 2020
Comentada: Mario Malic el 21 de En. de 2021
Hello,
I have a question how to plot and show real-time data in App designer, maybe someone can help me, I am beginner in Matlab.
I get my data (e.g. Velocity) easy with webread() in hex and just have to convert into a decimal number, it already works.
But now I don’t know how to write an easy and efficiency program to get actually data e.g. velocity, motor current, torque to show them into two ways in App Designer:
  1. In an EditField to see the Data like a Display
  2. In a plot to see data in a graphic and safe
Thanks a lot for any advice to find a good solution :)

Respuesta aceptada

Mario Malic
Mario Malic el 31 de Dic. de 2020
Hey Christian,
It would be the best if you'd do few introductory examples in App Designer and you'll get an idea how to do your task.
% 1. Set the property value of the Edit Field component this way
app.EditField.Value = 5
% 2. Once you create axes in your app, use plot function
plot(ax, x, y); % ax is the handle to your axes, example app.UIAxes
  21 comentarios
Chris
Chris el 21 de En. de 2021
Hello Mario,
super! Thanks for create a demo app. Everything is working well.
"Another thought: when velocity is zero, signal you get might not be zero, but very low, let's say 1E-3. On plot it will look like it's jumping around, which it actually is but such small number can be neglected."
Exactly, that was the key I had in the beginning really high measurement errors sometimes (1E+9): Now I limited the range in the beginning and the plot is working well.
Mario Malic
Mario Malic el 21 de En. de 2021
Great to hear, you're welcome.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by