-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AMCFOC: refactor motor-specific supervisor to be used with For Each subsystem
#65
Comments
Currently the Motor Supervisor (MS) looks like this: Many signals have been disabled so that we could have only one triggering the execution of the charts. However, some charts have been disabled because their existence we could cause a data dependency violation, and therefore an error. Therefore, it might be necessary to do a whole refactor of the MS, and not a partial one. Due to the number of output events and triggered subsystems, we can see that the Simulink blocks basically behave like a big stateflow chart. I think we could create a single chart that incorporates the functionalities of these blocks. While modularity might be impacted, I think it's just a matter of presentation, as stateflow charts can be modularized with parallel charts and sub-charts. |
Agree 👍🏻 |
I added another parallel chart to handle the fact that a new setpoint could come either from the dispatcher or the control mode handler, but it's super simple, since its task is only to copy the values towards the Targets output: Note that the chart always writes the setpoint at the moment, no matter the type of event. This is of course a huge simplification, and it can be subject to change as requested. I created a simple test and the setup of the control mode seems to be respected so far: MATLAB_RnDGVdVdLx.mp4 |
Nice! |
Latest commit correctly allows to set the target, and it seems like the model can run in simulation inside the ForEach. |
Interestingly, the code generation in C works for the motion controller with the new supervisor 🎉 Anyway, at the moment, I'm encountering a difficulty on how to use the initial configuration.: |
Super 🚀
Can't we have an array whose elements are of a structured type like the one we're currently employing? Maybe it's too simplistic. |
That can be done! |
After all, the initialization param can be an extra input w/o loss of generality. |
Opened a PR here #68 to wrap up the work on this specific issue and document the changes. |
Completed via #68! |
The idea of the AMCFOC motion controller is to be referenced in a For Each subsystem. This kind of subsystem allows calling the block multiple times, depending on the dimensionality of the input/output signals. In this way, we can use the same functions for multiple motors.
However, this type of subsystem relies on the internal function-call subsystems to have the trigger signal of width=1. The motor-specific supervisor is full of these triggers. It is therefore necessary to replace this kind of logic with an equivalent one, most likely with a less modular state machine, that allows us to resolve this limitation and enable the full features of the supervisor.
After this, it will be possible to create unit tests for the motor-specific supervisor.
The text was updated successfully, but these errors were encountered: