Skip to content

eugenius1/esys-cw2

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
mbed-os
 
 
 
 
 
 
 
 
 
 
 
 
 
 

esys-cw2: Brushless DC Motor Control

Embedded Systems coursework 2 by Team GreenRhino (Patrick Foster, Zoe Williamson and Eusebius Ngemera)

System accepts the following regular expression as a command through the serial input:

(R-?\d{1,3}(\.\d{1,2})?)?(V\d{1,3}(\.\d{1,3})?)?

For example, R-10.5V30 will result in 10.5 backward rotations at an angular speed of 30 rotations per second. We expanded the above requirement to recognise a standalone negative angular speed and to be case insensitive:

([Rr]-?\d{1,3}(\.\d{1,2})?)?([Vv]-?\d{1,3}(\.\d{1,3})?)?

When a speed alone is given, motor rotates forever. When a number of rotations alone is given, motor rotates at maximum speed.

Notes:

  • No self tuning of PID parameters (varying inertia)
  • No melody playing
  • With a fixed number of rotations, wait for motor to stop rotating to complete before giving a new command.

More details are in the Report