Showing posts with label build. Show all posts
Showing posts with label build. Show all posts

Sunday, 30 August 2026

Creality Ender 3 New Aluminium Build Plate

 Introduction 
This short post covers the design and fitting of a prototype metal plate to replace the heater plate on a Creality Ender 3 printer.

Fusion 360 Model of Ender 3 Mounting Plate
Fusion 360 Model of Ender 3 Mounting Plate

Repurposing the Ender 3
A Creality Ender 3 printer was repurposed for optical inspection of hardware such as electronic circuit boards. A new bed/mounting plate was required to hold circuit boards in position. The stock heater plate from Creality could be reused by drilling and tapping; however, this is a one-way trip for the heater plate. With no similar plates for the Ender 3 in my region, a build plate was designed in the software tool, Fusion 360.

Fusion 360
During the mechanical design in Fusion, items such as the mounting hole spacing were considered. The existing connection to the Ender 3 gantry was duplicated; this is a four-hole rectangular placement of 170 mm.

Fusion 360 Fully Dimensioned Plate
Fusion 360 Fully Dimensioned Plate

The heater plate on the Ender 3 is secured with four 5 mm countersunk bolts. These bolts were reused for the build plate.

Fusion 360 M5 Hole Configuration
Fusion 360 M5 Hole Configuration

Since the build plate was designed for testing, 4 mm x 0.7 mounting holes were included along several axes. The release version of the plate would likely require more mounting holes to suit circuit boards of different sizes.

Fusion 360 M4 Hole Configuration
Fusion 360 M4 Hole Configuration

Manufacturing
After reviewing similar optical inspection solutions, the decision was made to manufacture the plate
 in 6061 aluminium with a black matte anodised surface finish to help minimise light reflections.

The plate thickness was set to 4 mm, resulting in a measured plate weight of 590 grams. This weight reduction is ideal for the Ender 3 mechanics. For reference, the Creality heater plate and a glass bed weigh approximately 1000 grams.  

The plate manufacturer required the usual STEP files and drill drawing details to manufacture the design. The files are available for download at the end of the post.

Manufactured Plate for Ender 3

Manufactured Plate for Ender 3 

Fitting the Plate to the Ender 3
The Ender 3 was already modified with the filament feeder, nozzle and heater plate hardware removed. Without the heater plate fitted, the lower gantry was easily visible.

Ender 3 Lower Gantry (Bed) Interface
Ender 3 Lower Gantry (Bed) Interface

Four 10 mm solid plastic spacers were printed to space the prototype plate from the gantry.

PLA 10 mm Spacer for Plate
PLA 10 mm Spacer for Plate

The factory-supplied 5 mm levelling nuts were not reused. To prevent the levelling nuts from working loose, 5 mm Nylon insert lock nuts were fitted.

During testing, no adjustments were made to the Ender 3 software acceleration and speed settings (Marlin build). The Marlin version 2 firmware was recompiled to disable the unused hardware (heater plate, nozzle and thermistor) mentioned above.

Simplified Marlin Interface for Ender 3
Simplified Marlin Interface for Ender 3

A basic G-code example was run from the SD card on the Ender 3. The code below was saved to the SD card as a file.

G28 Y 
G90 
G1 Y0 F3000 
G1 Y235 F3000 
G1 Y0 F6000 
G1 Y235 F6000 
G1 Y117.5 F3000

The clip below shows the Ender 3 with the prototype plate fitted.



Design Notes
The countersink holes in the prototype plate were too shallow for a flush finish with the countersink bolts. Depending on the plate's final use, the countersink holes should be made larger.

Raised Countersink Bolt
Raised Countersink Bolt
 
Downloads
 
Ender 3 Plate Drill Drawing

Ender 3 Plate STEP

Wednesday, 11 April 2018

Build Number for PSoC Creator Projects - Post Build

Summary
Recently during development of a PSoC based project there was a requirement to use an automatic incrementing build number. This blog provides an example project with incrementing build number using command line scripting.

The use of a build number may be considered trivial by some and certainly with the use of revision control software such as Veracity, SourceGear's Vault or Fossil this is most likely the case. There are however situations where applying revision control consumes more time and resources than necessary. Providing a programming file, which can be identifiable, can remain a suitable solution for a software developer.

Test Hardware
In order to test the incrementing build number using PSoC Creator, hardware was not compulsory. For demonstration an example project was based around the Cypress PSoC development kit CY8CKIT-042.

CY8CKIT-042
CY8CKIT-042 - Courtesy Cypress Semiconductor

Script
While searching online for a suitable script, I came across a thread on Stack Overflow from user ansgar-wiechers. The example script he listed, which can be seen on StackOverflow, served as a basis for the PSoC Creator script.

