0
0
Simulinkdata~10 mins

H-bridge driver simulation in Simulink - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define the input voltage source block.

Simulink
voltage_source = Simulink.VoltSource([1]);
Drag options to blanks, or click blank then click option'
A5
B10
C12
D15
Attempts:
3 left
💡 Hint
Common Mistakes
Using too high or too low voltage values that are not typical for H-bridge simulation.
2fill in blank
medium

Complete the code to set the PWM frequency for the H-bridge driver.

Simulink
pwm_frequency = [1];  % in Hz
Drag options to blanks, or click blank then click option'
A5000
B2000
C1000
D10000
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing too low frequency causing motor noise or too high causing switching losses.
3fill in blank
hard

Fix the error in the code that sets the direction control signals for the H-bridge.

Simulink
direction_signal = [1];  % 1 for forward, 0 for reverse
Drag options to blanks, or click blank then click option'
ATrue
B0
C'forward'
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using string values or boolean True/False which cause simulation errors.
4fill in blank
hard

Fill both blanks to create a dictionary mapping motor states to PWM duty cycles.

Simulink
duty_cycles = { 'forward': [1], 'reverse': [2] }
Drag options to blanks, or click blank then click option'
A0.8
B0.5
C0.2
D1.0
Attempts:
3 left
💡 Hint
Common Mistakes
Assigning the same duty cycle to both directions, which doesn't simulate direction change.
5fill in blank
hard

Fill all three blanks to define the H-bridge output signals based on PWM and direction.

Simulink
outputs = { 'high_side': pwm_signal if direction == [1] else 0, 'low_side': pwm_signal if direction == [2] else 0, 'enable': [3] }
Drag options to blanks, or click blank then click option'
A1
B0
CTrue
DFalse
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up direction values or using False for enable which disables output.