Rx Input Multiplexed?

NigmaTech
Posts: 23
Joined: Wed May 21, 2008 11:53 am

Rx Input Multiplexed?

Postby NigmaTech » Wed May 28, 2008 11:35 pm

Hi!

I;m thinking about controling duty cycle of PWM's in my dsPIC using a joystick connected to computer. I'm trying to use yaw, pitch, roll axis and throttle from "joystick" block in "Virtual Reality Toolbox", data should be transfered via RS-232. Is that possible to make it using your blockset Lubin?

LubinKerhuel
Site Admin - Expert
Posts: 616
Joined: Wed Mar 07, 2007 11:23 pm
Location: Marseille - France
Contact:

Re: Rx Input Multiplexed?

Postby LubinKerhuel » Thu May 29, 2008 12:21 am

Hi NigmaTech,

All required dsPIC peripheral for this application are suported by the blockset. The blockset will help to build in no time the software for the dsPIC.

You will have two Simulink model :
- model onboard the dsPIC
- model for the user interface running on your PC

You have to create your own "high level protocol" to send data from the PC to the PIC throw UART.

On the model onboard the dsPIC, use the UART Rx block to receive data. Once information from UART is decoded, the PWM will be sent throw either one of the peripheral able to generate a PWM signal (PWM Motor, Output Compare)

For the user interface, The hard part is to send data to the UART port from Simulink. I saw once a block able to do it (not a Mathworks block !)

Btw, For this kind of application, I would recommend to use Labview to build the Graphical User Interface. (I built such a system few years ago, see http://lubink.free.fr/projelectro/Autop ... 05_fr.html (french) )
Matlab can do it, but it is more difficult and the result is not as user friencly as with labview.

NigmaTech
Posts: 23
Joined: Wed May 21, 2008 11:53 am

Re: Rx Input Multiplexed?

Postby NigmaTech » Thu Jun 19, 2008 1:06 pm

Could I request You for an example of Simulink model for transmitting data from PC to dsPIC? I need something simple to transmit data via at least one channel, i.e. thrust from joystick via Simulink to dsPIC using RS-232. Probably I should to use xPC blockset but I don't know how :cry:

LubinKerhuel
Site Admin - Expert
Posts: 616
Joined: Wed Mar 07, 2007 11:23 pm
Location: Marseille - France
Contact:

Re: Rx Input Multiplexed?

Postby LubinKerhuel » Thu Jun 19, 2008 9:31 pm

I am not sure xPC is the solution: As far as I know, Virtual reality blockset will not work on xPC Target.
The solution may be to find (on the web) the Simulink block that is able to send data throw Serial port. It is the hard part!
Otherwise, you can write your own block function for simulink and use the command line instructions to send data (from simulink) through UART.

From the PIC, Serial port Rx block is very easy to use and should not be a problem.

NigmaTech
Posts: 23
Joined: Wed May 21, 2008 11:53 am

Re: Rx Input Multiplexed?

Postby NigmaTech » Sat Jul 19, 2008 10:40 am

Could You make an example of Interface in LabView available? Something to sending data, receiving and presenting on grapf diagram. I've got evaluate version of LabView 8.5. I have never used it before :(

LubinKerhuel
Site Admin - Expert
Posts: 616
Joined: Wed Mar 07, 2007 11:23 pm
Location: Marseille - France
Contact:

Re: Rx Input Multiplexed?

Postby LubinKerhuel » Sun Jul 27, 2008 11:35 pm

Hi,

I will not have time to do it soon.
I have to clean up the existing labview files I have.

I attach an old project where labview was used to watch the variables (like the matlab interface rs232gui) and to send new configuration parameters.
This was for a plane. Few screenshoot are available on my french website : http://lubink.free.fr/projelectro/Autop ... 05_fr.html
Data transmission from the PIC use the protocole implemented in the dsPIC block "Tx for Matlab Labview"

All labview files of this project are in the .rar file attached. It is provided as is !
It may be quite messy in its present form.

Lubin
Attachments
Labview.rar
Labview poject of Autopilote with algorithm to decode trames from the block Rx-Tx for Matlab-Labview.
(299.58 KiB) Downloaded 181 times


Return to “dsPIC Peripherals”

Who is online

Users browsing this forum: No registered users and 1 guest