If you have finished all previous labs and reached this page, congratulations! You have learnt a lot on common hardware used in M2.
And now it's time for the "final boss" - Futura pendulum.
You should have already gained all the relevant skills needed to interact with the hardware:
- Flashing code to the Arduino
- Controlling the BLDC motor to provide rotational motion
- Reading feedback from the magnetic absolute encoder that reads the pendulum angle
There will be no additional labs provided for the pendulum. All that remains is for you to put everything together to complete the task!
Some things that you will be judged on:
- All hardware can be interacted with
- Control of the pendulum (e.g. amount of osciliation)
- Recovery of pendulum position after disturbance
- Coding style
- You should first check that all hardware on the pendulum works normally and you can interact with them using code.
- Mark down the magnetic encoder reading of the "upright" position of the pendulum, you can hardcode it into your code.
- Write a function to read the magnetic encoder feedback and calculate the "error" of the pendulum.
- Write another function to transform the encoder error into motor command.
- If you find the "swing-up" action is difficult, you can either hardcode the "swing-up" action or just ignore it for now. You can move the pendulum to a near-upright position manually.
You are advised to use Git and commit important "checkpoints" of your code.
We expect this task to be somewhat difficult but achievable by trainees. Good luck!