Presentation is loading. Please wait.

Presentation is loading. Please wait.

A DC-Motor Micromouse Dr. Tony Wilcox Technology Innovation Centre

Similar presentations


Presentation on theme: "A DC-Motor Micromouse Dr. Tony Wilcox Technology Innovation Centre"— Presentation transcript:

1 A DC-Motor Micromouse Dr. Tony Wilcox Technology Innovation Centre
Birmingham City University

2 Micromouse at TIC Micromouse at TIC evolved as a mechanism to enthuse and engage students more fully in the practical aspects of designing real-time embedded systems. Traditionally, Embedded Systems has been taught using static target boards – flashing LEDs, reading sensors, “traffic-light” controllers etc., and little else. Mobile robots bring in motor drives, positional encoders, real-time systems, closed-loop control theory, and most importantly of all, real-world problems. Mobile Robots becomes “Electronics on Wheels”

3 Key mouse components There are many elements that must come together in a mouse build. Mechanics: chassis, drive system, motors, wheels Power supply: batteries, regulators, charger Power electronics: H-bridge for DC or Stepper motor drive Sensors and signal conditioning electronics for sensing walls Encoders for position, speed, acceleration measurement and control Comms interface for programming and/or debugging A controller: microprocessor, microcontroller, or custom logic

4 Software For real-time software applications look no further ....
Speed and Position measurement: multi-source interrupts Motor Speed and Positional control : P, PD or PID Mouse Position/Velocity/Acceleration profiling Rotational/Traction Control :additional sensors - accelerometers, gyros Orthogonal tracking: in-place turns (rotation), smooth turns – 90,180 degrees Diagonal tracking: 45, 90,135,180 degree in-place and smooth turns Maze Mapping: multi-sensor data acquisition and analysis Maze Solving: Flooding algorithms

5 HEREtic: A low cost DC mouse
The aim of HEREtic was to develop a low-cost, DC motor driven, autonomous mobile robot that would be a versatile educational tool, as well as a competitive maze solver. The key objectives were that it would: have sufficient capability to be a micromouse wall-follower and maze-solver be able to function in other non-micromouse environments (long-range sensors, rf links) provide a reference design for a new influx of mouse-builders.

6 Mechanics The mechanical design and build is usually the stumbling block ... Compact chassis 75mm wide by 130mm long (diagonals?) PCB used as structural element i.e. the chassis (cost) ‘Wheelchair’ drive – 2 motors, 2 wheels independently driven Spur and Pinion gearing for higher torque, lower speed, ‘controllability’ Low cost DC motors (VCR) Sensors at 30, 60, 120, 150, 210, 240, 300, 330 degrees 43mm wheels with ‘O’ ring tyres Laser-printed encoder disk direct mounted on motor shaft Front and rear skids to minimise rocking

7 Design and Build Designed using a 3D CAD package
forces an assessment of all mechanical aspects reduces conflicts/errors in component placement can produce a 2D drawing for import as a mechanical layer on PCB, reducing electronic/mechanical component conflicts. simplifies positioning of fixing holes, cutouts, pillars etc. Machining kept to a minimum used COTS aluminium angle for motor mounts used COTS gears, nylon washers Laser-printed acetate encoder disks Stub axle machined from mild steel rod, but can be made from COTS tube plus bolts.

8 Base Assembly

9 HEREtic model

10 Electronics Plenty of room to show your elegance here – or not ......
8 IR phototransistors , 8 matching IR emitters 2 additional IR emitters at 0,180 degrees for ranging with forward/reverse facing sensors 2 - I2C sensor ports at 0,180 degrees for long-distance ranging using ultrasonic sensors or triangulation IR sensors. All IR phototransistors multiplexed through one signal conditioning circuit – giving good channel matching, ambient cancellation and sample-and-hold. Low cost L293 dual H-Bridge motor driver. PLD used to enable either locked-antiphase or sign-magnitude pwm. RF and wired RS232 comms. ICD connection for debugging.

11 Base-board schematic

12 Top-board schematic

13 Base PCB with overlay

14 Top PCB with overlay

15 HEREtic prototype

16 Development Tools A selection of development tools used for HEREtic.
Protel and Orcad for PCB design and circuit simulation Solidworks for 3D/2D CAD Coreldraw for the encoder disks Quartus II and WARP to simulate and synthesise VHDL for the PLD MPLAB IDE with MCC18 compiler MPSIM source-level code simulation ICD2 and wired-RS232 for debug on the bench RF link for ‘run-time’ RS232 debug

