Thrust for unmanned two-engine aircraf : Problem with blocks

Post Reply
Phil
Posts: 1
Joined: Wed Dec 26, 2007 7:17 pm

Thrust for unmanned two-engine aircraf : Problem with blocks

Post by Phil » Fri Dec 28, 2007 9:22 pm

Hi Lubin,
I encountered some problems with my model while generating the code. I think I made something wrong in the configuration, but could not figure out what it was. Maybe you could help me?
For better understanding here is waht i want to do: I am building a syncronization for the thrust for an unmanned two-engined aircraft. Therefor I need two inputs (Input Capture) for the engine speed, which will be converted with the 2D look up table (which should normally consist of mor values) (by entering the engine speed and velocity) into thrust of the airscrew. Then I take the difference of the to thrusts and compare it with the difference I want to have (ADC INput1). Then next two blocks are for the PI-Controller. The ADC Input (AN_0) represenst the signal I get from the autopilot for the speed of the aircraft. This signal will be added/subtracted with the signal from the controller and changes the mass flow to the engine (PWM Motor Output).

Here is the error message:

Error building Real-Time Workshop target for block diagram 'dspic_model'. MATLAB error message:
Error using ==> RTW.genMakefileAndBuild
Error(s) encountered while building model "dspic_model".


And this is what it said before: (I also uploaded the model)

### Starting Real-Time Workshop build procedure for model: dspic_model
### Generating code into build directory: D:\My Documents\Studienarbeit Chile\Messungen\dspic_model_dspic\sources
Number of I/O PINs used : 4
[...] (removed by Lubin)
dspic_model.c: In function `dspic_model_step':
dspic_model.c:89: error: `ic2RisingPeriode' undeclared (first use in this function)
dspic_model.c:89: error: (Each undeclared identifier is reported only once
dspic_model.c:89: error: for each function it appears in.)
dspic_model.c:340:1: warning: "config2" redefined
dspic_model.c:325:1: warning: this is the location of the previous definition
gmake: *** [dspic_model.o] Error 0xff


Thanks for your help

Philipp
Attachments
dspic_model.mdl
(39.23 KiB) Downloaded 298 times

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

Re: Thrust for unmanned two-engine aircraf : Problem with blocks

Post by LubinKerhuel » Fri Dec 28, 2007 11:35 pm

Thanks for your message Phil.

The error comes from the multiple use of blocks that should be used only once in a model :
If you are to use more that one Input Capture port, use only One block IC and configure this block to get many IC ports.
Same remark for the ADC block,PWM motor block, OC block and others. Only The Digital Write, Read can be present in multiple place in a model. Same for the Rx-Tx blocks and the Tx-for-Matlab-Labview...

Find attach the model with some modifications that compile. I also added few remarks. It would be fine if we could have a look on the final version (when the controller works).
Trust_twoEngineAircraft.png
Trust_twoEngineAircraft.mdl
Modified version of dspic_model.mdl done by Phil
(39 KiB) Downloaded 281 times
Few question remains : why is the PI only controlling the differential trust. Isn't it possible to use 2 PI? ( one for differential and one for common thrust, or more simple : one for each motor).

Lubin

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests