Rx Input Multiplexed?
Rx Input Multiplexed?
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?
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?
-
- Site Admin - Expert
- Posts: 616
- Joined: Wed Mar 07, 2007 11:23 pm
- Location: Bayonne- France
- Contact:
Re: Rx Input Multiplexed?
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.
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.
Re: Rx Input Multiplexed?
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 ![Crying or Very sad :cry:](./images/smilies/icon_cry.gif)
![Crying or Very sad :cry:](./images/smilies/icon_cry.gif)
-
- Site Admin - Expert
- Posts: 616
- Joined: Wed Mar 07, 2007 11:23 pm
- Location: Bayonne- France
- Contact:
Re: Rx Input Multiplexed?
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.
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.
Re: Rx Input Multiplexed?
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 ![Sad :(](./images/smilies/icon_sad.gif)
![Sad :(](./images/smilies/icon_sad.gif)
-
- Site Admin - Expert
- Posts: 616
- Joined: Wed Mar 07, 2007 11:23 pm
- Location: Bayonne- France
- Contact:
Re: Rx Input Multiplexed?
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
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 614 times
Who is online
Users browsing this forum: No registered users and 79 guests