Page 1 of 1

Motor Controller

Posted: Tue Feb 02, 2016 10:58 pm
by thegladiator
Is it possible to do the following with the Red Pitaya..

1. Generate a PWM signal to a MOSFET/Mosfet Driver as part of a motor control circuit
2. Simultaneously measure waveform showing recovery time of Mosfet as motor ramps up and goes online?

Looking for a simple solution to build a demo box without having to also introduce something like an Arduino inot the picture

thanks

Re: Motor Controller

Posted: Wed Feb 03, 2016 12:02 am
by Nils Roos
It is possible to program the arbitrary signal generator of the Red Pitaya to generate one or two PWM waveform(s) with a wide range of frequencies and pulsewidth resolutions. This requires only a couple of lines of C code and consumes very little CPU time. You mention that this would be part of a motor controller, so you would need to add a method of receiving parameter-updates.
The scpi-server also offers a PWM option for the ASG, but this recalculates the whole waveform every time you change the pulsewidth, so it may not be suitable for quick updates.

Simultaneously to the PWM being generated, you can measure one or two signals with the scope module and store or display the acquired data. You could use the scope web-app for that or any other of the demonstrated methods (python / Matlab / Labview via scpi-server, C program, etc).

Re: Motor Controller

Posted: Tue Feb 09, 2016 4:17 pm
by thegladiator
Nils, thanks for the quick reply. So let me make sure that I understand.

Let me ask then the following questions...
1) Being that I'm new to the Red Pitaya environment what are my options for receiving parameter updates?
2) Scope-Web app is included I would assume in the Oscope+Signal Generator sofware correct?
3) Can I incorporate functionality to have parameters changed via a touchscreen monitor that we plan to use as the interface?

Thanks so much

coleman

Re: Motor Controller

Posted: Tue Feb 09, 2016 11:35 pm
by Nils Roos
1) Well, one of the most versatile options is to have a server that listens for incoming connections and offers a targeted command protocol to access the hardware functions. That is basically what the scpi-server is, and if it didn't have the slightly cumbersome PWM implementation, I'd recommend you just use that. As it is, you should still try it out to get some hands-on experience and to see if you can live with how it does PWM.

The neat thing about the scpi-server is, it does the scope functions, too. So, dig into the examples, overcome the obstacles that may lie on the way to get them to work :mrgreen: and perhaps later write a GUI frontend for it that displays on the touchscreen - can either be running on the Red Pitaya itself or a separate handheld device (re your point 3)).

2) scope web-app was my sloppy way of saying "Generator & Oscilloscope bazaar application".

Re: Motor Controller

Posted: Wed Feb 10, 2016 11:43 pm
by thegladiator
Nils, one last question as I think I have everything I need concept wise.

Link: https://www.youtube.com/watch?v=Lzxuro0Z2Ew

In looking at the link above, can I use the red pitaya in place of the arduino (using the correct pins on the red pitaya of course) to generate my signal? Then in turn I can use the scope to evaluate the ouput.

coleman

Re: Motor Controller

Posted: Thu Feb 11, 2016 1:31 pm
by Nils Roos
The fast analog outputs may not be suitable to drive a power mosfet directly, but with some additional output buffer I see no problem. Depending on your target PWM frequency, you may even get away with using a GPIO for the PWM.