MATLAB Answers

Binary output error when using PID Controller- Simulink

1 view (last 30 days)
Patrick Kane
Patrick Kane on 4 Dec 2016
### Starting build procedure for model: MiniProject2B
Code Generation 1
Elapsed: 6 sec
### Generating code into build folder: C:\Users\Patrick\AppData\Local\Temp\fcctemp\MiniProject2B_ert_rtw
### Invoking Target Language Compiler on MiniProject2B.rtw
### Using System Target File: C:\Program Files\MATLAB\R2016b\rtw\c\ert\ert.tlc
### Loading TLC function libraries
......
### Initial pass through model to cache user defined code
..
### Caching model source code
............................................
### Writing header file MiniProject2B.h
### Writing header file MiniProject2B_types.h
### Writing header file rtwtypes.h
.
### Writing header file multiword_types.h
### Writing header file rtGetInf.h
### Writing source file rtGetInf.c
### Writing header file rt_nonfinite.h
### Writing source file rt_nonfinite.c
.
### Writing header file rtGetNaN.h
### Writing source file rtGetNaN.c
### Writing source file MiniProject2B.c
### Writing header file MiniProject2B_private.h
### Writing source file MiniProject2B_data.c
.
### Writing header file rtmodel.h
### Writing source file ert_main.c
### TLC code generation complete.
### Generating TLC interface API.
...............
### Creating data type transition file MiniProject2B_dt.h
.### Evaluating PostCodeGenCommand specified in the model
### Using toolchain: Arduino AVR v1.6.7 | gmake (64-bit Windows)
### 'C:\Users\Patrick\AppData\Local\Temp\fcctemp\MiniProject2B_ert_rtw\MiniProject2B.mk' is up to date
### Building 'MiniProject2B': C:\PROGRA~1\MATLAB\R2016b\bin\win64\gmake -f MiniProject2B.mk all
C:/ProgramData/MATLAB/SupportPackages/R2016b/3P.instrset/arduinoide.instrset/arduino-1.6.7/hardware/tools/avr/bin/avr-gcc -c -g -w -ffunction-sections -fdata-sections -MMD -DARDUINO=10607 -MMD -MP -MF"MiniProject2B.dep" -MT"MiniProject2B.o" -Os -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -D_RUNONTARGETHARDWARE_BUILD_ -D_ROTH_MEGA2560_ -DMODEL=MiniProject2B -DNUMST=2 -DNCSTATES=2 -DHAVESTDIO -DON_TARGET_WAIT_FOR_START=1 -DONESTEPFCN=1 -DEXT_MODE=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=1 -D__MW_TARGET_USE_HARDWARE_RESOURCES_H__ -DEXIT_FAILURE=1 -DEXTMODE_DISABLEPRINTF -DEXTMODE_DISABLETESTING -DEXTMODE_DISABLE_ARGS_PROCESSING=1 -DRT -DSTACK_SIZE=64 -DMW_TIMERID=5 -DMW_PRESCALAR=256 -DMW_TIMERCOUNT=62411 -DMW_SCHEDULERCOUNTER=1 -D_RTT_BAUDRATE_SERIAL0_=9600 -D_RTT_BAUDRATE_SERIAL1_=9600 -D_RTT_BAUDRATE_SERIAL2_=9600 -D_RTT_BAUDRATE_SERIAL3_=9600 -D_RTT_ANALOG_REF_=2 -DONESTEPFCN=1 -DEXT_MODE=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DON_TARGET_WAIT_FOR_START=1 -DTID01EQ=1 -DEXIT_FAILURE=1 -DEXTMODE_DISABLEPRINTF -DEXTMODE_DISABLETESTING -DEXTMODE_DISABLE_ARGS_PROCESSING=1 -DRT -DSTACK_SIZE=64 -DMODEL=MiniProject2B -DNUMST=2 -DNCSTATES=2 -DHAVESTDIO -IC:/ProgramData/MATLAB/SupportPackages/R2016b/toolbox/target/supportpackages/arduinobase/include -IC:/ProgramData/MATLAB/SupportPackages/R2016b/toolbox/target/supportpackages/arduinobase/blocks/sfcn/include -IC:/Users/Patrick/AppData/Local/Temp/fcctemp/MiniProject2B_ert_rtw -IC:/Users/Patrick/AppData/Local/Temp/fcctemp -IC:/PROGRA~1/MATLAB/R2016b/extern/include -IC:/PROGRA~1/MATLAB/R2016b/simulink/include -IC:/PROGRA~1/MATLAB/R2016b/rtw/c/src -IC:/PROGRA~1/MATLAB/R2016b/rtw/c/src/ext_mode/common -IC:/PROGRA~1/MATLAB/R2016b/rtw/c/ert -IC:/PROGRA~1/MATLAB/R2016b/toolbox/coder/rtiostream/src/utils -IC:/ProgramData/MATLAB/SupportPackages/R2016b/3P.instrset/arduinoide.instrset/arduino-1.6.7/hardware/arduino/avr/cores/arduino -IC:/ProgramData/MATLAB/SupportPackages/R2016b/3P.instrset/arduinoide.instrset/arduino-1.6.7/hardware/arduino/avr/variants/mega -IC:/ProgramData/MATLAB/SupportPackages/R2016b/toolbox/target/supportpackages/arduinotarget/registry/../include -IC:/ProgramData/MATLAB/SupportPackages/R2016b/toolbox/target/supportpackages/arduinotarget/registry/../scheduler/include -o "MiniProject2B.o" "MiniProject2B.c"
MiniProject2B.c: In function 'MiniProject2B_step':
MiniProject2B.c:294:1: error: unable to find a register to spill in class 'POINTER_REGS'
}
^
MiniProject2B.c:294:1: error: this is the insn:
(insn 684 683 686 45 (set (reg:SF 185 [ D.2972 ])
(mem:SF (post_inc:HI (reg:HI 16 r16 [orig:224 ivtmp.20 ] [224])) [6 MEM[base: _246, offset: 0B]+0 S4 A8])) MiniProject2B.c:111 99 {*movsf}
(expr_list:REG_INC (reg:HI 16 r16 [orig:224 ivtmp.20 ] [224])
(nil)))
MiniProject2B.c:294: confused by earlier errors, bailing out
gmake: *** [MiniProject2B.o] Error 1
### Creating HTML report file MiniProject2B_codegen_rpt.html
### Build procedure for model: 'MiniProject2B' aborted due to an error.
Error(s) encountered while building "MiniProject2B":
### Failed to generate all binary outputs.
My simulink model that controls a speed of a fan works perfectly when just using one kp block, there was however a steady state offset in the actual fan speed so i tried to subsitute this individual gain block with a PID controller to get rid off the offset and I am now receiving this error. Does anyone have any ideas on how to fix this?

Answers (0)

Community Treasure Hunt

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

Start Hunting!