As for any project, large or small, school projects or real-word projects, complications will arise and will require unique solutions to be found. Furthermore, as our society’s bottomless thirst for innovation and technology exponentially grows, items such as LED and mechanical motor speed displays and machine control interface/protocols are now expected from a simple motor controller. The BlackBOX project includes such high-tech features. Some were created from solutions to problems and others were created to impress but all took endless hours of burns, sweat and tears to create. The creator’s desire to make the BlackBOX motor controller standout from the rest, is arguably worthy or recognition.
Visual Speed Indicators
The LEDs indicate the set-point (desired speed). This value is either obtained from either a potentiometer or a serial connection to the computer.
The current speed of the motor is shown by a needle (controlled by a servo motor). The location of the need changes as the motor speed ramps to the desired speed. The speed of the motor and the indicator are both govern by a first order transfer function.
Video available here.
Also click here for more information about the visual speed indicators.
Logic and/or Level Conversions
The 20M2 PICAXE supports a hardware PWM function specifically designed for motor drivers. It can drive any motor driver from single bridge to full bridge. When using the hpwm function in full bridge mode, the output signals to drive the MOSFETs are generated on four output pins: C.3, C.4, C.5 and B.4. But because the board for the PICAXE leads the PortB pins through a Darlington array, the logic of the B.4 pin is inverted. To change the logic back to its original state, a logic converter was created.
Click here for more information about the logic converters used.
Control Switches & Stop Button
There are two switches: a main start/stop switch and a Control mode switch for potentiometer control/serial control.
If the main start/stop switch is in the stop position, then the motor will not move, no matter the input of the potentiometer or the serial connection. If the main motor is in the start position, then the motor speed can be adjusted by the user. If the main switch is placed into the stop position while the motor is running, then the motor will simply ramp down and be motionless till the main switch is back into the start position.
With the control switch, the user can chose between serial control or analogue control via potentiometer. If the switch is on analog control, the speed and direction can be changed via a potentiometer. Thereby, the leftmost position will be full reverse speed and the rightmost position full forwards speed. If the switch is on serial control, the desired speed and direction can be submitted over a serial connection as described in the serial communication section.
Note: Indicator lights are used to let the user know which switch state they are in. Please see section light indicator for control state below for more details
The serial interface is made when connecting either a AXE027 or an AAXE026 cable to the pre-installed serial port located on the AXE118 PCB. The serial communication port will allow the user to send simple serial commands to adjust and retrieve the motor set points, direction and current speed and direction.
Click here for more information about the serial connection.
Ramp Up / Down of the Motor
When adjusting the desired speed of the motor, the actual speed of the motor is not set directly, instead the new desired speed but direction is set and the transfer function/safety checks take care of ramping between desired speeds.
The discrete transfer function implemented for the ramping up is a first order one. The challenge with that part was the fact that the PICAXE supports 8 or 16 bit unsigned integer math only.
Click here for more information about the transfer function and its implementation.
Light indicators for control state
The program governing each function of the microcontroler is a section in the program layout as a sequential machine. The states of the program are; Stopped state, normal operations/serial, normal operations/potentiometer and emergency stop state. Indicator lights were used to indicate to the user in which state the controller is currently executing.
Stop State —— Red light is on
Normal Operations/Potentiometer State —— Green light is on
Normal Operations/Serial State —— Yellow light is on
Emergency State — Siren and Emergency Beacon is on
Note: once the program goes into the emergency state, a hardware reset is needed to reinitialize the microcontroller