130 likes | 296 Views
Advanced Energy Vehicle. Arduino Programming Basics Reference: AEV Lab Manual Arduino Programming Basics Grading Guidelines. FINAL DESIGN. AEV Project Objective (Problem Definition). Initial Concepts (Brainstorming). experimental Research. (Programming). (System Analysis). PT 1
E N D
Advanced Energy Vehicle Arduino Programming Basics Reference: AEV Lab Manual Arduino Programming Basics Grading Guidelines
FINAL DESIGN AEV Project Objective (Problem Definition) Initial Concepts (Brainstorming) experimental Research (Programming) (System Analysis) PT 1 PT 2 PT 3 PT 4 Present AEV Design
Lab Objectives • The objectives of this lab are: • Become familiar with the automatic control system hardware components • Setup the software • Program the basic function calls in controlling the AEV • Become familiar with uploading programs on the Arduino and testing • Become familiar with troubleshooting techniques
Hardware • The heart of the system consists of an ArduinoNano (see Figure 1), controlling two Toshiba motor control chips • See AEV Controller Manual • For those interested in details
Making the Connections • Take careful consideration where the motors and battery are connected to the control system! • We will only be using the first and second motor ports • Male and female connectors are already installed • ASK if uncertain!
The Arduino Software • The Backbone has been developed for AEV • Not expected to be a microprocessor programmer • The AEV controller is programmed by the user (you), using a series of function calls which have various integer input types: • byte, int, and long • More detail can be found in AEV Controller Manual if interested
Programming Basics Arduino Programming Basics Procedure Guidelines: • The following slides are a summary of the AEV Lab Manual and Lab Procedure Guidelines • First an overview will be given on how to properly upload the AEV sketchbook program • Then a review of the function calls available to you
AEV Controller AEV Controller – Loading the executable • Copy sketchbook folder from the class drive • Paste into and run from a flash drive (or N: drive) • Using the AEV Lab Manual load the Arduino Software
AEV Controller AEV User Manual – Arduino Programming Basics • In the Arduino software • File – Preference • Browse to AEV Controller Folder and select the sketchbook folder • ***CLOSE AND RELOAD EXECUTABLE*** • In the Arduino software • File – sketchbook – “Open desired file” • Confirm that the right Com Port is selected when uploading control programs • Tools – Serial Port – last Com Port listed
AEV Controller AEV User Manual – Available Keywords • celerate( ) • Four Arguments • Motor number 1,2,3, and 4 for all • Start speed in % (0 – 100) • End speed in % (0 – 100) • Time in seconds (1 – 10) • Example: celerate(4,20,50,2) • Will accerlarate all motors from 20% to 50% full power in 2 seconds. • Example: celerate(2,100,20,1) • Will decelerate motor 2 from 100% to 20% full power in 1 second.
AEV Controller AEV User Manual – Available Keywords • motorSpeed( ) • Two Arguments • Motor number 1,2,3, and 4 for all • Start speed in % (0 – 100) • Example: motorSpeed(2,67) • Sets motor 2 speed to 67% full power • goFor( ) • One Argument • milliseconds • Example: goFor(5000) • Continues the last command for 5 seconds.
AEV Controller AEV User Manual – Available Keywords • brake( ) • One Argument • Motor number 1,2,3, and 4 for all • Example: brake(2) • Fully brake motor 2 • reverse( ) • No Arguments; reverses all motors • Example: reverse() • Reverses all motors
Arduino Programming Basics Lab Lab Activity • Follow AEV Lab Manual and Lab Procedure Guidelines • Team: • Setup for testing • Individual: • Copy sketchbook folder on to a flash drive • Setup Arduino software with sketchbook • Program the following basic commands requested in procedure document • Demonstrate to one of the instructional team members (signed) • Make sure to include in your INDIVIDUAL summary report