So what does this script do.... firstly it looks for a file called buildnumber.h in the PSoC Creator project path. Next, the contents of the header file is searched until the string BuildNumber= is found. Then the integer following the equals sign is incremented by one. The original file, with an updated build number, is then saved back to the original buildnumber.h file.

As can be seen in the script below, there are no checks, no limits, so programmer beware!

Set fso = CreateObject("Scripting.FileSystemObject")

Set re  = New RegExp

re.Global = True


Function IncMaint(m, g1, g2, pos, src)

  IncMaint = g1 & (CInt(g2)+1)

End Function


ProjectMainFolder=fso.GetAbsolutePathName(".")

WScript.Echo ("Build number: Incrementing the build number located at:" & ProjectMainFolder)

rcfile = ProjectMainFolder & "\buildnumber.h"

WScript.Echo(rcfile)

rctext = fso.OpenTextFile(rcfile).ReadAll

re.Pattern = "((?:BuildNumber) )(\d+)"

rctext = re.Replace(rctext, GetRef("IncMaint"))

re.Pattern = "((?:BuildNumber)= )(\d+)"

rctext = re.Replace(rctext, GetRef("IncMaint"))

fso.OpenTextFile(rcfile, 2).Write rctext


Build Number Header File
In the file containing the build number the project major and minor revisions were also included.

/****************************************************************************
* buildnumber.h
*
* Example header file to show usage of BuildNumber keyword and equals signal
*
* The text BuildNumber= can be anywhere in this file
*
*****************************************************************************/
#include "project.h"
const uint8_t MajorRev= 1;
const uint8_t MinorRev= 1;
const uint8_t BuildNumber= 1;

PSoC Creator - Post Build Command
A call is made to the external VBS file under the PSoC Creator menu, Project, Build Settings using User Commands. It should be noted that for the example shown the script was contained in its own folder Scripts and not attached to the PSoC Creator project.


PSoC Creator Post Build Script - Increment Build Number
PSoC Creator Post Build Script - Increment Build Number
Shown in the capture below is the the Post Build command to call the VBScript: cscript ${ProjectDir}\Scripts\buildnumber.vbs


PSoC Creator Post Build CScript Call
PSoC Creator Post Build CScript Call
For this example project the Post Build was used. Depending on the requirement Pre Build may be needed.

PSoC - Build Number Usage
For the PSoC Creator project, the header file containing the build number is accessed in the usual manner using #include "buildnumber.h". For the example project the include was in main.c and the revision and build numbers were written to the serial port.

/****************************************************************************
* Build Number Example
*
* Uses a Visual Basic Script to find an increment 
* the integer associated with the variable BuildNumber
* 
* The script is called as a post-compiler command in
* the Project -> Build Settings menu
*
* Code implementation is a skeleton to illustrate usage of the script, error checking should be implemented
* 
* Credit to https://stackoverflow.com/users/1630171/ansgar-wiechers
* for ideas on the implementaion as mentioned on the following
* blog https://stackoverflow.com/questions/19891195/how-to-increment-values-in-resourse-file-by-using-vbscript
*
******************************************************/

#include "project.h"
#include "stdio.h"
#include "buildnumber.h"
char Version_Char[8];
int main(void)
{
    CyGlobalIntEnable; /* Enable global interrupts. */
    UART_Start();
    sprintf(Version_Char, "Version %d.%02d build %03d\r\n", MajorRev, MinorRev, BuildNumber);
    UART_UartPutString(Version_Char);
    for(;;)
    {
    }
/* [] END OF FILE */

Compiling PSoC Creator
When compiling a project, with the script below added to the Post Build command, a message is echoed from the script to indicate that the Build Number is being incremented.

cscript .\Scripts\buildnumber.vbs
Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.
Build number: Incrementing just the build located at:C:\...\UART_Example\UART_BuildNumber.cyds

UART Debug
Compiling the example project under PSoC Creator with the major, minor, build number set to 1.1.0, then programming the PSoC development board yields the screen capture below from TeraTerm.


Auto Incrementing Build Number Tera Term Debug
Auto Incrementing Build Number Tera Term Debug
Compiling the project again and programming the development board yields the capture below showing the increment in build number.


Auto Incrementing Build Number Tera Term Debug
Auto Incrementing Build Number Tera Term Debug

Example PSoC Creator Project
The example PSoC Creator 4.1 project and VBScript are available to download below. For comments or bugs leave a comment below, enjoy!


Increment Build Number Example Application PSoC Creator 4.1
Increment Build Number Example Application PSoC Creator 4.1


Increment Build Number Example VB Script
Increment Build Number Example Script