AA-CubeSat-Team / soci-gnc

Development of the on-board GNC software for the SOC-i mission.
1 stars 1 forks source link

Create a Main Sim for the FlatSat Unit #120

Open tpreynolds opened 3 years ago

tpreynolds commented 3 years ago

Create a version of the Main Sim that can be used for flatsat. This will coexist with the current Main_Sim.slx, but contain read/write libraries for hardware communication.

tpreynolds commented 3 years ago

Code Organization The flatsat read/write libraries are located in Lib/FlatSat. There are separate files for reading and writing. There is a model file in Src/Main_Sim_FlatSat.slx that you'll use to "run the sim" during flatsat testing.

This code is on the dev_flatsat branch.

Porting Your Code I've shown how to extract the signals for the write library, and how to construct the bus signal for the read block. You are kind of stuck using the input/outputs listed, unless you have a real strong case for why one of them needs to change. (Note: you can of course read in the reaction wheel RPM and compute the torque from that, you just can't easily change the definition of the actuator_control bus in Simulink).