This remote laboratory consists of a Lego Mindstorms NXT brick with two Lego DC motors. Main lab interface will show motors on realtime camera stream, whereas in console, user can see current data in next format:
current time, setpoint1, setpoint2, control variable1, control variable2, speed1, speed2, position1, position2, disturbance1, disturbance2
Motor have incremental encoder, giving 360 ppr. User can upload his/her own python script, defined as following:
class Robot: #Class initializationdef __init__(self):self.period = 0.05 #Sampling period in secondsself.duration = 5 #Duration of experimentself.upravljanje1 = 0 #Control variable of first motorself.upravljanje2 = 0 #Control variable of second motorself.emP1 = 0 #emulated load for the first motorself.emP2 = 0 #emulated load for the second motorself.r1 = 0 #setpoint if closed-loop control is implemented for first motorself.r2 = 0 #setpoint if closed-loop control is implemented for second motor #main program logicdef loop(self,t,omega1,omega2,teta1,teta2):return self.upravljanje1-self.emP1, self.upravljanje2-self.emP2
View and write the comments
No one has commented it yet.