This is an old revision of the document!
Exercises
The goal is to write a program which is able to perform tasks described below.
Warm up exercise
Controlling the DC motor using a digital board. By pressing S1 button, LED1 is lit and the motor turns clockwise. By pressing S3 button, LED3 is lit and the motor revolves anti clockwise. By pressing S2, LED2 is lit and the motor is stopped.
For rookies
Robot, by using two DC motors and touch sensors movement of a robot is simulated. Touch sensors are the buttons of the digital board (S1…S3). The motor is controlled by pressing the buttons. S1 stops the left motor for 2 seconds and then starts both motors at full speed. S2 stops the right motor for two second and then starts both motors at full speed. If both buttons are pressed, the motors are rotating in reverse direction until the buttons are released
Servo motor, the servo motor is controlled via the buttons of the digital board. By pressing down S1 the servomotor moves one step to the right. By pressing down S3, the servo motor moves one step to the left and S2 makes the servomotor to move to the initial (middle) position. The position of the servo motor is displayed live on the 7 segment display (each number corresponds to 10 degrees of the turn: middle position equals 5).
Radar, functioning of radar is simulated. In order to identify objects closer than 0,5 meters, IR distance sensor is installed to the lever of the servo motor. The lever of servo motor is moving constantly form one extreme position to the other and it carries this sensor all the time with itself. If there happens to be an object in closer range than 0,5 meters of the sensor, then the servo motor is stopped for 5 seconds and by signaling a LED (PB7) on the controller board detection of the object is announced.
Stepper motor, after each pressing on the buttons S1 and S3 it rotates 10 steps, accordingly clock wise and anti clock wise. The rotation is stopped immediately by pressing on the button S2.
All three different types of the motors are connected. By pressing a button it starts and stops a certain motor. S1 controls the DC motor. S2 controls the servo-motor and S3 controls the stepper-motor.
For advanced
Alalisvoolu mootor kiirendab S1 nupu allavajutamisel ning hoiab S1 nupu vabastamisel saavutatud kiirust. S2 nupu allavajutatud asendis hoidmise ajal mootor aeglustub sujuvalt. S3 allavajutamisel peatub mootor viivitamatult (simuleerides avariipeatamist).
Objekti jälgimine. Kasutades ultraheli kaugusandurit, mis on paigaldatud servomootori hoovale, peab servomootor jälgima mööduvat objekti. Mootor pöörab vastavalt objekti liikumisele nii, et objekt oleks kogu aeg anduri vaatevälja keskel.
Samm-mootor säilitab mootori viimase asendi pärast iga jada muutust. Uue jada aktiveerimisel kasutage muutujat, et jätkata liikumist täpselt viimasest mootori asendist.
Kiirendus. Programm võimaldab muuta samm-mootori kiirendamist/aeglustamist. Kasutage lineaarseid kiirusekaldeid, mida saab visuaalseks ülevaatuseks lihtsalt tuvastada. Pikemad liikumised peavad toimuma järgmise skeemi järgi: kiirendamine –> püsiv kiirus –> aeglustamine.
Koostage alalisvoolu mootorile PID regulaator. NB! Harjutus vajab tagasisidega mootorit. Ülesande võib lahendada ka teoreetiliselt.
Kordamisküsimused
Milleks kasutatakse H-silda? Mis on selle toimeprintsiip?
Kuidas on määratud RC servomootori võlli asend?
Milline on põhierinevus uni- ja bipolaarsamm-mootorite vahel?
Kuidas rakendada samm-mootoris poolsamm- ja mikrosammrežiime? Tooge näide.
Kuidas juhitakse alalisvoolu mootori pöörlemiskiirust? Tooge näide.
Millist pulsilaiuse modulatsiooni (PWM) töötsüklit on vaja, et saavutada alalisvoolu mootori võlli pöörlemiskiiruseks 70% nominaalsest pöörlemiskiirusest?
Kuidas määratakse enkoodri kasutamisel mootori pöörlemissuund?
Kuidas saab alalisvoolu mootorit elektriliselt pidurdada?
Mis juhtub, kui samm-mootori puhul kommutatsiooniskeem muutub liiga kiiresti?
Kas ja kuidas on võimalik kasutada dünaamilist pidurdamist?