cancel
Showing results for 
Search instead for 
Did you mean: 

I would like to give a shaped input to a faulhaber DC micromotors using the NUCLEO-F401RE and X-NUCLEO-IHM04A1 combination. The signal I want is a Simulink array, created by a simulink model. How do I get that array/input to the the motor?

CLouw.1
Associate
 
4 REPLIES 4
Dario CUCCHI
ST Employee

Hi @CLouw.1​ , welcome to the ST Community !

The X_NULEO-IHM04A1 mounts the L6206 motor driver, which has two full bridges to drive two different motors.

Each full bridge can drive the current in the motor in both direction and the voltage of each OUT pin can be GND or Vs (the voltage supply).

Have a look at the L6206 datasheet.

According to the values of your Simulink array, you can set the value of each full bridge, and so the current in the motor.

By the way, which is the format of the array ? Is the array a sequence of “ones�? and “zeros�? representing the status of one output ?

Or is it a sequence of the duty cycle which must be applied to a square wave of the OUT pin ? Or maybe it represent something else: can you specify it ?

Anyway, whichever is the array format, I think a possible way to implement your request is:

  • copy the values of the array in the firmware which is loaded on your NUCLEO-F401RE.
  • set a Timer of the microcontroller generating an interrupt in order to have a time base
  • at each interrupt increment the index and select the new element of your array
  • set the status of the digital line according to the new element of the array

Let me provide an example, maybe it can help:

  • connect the DC motor to the full bridge A (OUT1A and OUT2A)
  • suppose to force current in the motor flowing from OUT1A to OUT2A.
  • set OUT2A always to GND setting the digital input IN2A always low.
  • The status of OUT1A depends on the status of the digital input IN1A: change the status of the microcontroller digital line connected to IN1A according to the values of the array.

Please let me know if this post helps or if you need further support.

Dario CUCCHI
ST Employee

Hi @CLouw.1​ , was my answer useful ?

If so mark the answer as best, to increase its visibility for community members who could have the same issue.

Thanks and all the best !

I unfortunately did not use your solution, as I already came up with a different solution before your reply. So I cannot comment on the validity of the solution.

Dario CUCCHI
ST Employee

Thanks for your reply @CLouw.1​ , good to know that the problem is solved and you get the desired result :thumbs_up:

Do you mind coming back and describing your solution for the problem?

This may help other users with the same issue and will be much appreciated by the community :smiling_face_with_smiling_eyes:

Thank You very much anyway and have a good day !