17 OK, so we’ve got hardware...
Embedded microprocessor systems need software to function - some key software elements are: Real-time measurements: wheel speed and position, wall sensors, battery voltage etc. Real-time motor control using appropriate sensor feedback Navigation algorithms Mapping algorithms Solving algorithms User interface (RS232 radio link, on-board LCD, LEDs)

18 DC motor control A typical micromouse motor-wheel arrangement is the ‘wheelchair’ drive. DC motors need a gear-train to reduce speed and improve torque CONTROLLER DRIVER SENSOR MOTOR The wheels are independently driven, though most often the motors share the same controller. Skids or castors on the front and rear limit rocking.

19 The control loop A block diagram can be used to represent the control loop implemented by the controller. GAIN MOTOR SENSOR SET MEASURED e = error R=drive OUTPUT + - The error between desired and actual is calculated, and the value of the error determines the drive applied to the motor. GAIN MOTOR SENSOR SET MEASURED e = error R=drive OUTPUT + - Duplicate the control loop for the other motor.

20 Straight line? One would think that the system discussed would follow a perfect straight line. MOTOR CONTROLLER DRIVER It doesn’t ! This is due to slight difference between the drive-trains, and to an imperfect control system limited by what is termed the ‘steady state error’.

21 Proportional Control If the GAIN is a constant, K, then we have:
R = drive e = error R(t) = K * e(t) The drive is linearly proportional to the error, and so this is termed proportional control. R(t) = Kp * e(t) where Kp is the proportional gain of the controller

22 Steady State Error SET Steady state error Time
k=0.8 Steady state error k=0.6 k=0.4 k=0.2 We will always have a steady state error with a proportional controller R(t) = Kp * e(t) or the discrete form Rn = Rn-1 + Kp * (en - en-1) If the error reduces to zero, there is no drive to the motor, therefore the error can never be zero.

23 ‘Three-Term’ PID control
Simple proportional control has significant limitations – We can overcome these by the use of three gain terms: proportional, integral, derivative  PID P MOTOR SENSOR SET MEASURED e R=drive OUTPUT I D - + With these three terms we can ‘tune’ the response of the system, reducing rise time, overshoot, and steady-state error

24 The Derivative Term SET Kd Kp Time
The derivative is the rate of change – adding this term increases the speed of the response, but with the same steady state error. R(t) = Kp * ( e(t) + Td * de(t)/dt ) Rn = Rn-1 + Kp * (en - en-1) + Kd * (en – 2en-1 + en-2)

25 The Integral Term Zero steady state error SET Ki Kd Kp Time
The addition of the integral term sums the error over time, reducing the steady state error to zero R(t) = Kp * ( e(t) + 1/Ti * ∫e(t)dt + Td * de(t)/dt ) Rn = Rn-1 + Kp * (en - en-1) + Ki * (en + en-1)/2 + Kd * (en – 2en-1 + en-2)

26 Code example You might think that the code for a PID loop would be complex and unreadable: void PID (void) { current_error = desired_speed – measured_speed; pwm_duty = pwm_duty + KP * (current_error - last_error) + KI * (current_error + last_error)/2 + KD * (current_error - 2*last_error + last_but_one_error); last_but_one_error = last_error; last_error = current_error; } Is it? Control theory is just one of the many areas that must be learned, applied, understood in order to persuade a micromouse to give its all - Most of us get by with hand-waving and reading code examples ....!

27 Summary : Skills The design, build, and programming of a micromouse requires multi-disciplinary skills. It provides the opportunity for :- an individual student to develop broad technical skills in new areas or the development of team-working skills amongst a group of mechanical, electronic, and embedded software students. ( Of course, the same skills will be gained by employees who are encouraged to get involved with micromouse )

28 Summary : Skills A complete Micromouse design demands expertise in :
Mechanical design: statics and dynamics CAD for chassis, drive train, integration with electronic sub-systems Analogue and digital electronic design Embedded microprocessor design Printed Circuit Board design/ prototyping skills Real-time embedded software development for uP, uC, SOC or DSP Control system design HINT: many components and some mice are available commercially ....!

29 What everyone wants ….


Download ppt "A DC-Motor Micromouse Dr. Tony Wilcox Technology Innovation Centre"

Similar presentations


Ads by Google