Let's get started ↑
Make sure you read through all of the steps below before starting. Note this is just what I did for my build — feel free to do your own thing. Go nuts!
⚠️ Warning
Following the steps in this guide involves making (mostly reversible) changes to the insides of your CyborgTop machine. This will invalidate your warranty. You'll also be running code you found on the internet on a powerful machine prodding your sensitive bits. Use common sense, make sure you fully understand what you're doing, and if in doubt… ask!
Skills you'll need ↑
- A very basic knowledge of electronics — e.g. understanding the difference between +5V and GND, knowing how to use a multimeter and how to strip wires.
- Basic competency with a drill
- Ability to flash firmware to the OSSM PCB (do it from source — it's more fun!)
Items you'll need ↑
You'll need the following items in order to complete this guide:
- A CyborgTop machine (or, theoretically, anything with a stepper motor controller!)
- An OSSM reference board (though in theory any ESP32-WROOM based dev board will probably be fine. Probably.)
- OSSM motor wiring harness (or something with a cable compatible with the connector on the underside of the PCB, with reasonable lengths on the wires)
- A means of supplying +5V to the mag switch on the OSSM. If you are running your OSSM PCB on 5V, you can use this directly. If you're running the PCB on 12V, you'll need something to convert. In either case, use the Servo Power block (green) on the PCB to obtain the same voltage you're providing into the barrel jack.
- A means of connecting the limit switch to the GPIO 33 pin on the PCB (a length of appropriate-gauge wire with a crimp connector on the end)
- A drill with a suitable bit to put a nice clean hole in the side of the CyborgTop (12mm or so)
- A few (small) terminal blocks, for connecting wires together (and putting things back if you want to reverse your changes)
- Cable ties to keep everything neat and away from moving parts
- Optional: 3D printed enclosure for the board (see the 3dprint folder for some inspiration)
- Optional: Self-adhesive Velcro strips to attach your PCB enclosure to the machine
- Optional: Power button
- Optional: A longer Cat6 cable — the default one provided with the OSSM remote isn't quite long enough
Overview ↑
Let's spend a few moments covering what we're going to be doing here. Your stock machine has a few key components:
- 48V power supply — provides power to the motor, motor controller and remote
- 48V stepper motor — a powerful precision motor used to move the arm
- Motor controller — drives the stepper motor
- Limit switch — lets the remote know when the arm has homed to its minimum position
- Remote — provides instructions to the motor controller, +5V power to the limit switch, and takes input from the switch so the machine can be homed. This is the part we're going to replace.
Stepper motors like the one in your machine are relatively complex devices — they not only draw a huge current, but also require a ton of complicated math to make them move the way you want, hold their position and not drift over time. The motor controller in your CyborgTop is a dedicated piece of hardware which reliably does exactly this. It receives instructions from the remote in the form of 'pulse' and 'direction' messages, which are sent to the PUL +/- and DIR +/- pins on the controller.
It's this mechanism we're going to borrow so the OSSM PCB can move the motor. This means we don't need to modify your original remote in any way.
Your OSSM board is designed to drive up to a 24V motor. OSSM by default also does not use a limit switch to find its home position — instead it measures the power draw of the motor to detect when it begins to 'strain' against the backstop.
Because the CyborgTop motor is double the power the OSSM PCB can provide, we're going to bypass the power supply feature of the PCB and instead power the motor directly. This means you'll need to power the OSSM PCB separately from the CyborgTop through its barrel jack (unless you want to get really creative and step down from 48V to ~5V for the OSSM PCB and limit switch. It's not worth the hassle — just go for a second independent 12V/5V power supply!)
Because we're not going to be powering the motor through the OSSM PCB, it'll have no way to know what power the motor is drawing… so we'll need to use the limit switch already present to let us know when we're home — from the OSSM PCB's perspective the motor will always draw zero current.
Wiring ↑
Here's how we're going to wire things up:
[+5V]=>[PWR SW]=>[OSSM PCB SERVO+]───[*]───[+5V LIMIT SWITCH ]
[ SERVO-]───[*]───[GND ]
[ GPIO33]─────────[SIGNAL ]
[ ]
[ DIR-]─────────────────────────┐
[ DIR+]───────────────────┐ │
[ PUL-]─────────────┐ │ │
[ PUL+]───────┐ │ │ │
│ │ │ │
[Mains Power]===>[PSU GND]────────┐ │ │ │ │
[ +48V]──┐ │ │ │ │ │
│ │ │ │ │ │
[Motor Controller +48V GND PUL+ PUL- DIR+ DIR- ]
* If you use +12V to drive the OSSM PCB, like I do, you'll need a 12V -> 5V level shifter here. I hide mine inside the CyborgTop, stuck on top of the stock PSU
Here's how I've set up the inside of my machine:
Key things:
- Your motor controller may look a little different — don't worry!
- You might want to use terminal blocks instead of soldering wires (such as the limit switch wiring) like I have, as it'll make it easier to reverse your changes later
- I've got a level shifter in mine as my OSSM board runs off 12V — you'll only need that if you need to step down to 5V from your OSSM PCB for the limit switch
Here's the outside of my machine — I've drilled a 12mm hole in the side panel to route the cables into the back of the 3D printed enclosure:
Be careful about cable routing and placement — you'll want to keep your cables (especially the limit switch signal cable) away from both the PSU and the stepper motor — otherwise you're likely to get a lot of false limit readings while homing!
Inside that enclosure, my setup looks like this:
Step-by-step ↑
Use the images and notes above to help you if you get stuck.
Act 1: Prepare the CyborgTop machine ↑
By the time you've finished these steps, you'll have the CyborgTop side of things ready.
- Disconnect your stock remote and set it aside. You won't need it again!
- Remove the left (viewed from the front of the machine) side panel from your machine (not the panel with the power connection on it!)
- Disconnect the large green plug from the motor controller. Leave the power connector attached.
- Make a note of which pins are DIR+/- and PUL+/-, and make sure you've got the right wires in the right place with respect to the connector on the OSSM wiring harness, then plug the connector into your motor controller.
- Cut the cable from your limit switch to give you plenty of length to play with.
- Tidy up the original motor controller wires and the remaining original limit switch wiring with a cable tie and secure somewhere out of the way of any moving parts (important!)
- Strip the cable leading to your limit switch — this will expose three wires:
- Blue is GND
- Brown is +5V
- Black is SIGNAL
- Attach all three to a terminal block. Add extra wires long enough to route through to the OSSM PCB.
- Cable tie the cable as shown above — you want to keep the signal wire far away from the power supply and motor, and any moving parts.
- Make a note of the current positions of the DIP switches on the motor controller. You'll need to set them back to this if you want to reverse your changes.
- Set your DIP switches to:
01111000(800 pul/rev, ccw, pul+dir mode, 0ms delay). ⚠️ This is critical — without this your machine will not function correctly! - You've now prepared the insides of the machine. Time to prepare the OSSM board.
Act 2: Prepare the OSSM PCB ↑
When you've finished these steps, you'll have an OSSM PCB flashed with the firmware.
- Connect the OSSM remote, then plug your OSSM PCB into your computer. It should power up and moan about homing.
- Check that the board shows up as a COM port. Make a note of the COM port number.
- Head over to the firmware flashing page and flash the firmware to your OSSM PCB.
- After flashing, reset the settings to safe defaults:
- Unplug the USB from the OSSM PCB
- Hold the button on the OSSM remote
- Plug the USB cable back in (keep the button held!)
- You'll see a message on the OSSM remote after a few seconds letting you know everything has been reset
- Release the button and the OSSM PCB will reboot
- It'll moan about homing again
- Your OSSM PCB is now ready. Next up is a bench test to make sure everything works.
Act 3: Connect it all up and bench test ↑
It's time to make sure everything works before you finish up.
⚠️ Follow this section carefully so you don't damage your machine.
- Put your OSSM PCB next to your machine and connect everything up:
- Limit switch +5V to SERVO+
- Limit switch GND to SERVO-
- Limit switch SIGNAL to GPIO 33 (be careful — it's the second pin from the left in the IO33 row)
- Wiring harness JST connector to the DIR+/- PUL+/- connector on the PCB (double-check the wires are correct for your motor controller!)
- Connect the OSSM remote
- Connect (but do NOT switch on yet) the power for your OSSM PCB
- Make sure power to your CyborgTop machine is DISCONNECTED so the motor is UNPOWERED (important!)
- Check your limit switch works correctly:
- Manually move the arm on the CyborgTop away from the home position (10cm or so)
- Power on the OSSM PCB. Wait for
Homing...to appear on the screen - Manually move the arm on the CyborgTop to the home position, so the limit switch is engaged
- The OSSM should report homed and display the main pattern screen
- Check motor control:
- Power everything off
- Move the arm on the CyborgTop machine away from the home position
- Connect power to your CyborgTop machine and switch on. Your machine should power on but nothing should move.
- Power on the OSSM PCB
- The arm should slowly move to the home position
- The OSSM remote should show a successful homing
- You're done! It works!
Common problems ↑
Homing stops short of the home position: The mag switches are quite sensitive. Make sure the arm on the machine is close to home before powering on.
The arm moves, but homing fails: Your limit switch is probably not wired up correctly — check you've got the wires the right way around and your SIGNAL cable is connected to the right GPIO pin.
The arm moves in the wrong direction when homing: Check your DIR pins are the right way around.
The arm doesn't move: Check you've got power to your motor controller (there should be a light on it!), the DIP switches are right, and your DIR+/- and PUL+/- pins are correctly connected.
Act 4: Finish up ↑
Now you know everything works, it's time to finish everything off.
- Decide where you want to drill a hole through your side panel. Take into account where the wires will go, and where you want the box to sit on the outside of the machine. I mount mine just underneath the ventilation holes on the side panel.
- Drill a hole and remove any burrs.
- Install the OSSM PCB, power switch and enclosure wiring into the enclosure.
- Disconnect any cables from your OSSM PCB and route them through the hole in the panel and bottom of the enclosure.
- Reconnect everything to the OSSM PCB.
- Put Velcro strips on the back of the enclosure, then attach it to the side panel.
- Tidy up any spare wire length and put the lid on the enclosure.
- Give everything one last test on your bench.
- You're done! Happy buggering! 🎉