Sorting through code from Fiverr programmer

This is almost never true, it usually just leads to greater complexity.

What you have here is not a simple setup. I'd be curious how much someone on Fiverr wanted to build this system, because even at the lower end of rates in this area (Upper Midwest, USA), you are well into the $ thousands.

Personally, I'd heed the suggestion to replace all your arduinos with an ESP32. I'd probably install FreeRTOS to simplify the coding.

If you can't change the address of the AS5600, then there's not a lot of value to using I2C and you may as well use its analog output to read position.

Have you ever seen any part of this system working? It's a lot of functionality to just "throw over the fence" and say it's done.

This is key - there should have been several other programs built before this monster that demonstrated a subset of the functionality.

There have been a few test programs with a very simple version of this. I ran the Mega by itself with; 4 potentiometer inputs, 4 motor controllers run directly by the pins on the Mega, using potentiometers for feedback. It worked, but obviously the potentiometers weren't accurate enough. Even after tuning the PID, the operation wasn't smooth. I haven't run the AS5600 in this setup, since running them using PWM would have been basically the same thing. The problem came when I needed to upgrade to 6 PID/motor controller/AS5600 sets. PWM pin limits and all that... I didn't want to have someone create a simple version, then turn around and have to re-do all of it to accommodate the major change in how it was set up.

This is a red flag to me. Why weren't the pots good enough? Did you need more than 10bits resolution?

Generic 10k potentiometers have issues. Even with data smoothing, they 'jitter' enough to be a problem. I want something more reliable, and that doesn't have the 3/4 turn limit like the ones I have. Also, I need to keep things small. A 10 turn potentiometer is huge in comparison and a 10 turn pot is 4 times the cost of an AS5600.

OK, got it. I've used the magnetic encoders to replace 10-turn Bourns position indication pots for reliability reasons, but I thought you meant that the pot didn't have enough resolution something.
I understand now.

What I meant by a lot of functionality to throw over the fence is that your Fiverr programmer should have been providing you with intermediate stages of work as they progressed so if something went wrong, it could be corrected right away. Even if it's as simple as "working motor," "working AS5500 measurement," "working motor position controlled by AS5500," etc...

Looking at the code the OP has provided, I don't think the Fiverr programmer got far enough to have anything operational, other than the ESP-01 receiving the message from the mqtt server and sending it to the mega, and even that looks more amateurish than how I would code it.

1 Like

The programmer is an amateur, but had a lot of 5 star reviews. I don't have the $$ to afford a pro, so I took a chance with him. I am just going to try and figure out how I can move forward from here.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.