Skip to content
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

Make Vcc an input as a new field of SensorsData; Disable Temperature Estimation #73

Merged
merged 6 commits into from
Jan 15, 2024

Conversation

pattacini
Copy link
Member

@pattacini pattacini commented Dec 28, 2023

This PR implements #10.

We can start testing the architectural changes once @sgiraz is done with the low-level handling of the Vcc readings1.

@marcoaccame already implemented the reading of Vcc on the AMCBLDC board.
@sgiraz is doing the same on AMC.

Important

Clearly, the glue code now needs to pass Vcc as an input. Find below the related references.

struct SupplyVoltage
{
  real32_T voltage;
};

struct SensorsData
{
  // position encoders
  JointPositions jointpositions;

  // motor probes
  MotorSensors motorsensors;

  // supply probes
  SupplyVoltage supplyvoltagesensors;
};

Note

Prior to this PR, Vcc was initialized to $44$ V as a configuration parameter.


@mfussi66, once the PR is merged, you'd need to update the new project consistently.

Footnotes

  1. Actually, we could go on straight away and pass Vcc as a static input for the moment.

@pattacini pattacini self-assigned this Dec 28, 2023
@pattacini pattacini linked an issue Dec 28, 2023 that may be closed by this pull request
@pattacini
Copy link
Member Author

cc @Nicogene

@pattacini pattacini changed the title Make Vcc an input as a field of SensorsData Make Vcc an input as a new field of SensorsData Dec 28, 2023
@pattacini pattacini force-pushed the feat/vcc-as-input branch 2 times, most recently from 9535780 to e59b8b8 Compare December 30, 2023 12:30
@pattacini
Copy link
Member Author

pattacini commented Dec 30, 2023

1aa4764 adds the wrapping angle functionality so that FOC can now guarantee that the input electrical angle is always in the correct range [0, 2$\pi$] to let the CMSIS sin/cos operate as expected. This is much safer.

screenshot

Warning

In order to generate the code, I had to enable the configuration option variable-sized signals for all the models.

@sgiraz, we can give it a run to the whole PR.
@mfussi66, we should consider this point as well to be ported to the new architectural model.

To do so, we need to enable the codegen option for variable-sized signals
@pattacini
Copy link
Member Author

pattacini commented Dec 30, 2023

941628b introduces a variant subsystem approach to disable temperature estimation, which is currently unfinished. This could give us some margin on the overall FOC computation time.

image Screenshot 2023-12-30 200754

Note

By default, the variant parameter is set such that the temperature estimation is OFF.
The Variant Manager can be used to enable/disable the functionality.

@pattacini pattacini changed the title Make Vcc an input as a new field of SensorsData Make Vcc an input as a new field of SensorsData; Disable Temperature Estimation Dec 30, 2023
@pattacini
Copy link
Member Author

pattacini commented Jan 4, 2024

Tip

To settle things once for good, I've provided variants implementations of the Sin/Cos with CMSIS and STD, being the former the default (for the moment):

Screenshot 2024-01-04 183734

@pattacini
Copy link
Member Author

Important

To use the new variant features, we're required to install the Variant Manager Adds-On.

@sgiraz
Copy link
Contributor

sgiraz commented Jan 15, 2024

Hi @pattacini, PR Tested successfully on lego-setup w/ amcbldc! 👍🏻

FOC duration on amcbldc is about 15.5 us:

global view zoomed in
amcbldc_after_Vcc_codegen_global_vision amcbldc_after_Vcc_codegen

Here are the current (Iq), velocity, and position at different targets in current control mode:

image

cc @marcoaccame @Nicogene

@pattacini
Copy link
Member Author

Thanks heaps @sgiraz!
Merging.

@pattacini
Copy link
Member Author

Important

To use the new variant features, we're required to install the Variant Manager Adds-On.

cc @mfussi66 @valegagge @ale-git

@pattacini pattacini merged commit 3c472b4 into devel Jan 15, 2024
@pattacini pattacini deleted the feat/vcc-as-input branch January 15, 2024 15:02
@valegagge
Copy link
Member

Important
To use the new variant features, we're required to install the Variant Manager Adds-On.

cc @mfussi66 @valegagge @ale-git

What do you think if we create a wiki page where all necessary adds-on are listed, so those are not used to work with the model could install all necessary stuff?

@pattacini @sgiraz @mfussi66

@pattacini
Copy link
Member Author

pattacini commented Jan 22, 2024

Yes, I took note of this request.
My idea is rather to fill in the documentation with the missing information.

We still have to complete the (long overdue) task of documenting our journey 😄

@pattacini pattacini linked an issue Mar 13, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AMCBLDC – Read Vcc on the fly
3 participants