Developing a smart servo board.

More
03 Dec 2012 16:04 #27132 by Storken
Hello. I've been looking into cnc machines and something that strikes me is how expensive many of the motor driver solutions are.

I've built some brushless motor controllers based on FOC with or w/o Hall-feedback. They're in use on some e-bikes. However, to build more powerful ebike controllers, I need access to a cnc machine - and as I learn about cnc; ideas are popping up here aswell.

The whole CNC scene is new to me, I still study the topic. Without having setup a CNC (yet), the simple step/dir command seems to be from a era based on steppers (?). What I envision is something like these simple commands:

setposition(axis, position, speed, accel);
- axis specifies what motor to run (x, y, z...)
- position specifies to what position it will run
- speed, wanted speed, a closed (PID) loop will regulate this
- accel, regulating phase amps will effectively limit torque

getposition(axis);
- returns the whereabouts, with speed and everything.

gohome;
- calibrates itself.

etc

Position would be measured in hall-state-changes.
Using a simple 32bit AVR mikrocontroller would 'do it all'. Full speed usb communication (not that it would be needed), Pwm generation, current readings, fault detection (collision detection? Simple, look for a current spike) and possibly having features like homing built in - freeing up io ports.

Is this implementable into HAL or similar? I get the feeling this is inbetween motion-planning and g-code.

Any feedback would be appreciated :)

Please Log in or Create an account to join the conversation.

More
03 Dec 2012 18:09 #27135 by cncbasher
Linuxcnc has all the functionality you require , it differs from most other motion controllers in that it uses the pc as the controller , and therefore does not suffer from limited memory etc
and will also support servo and stepper systems . using the parrell port is the limiting factor , but using PCI and other addon cards this can give you up to 96 pins of IO
then just add on a stepper or servo driver as needed , Linuxcnc supports both open and closed loop systems , where others cannot due to limitation on io pins and speed

AVR'S and micros are limited in the number of pins available etc
such as the sanguino the reprap people use , as an example , and limited in the amount of code and speed it can operate at

Please Log in or Create an account to join the conversation.

More
03 Dec 2012 18:39 #27136 by cmorley
Linuxcnc prefers hardware that is relatively dumb.
The motor drives job is to move the motor at the speed or torque that linuxcnc asks for and that's basically it.
so that leave step/direction drives or +-10 volt analog drives.
There has been work on other protocols outside of the repository.
Take a look at this:
wiki.linuxcnc.org/cgi-bin/wiki.pl?Emc2HardwareDesign

Not that other ways haven't need done. But they usually lock you into a one set of hardware, and that's not we are interested in.

How were you planning on communicating to the microcontroller? USB?

Chris M

Please Log in or Create an account to join the conversation.

More
03 Dec 2012 21:49 #27141 by andypugh

The whole CNC scene is new to me, I still study the topic. Without having setup a CNC (yet), the simple step/dir command seems to be from a era based on steppers (?).

Yes. Using step-dir servo drives is very much against the LinuxCNC ethos. It moves the control loop to somewhere where it is invisible to the controller system.

setposition(axis, position, speed, accel);

Actually, this is rather what a step-dir servo drive is. You send step/dir pulses that encode a target position, and the drive makes the motor go there.
A more "modern" system is the Mesa 8i20 drive. With that card you send a phase angle and current request digitally (high-speed serial link) and that is all the drive does. Interpreting Hall sensors and encoders and calculating what current is needed to move the axes to the required position is all done in the PC. This puts the bare minimum of the control system external to the PC.

Position would be measured in hall-state-changes.

Hall states typically change too infrequently to give good position feedback. (It _might_ work with 14-magnet LRK motors, which have 84 hall state changes per rev, with high gear ratios or low-pitch ballscrews, but a standard servo motor has 4, 6 or 8 poles normally).

LinuxCNC configurations using an 8i20 typically only use Hall sensors until the first Hall transition, then switch to sinusoidal commutation based on the position data from an incremental encoder.
(one advantage of running the controller in a PC is that there is plenty of CPU for trigonometrical manipulations)

Please Log in or Create an account to join the conversation.

Moderators: PCWjmelson
Time to create page: 0.271 seconds
Powered by Kunena Forum