CG2111A - Mod Review

| ⌛ 5 minutes read

📋 Tags: NUS Modreview Essay


Engineering Principles and Practice 2 (EPP2)

CG2111A, aka EPP2 is the highlight module for Computer Engineering freshies.

Personally, it’s one of my favourite modules of the semester despite the difficulty. You can expect to build interesting things and learn a whole range of computing topics.

I will be sharing my experience based on the AY 21/22 Semester 2 iteration.

CG2111A Maze Mapping Image
Mapping the maze using Alex's LiDAR

^ To reiterate, you’ll be building cool stuff :)

Similar to EPP1, expect a flipped classroom format where content learning is done asynchronusly and the hands-on learning done via labs and tutorials. Unlike EPP1, there is much less waffling around with electronics and more focus on the software aspect.

In my subjective opinion, this module is manageable with consistent effort. As with most modules, the concepts you learn will build on one another. Look forward to learning useful microcontroller programming knowledge – what you learn here will equip you to get started on real hardware-software / IOT projects.

tl;dr Overview

Difficulty:
HARD ⭐⭐⭐⭐/5

Workload:
HEAVY ⭐⭐⭐⭐/5

Enjoyment:
YES ⭐⭐⭐⭐⭐/5

Syllabus

The syllabus was cut down from the mod’s previous iteration, CG1112 (6MCs!). Rest assured that you will still be taught a lot. of. content. Majority of these topics fall under the scope of low-level programming. You will learn how to bare-metal program a atmega328p microcontroller (the chip in the middle of your Arduino) and more. It’s done in C/C++, but there is no need to fully understand C++ or OOP to do this module.

Topics taught include (based on my notes and failing memory):

  1. Bits, Hexes, Decimals
  2. Bare Metal Programming ⭐
    • Learn what bit registers are and how to use them
    • Interrupts, PWM, Timers, Analog to Digital Conversion, USART (communication protocol)
  3. Secure networking
    • TLS Protocol
    • Ciphers, Hashes and Encrypting
      Note: These are covered relatively shallowly, it is sufficient to just understand the concept.
    • Alice, Bob and Charlie will be your besties (iykyk)
  4. LiDAR Sensor
    • Environment mapping algorithms
      SLAM, RANSAC, etc…
    • RobotOS

Grading

  • Graded lab report (20% total), best 4 of 5 studios
  • Quiz 1 - Midterms (10%)
  • Quiz 2 - Finals (10%)
    • Don’t expect the quizzes to be grindable like EPP1. Midterms for AY21/22 was quite hard and on average of the cohort including me did quite badly. Finals was easier!
  • Project Run (40%) - How many tasks could your robot do?
  • Project Documentation (20%) - How did you program and design your robot?
    • Design Report (10%)
    • Final Report (10%)

Review & Advice

General

Put in extra effort to understand/be proficient in basic bit manipulation, data formats and bitmasking. This is the foundational concept that all bare-metal programming (which is the majority of this course) will build on.

Some concepts take more time to digest, even with the lectures. I personally felt that the topics on Timers and PWM needed more time and effort to understand. The Atmega328p Datasheet & Google will be your best friend.

Quizzes

They will be hard. Much harder than CG1111A. The quizzes were open internet, which should hint to you on how un-googleable some of the things are. Undestand the concepts being taught and BE FAMILIAR WITH YOUR DATASHEET. Once again, it will be your best friend.

Specific Tips

The Robot Operating System (ROS) will be introduced to you early on, albeit briefly. Most people tend to shun it because its a ‘hard framework’. But if you treat it as a learning exercise and something fun, it will be rewarding and make your project later on much easier (speaking from experience).

By recess week, you can consider giving yourself a refresher on basic linux commands because you will be playing with a Raspberry Pi soon (which runs on Linux). The basics such as: cd ls pwd touch rm vim file bash ping will be sufficient to get you through this course.

Bash scripting will save you and your team lots of time. Take 5-15min to learn the basics of it and it will help you simplify things such as compiling long g++ commands or running repetitive, sequential linux commands.

Project ⭐

Project is similar to CG1111A, with the whole #!1 including a design report, graded run and peer review. This component carries the highest weightage. You will be building a remotely operated robot called Alex.

You will control Alex to map out its environment using a LiDAR to do stuff. The quality of your map and how well you pilot Alex are key metrics for grading.

You may feel that the project implementation is somewhat spoon-fed to us. Quite a fair bit of boilerplate has already been set up for us (TLS, motor movement), unlike CG1111A. No. This is a trap.

There is a fair bit of implementation work to be done, such as converting the code to bare-metal. Like CG1111A, you will face the same issues of physics causing leaky abstractions and the need to tune your bot. Ideally, start planning and discuss as a group how to implement Alex the during the LiDAR studio where you will be exposed to gnuplot and ROS.

Minimum effort by rolling with whatever is provided out of the box will only bring you so far (not far). You are guaranteed + CHOP to have a hard time during the graded robot run if you are minimal in implementation.

For better or for worse, you are expected to do your own research to figure out how to better implement certain software components for Alex2, be it using different frameworks or doing extra stuff (which is graded btw, under an ‘awesome’ rubric for my year). For example, some teams managed to control Alex with a game controller!

For me personally, I think it may be interesting if you explored using virtual machines or Docker in this project *hint hint nudge nudge*. Version control software such as git will be very useful, especially since there are many moving parts in this project. If you thought CG1111A was complex, you are in for a ride.

In conclusion, to do well/have a better time, you MUST go the extra mile.

To future freshies taking this mod, all the best!


  1. Shebang↩︎

  2. Such as the mapping feature and how to control Alex. ↩︎