Hi I'm trying to control the speed of my DC engines and for some reason I can not build to Arduino. Does anyone know why I get this error?

3 views (last 30 days)
Hi I'm trying to control the speed of my DC engines and for some reason I can not burn the build to Arduino. Does anyone know why I get this error?
When my entry is speed and the outputs are for 2 DC motors. int1, int2, int3, int4, ENA, ENB
No free Timer is available on the target in Multitasking or Auto mode to generate the base rate interrupt which executes the model on the target. All timers are used by Servo and PWM blocks in the model. 1. PWM pins are mapped to a timer on the target hardware. Refer respective Arduino board documentation for PWM pin mapping to timer. 2. Each group of 12 Servo blocks are mapped to a timer on the target hardware. Servo blocks count ranging from 1 to 12 will use first timer, 13 to 24 will use second timer, 25 to 36 will use third timer and 37 to 48 will use fourth timer depending on the number of Servos supported by Arduino board type. Either change the solver mode to SingleTasking or delete Servo or PWM blocks to use the Multitasking or Auto mode. To set the Solver to SingleTasking mode, browse to 'Model Configuration Parameters > Solver > Solver details > Tasking and sample time options', clear 'Treat each discrete rate as a separate task', and click 'Apply'.
Component:Simulink | Category:Model error
function [PWM,IN1,IN2,IN3,IN4] =fcn(v)
PWM=abs(v);
if v<0
IN1=1;IN2=0;IN3=1;IN4=0;
elseif v>0
IN1=0;IN2=1;IN3=0;IN4=1;
else
IN1=0;IN2=0;IN3=0;IN4=0;
end

Answers (1)

Pravarthana P
Pravarthana P on 29 Jun 2022
Hi Yoram Ifraimov,
I understand you are getting an error while running DC engine by building it on Arduino. The error “No free timer available on target ” occurs due to the unavailability of one of the three Hardware timers for the scheduler interrupt. There are two possible workarounds which may resolve your issue:
Hope the above mentioned information helps you!!

Community Treasure Hunt

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

Start Hunting!